ssm

package
v0.0.0-...-c586f74 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The default path for Agent Registration State on Linux.
	DefaultSSMRegistrationPath = filepath.Join(appconfig.DefaultDataStorePath, "registration")
)

Functions

func IsManagedInstance

func IsManagedInstance(s string) bool

IsManagedInstance tests whether the provided EC2 instance identifier is managed.

func ReadRegistrationFile

func ReadRegistrationFile(path string) (id string, err error)

func SanitizeTag

func SanitizeTag(t string) string

Types

type Activation

type Activation struct {
	ActivationId   string `json:"ActivationId"`
	ActivationCode string `json:"ActivationCode"`
}

type Config

type Config struct {
	*aws.Config

	InstanceRole string
}

type CustomInventory

type CustomInventory struct {
	TypeName    string
	ManagedId   string
	CaptureTime string
	Content     map[string]string
}

func (*CustomInventory) ContentHash

func (c *CustomInventory) ContentHash() string

type InstanceInfo

type InstanceInfo struct {
	InstanceId     string `json:"instance-id"`
	Region         string `json:"region"`
	ReleaseVersion string `json:"release-version"`
}

InstanceInfo contains information for instances registered with SSM. This is collected from the output of the following command:

ssm-cli get-instance-information

func GetInstanceInformation

func GetInstanceInformation() (*InstanceInfo, error)

type ManagedInstance

type ManagedInstance struct {
	ActivationId     string
	ManagedId        string
	Name             string
	RegistrationDate time.Time
}

type ResourceTags

type ResourceTags struct {
	ManagedId string            `json:"ManagedId"`
	Tags      map[string]string `json:"Tags"`
}

type SSM

type SSM struct {
	ssmiface.SSMAPI
	// contains filtered or unexported fields
}

func New

func New(config *Config) *SSM

func (*SSM) AddTagsToResource

func (s *SSM) AddTagsToResource(ctx context.Context, input *ResourceTags) error

func (*SSM) CreateActivation

func (s *SSM) CreateActivation(ctx context.Context, name string) (*Activation, error)

func (*SSM) DeregisterManagedInstance

func (s *SSM) DeregisterManagedInstance(ctx context.Context, managedId string) error

func (*SSM) DescribeInstanceInformation

func (s *SSM) DescribeInstanceInformation(ctx context.Context, activationId string) (*ManagedInstance, error)

func (*SSM) PutInventory

func (s *SSM) PutInventory(ctx context.Context, inv *CustomInventory) error

Jump to

Keyboard shortcuts

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