Documentation ¶
Index ¶
- func AgentReady(svc ssmiface.SSMAPI, instanceID string, waitTime time.Duration) (bool, error)
- func CheckAWSCLIInstalled(svc ssmiface.SSMAPI, instanceID string) (bool, error)
- func DeleteParam(svc ssmiface.SSMAPI, name string) error
- func GetParam(svc ssmiface.SSMAPI, name string) (string, error)
- func ListAllParameters(svc ssmiface.SSMAPI) ([]*ssm.ParameterMetadata, error)
- func PutParam(svc ssmiface.SSMAPI, name string, value string, paramType string, ...) error
- func RunCommand(svc ssmiface.SSMAPI, instanceID string, command []string) (string, error)
- type Connection
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentReady ¶
AgentReady checks if an SSM agent is ready on the instance.
**Parameters:**
svc: AWS SSM service client. instanceID: AWS EC2 instance ID to check. waitTime: Maximum wait time before timing out.
**Returns:**
bool: True if the agent is ready, false otherwise. error: An error if any issue occurs while checking the agent.
func CheckAWSCLIInstalled ¶ added in v1.1.1
CheckAWSCLIInstalled checks if AWS CLI is installed on the instance.
**Parameters:**
svc: AWS SSM service client. instanceID: AWS EC2 instance ID to check.
**Returns:**
bool: True if AWS CLI is installed, false otherwise. error: An error if any issue occurs while checking the installation.
func DeleteParam ¶
DeleteParam removes a parameter from AWS SSM.
**Parameters:**
svc: AWS SSM service client. name: Name of the parameter to delete.
**Returns:**
error: An error if any issue occurs while deleting the parameter.
func GetParam ¶
GetParam retrieves a parameter from AWS SSM.
**Parameters:**
svc: AWS SSM service client. name: Name of the parameter.
**Returns:**
string: Value of the parameter. error: An error if any issue occurs while fetching the parameter.
func ListAllParameters ¶ added in v1.1.2
func ListAllParameters(svc ssmiface.SSMAPI) ([]*ssm.ParameterMetadata, error)
ListAllParameters retrieves all parameters in the AWS SSM.
**Parameters:**
svc: AWS SSM service client.
**Returns:**
([]*ssm.ParameterMetadata): List of all parameters' metadata. error: An error if any issue occurs while fetching the parameters.
func PutParam ¶
func PutParam(svc ssmiface.SSMAPI, name string, value string, paramType string, overwrite bool) error
PutParam creates or updates a parameter in AWS SSM.
**Parameters:**
svc: AWS SSM service client. name: Name of the parameter. value: Value of the parameter. paramType: Type of the parameter. overwrite: Flag to overwrite an existing parameter.
**Returns:**
error: An error if any issue occurs while creating or updating the parameter.
func RunCommand ¶
RunCommand executes an input command on an AWS instance via SSM.
**Parameters:**
svc: AWS SSM service client. instanceID: AWS EC2 instance ID where the command should run. command: List of command strings to be run.
**Returns:**
string: Output of the command execution. error: An error if any issue occurs while executing the command.
Types ¶
type Connection ¶
Connection represents the necessary information to maintain an AWS Systems Manager (SSM) connection.
**Attributes:**
Client: Amazon SSM service client interface. Session: AWS session from which the client is derived. Params: Structure with parameters for the SSM service.
func CreateConnection ¶
func CreateConnection() Connection
CreateConnection establishes a connection with AWS SSM.
**Returns:**
Connection: Struct with a connected SSM client and session.