ssm

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentReady

func AgentReady(svc ssmiface.SSMAPI, instanceID string, waitTime time.Duration) (bool, error)

AgentReady checks if an SSM agent is ready. Inputs:

svc is an Amazon SSM service client
name is the name of the parameter

Output:

If success, return true and nil
Otherwise, return false and an error from the call to DescribeInstanceInformation

func DeleteParam

func DeleteParam(svc ssmiface.SSMAPI, name string) error

DeleteParam deletes a parameter in SSM Inputs:

svc is an Amazon SSM service client
name is the name of the parameter

Output:

If success, information about the parameter and nil
Otherwise, nil and an error from the call to DeleteParam

func GetParam

func GetParam(svc ssmiface.SSMAPI, name string) (string, error)

GetParam fetches details of a parameter in SSM Inputs:

svc is an Amazon SSM service client
name is the name of the parameter
value is the value of the parameter
paramType is the type of parameter

Output:

If success, information about the parameter and nil
Otherwise, nil and an error from the call to GetParam

func PutParam

func PutParam(svc ssmiface.SSMAPI, name string, value string, paramType string, overwrite bool) error

PutParam creates a parameter in SSM Inputs:

svc is an Amazon SSM service client
name is the name of the parameter
value is the value of the parameter
type is the type of parameter
overwrite sets the flag to rewrite
a parameter value

Output:

If success, information about the parameter and nil
Otherwise, nil and an error from the call to PutParam

func RunCommand

func RunCommand(svc ssmiface.SSMAPI, instanceID string, command []string) (string, error)

RunCommand runs an input command using SSM. Inputs:

svc is an Amazon SSM service client
instanceID is the instance to run the command on
command is the command to run

Output:

If successful, the command output and nil will be returned.

Types

type Connection

type Connection struct {
	Client  ssmiface.SSMAPI
	Session *session.Session
	Params  Params
}

Connection contains all of the relevant information to maintain an SSM connection.

func CreateConnection

func CreateConnection() Connection

CreateConnection creates a connection with SSM and returns it.

type Params

type Params struct {
	Name      string
	Value     string
	Type      string
	Overwrite bool
}

Params provides parameter options for SSM.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL