ssm

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultSsmInstallerRegion = "us-west-2"

Initial region ssm installer is downloaded from. When installer runs, it will down the agent from the proper region configured in the nodeConfig during init command

Variables

View Source
var (
	SsmDaemonName = "amazon-ssm-agent"
)

Functions

func CheckEndpointAccess

func CheckEndpointAccess(ctx context.Context, config aws.Config) error

func Deregister added in v1.0.4

func Deregister(ctx context.Context, registration *SSMRegistration, ssmClient SSMClient, logger *zap.Logger) error

func Install

func Install(ctx context.Context, opts InstallOptions) error

func NewSsmDaemon

func NewSsmDaemon(daemonManager daemon.DaemonManager, cfg *api.NodeConfig, logger *zap.Logger) daemon.Daemon

func Uninstall

func Uninstall(ctx context.Context, opts UninstallOptions) error

Uninstall de-registers the managed instance and removes all files and components that make up the ssm agent component.

func Upgrade added in v1.0.4

func Upgrade(ctx context.Context, opts InstallOptions) error

func WaitForAWSConfig

func WaitForAWSConfig(ctx context.Context, nodeConfig *api.NodeConfig, backoff time.Duration) (aws.Config, error)

Types

type AccessValidator

type AccessValidator struct {
	// contains filtered or unexported fields
}

AccessValidator validates access to the AWS SSM API endpoint.

func NewAccessValidator

func NewAccessValidator(aws aws.Config) AccessValidator

NewAccessValidator returns a new AccessValidator.

func (AccessValidator) Run

type HybridInstanceRegistration

type HybridInstanceRegistration struct {
	ManagedInstanceID string `json:"ManagedInstanceID"`
	Region            string `json:"Region"`
}

type InstallOptions added in v1.0.3

type InstallOptions struct {
	Tracker     *tracker.Tracker
	Source      Source
	Logger      *zap.Logger
	Region      string
	InstallRoot string
}

type PkgSource

type PkgSource interface {
	GetSSMPackage() artifact.Package
}

PkgSource serves and defines the package for target platform

type SSMClient added in v1.0.4

type SSMClient interface {
	DescribeInstanceInformation(ctx context.Context, params *awsSsm.DescribeInstanceInformationInput, optFns ...func(*awsSsm.Options)) (*awsSsm.DescribeInstanceInformationOutput, error)
	DeregisterManagedInstance(ctx context.Context, params *awsSsm.DeregisterManagedInstanceInput, optFns ...func(*awsSsm.Options)) (*awsSsm.DeregisterManagedInstanceOutput, error)
}

type SSMInstallerOption added in v1.0.3

type SSMInstallerOption func(*ssmInstallerSource)

func WithPublicKey added in v1.0.3

func WithPublicKey(key string) SSMInstallerOption

WithPublicKey allows setting the public key for signature validation

func WithURLBuilder added in v1.0.3

func WithURLBuilder(builder func() (string, error)) SSMInstallerOption

WithURLBuilder allows overriding the SSM installer download URL.

type SSMRegistration added in v1.0.4

type SSMRegistration struct {
	// contains filtered or unexported fields
}

func NewSSMRegistration added in v1.0.4

func NewSSMRegistration(opts ...SSMRegistrationOption) *SSMRegistration

func (*SSMRegistration) GetManagedHybridInstanceId added in v1.0.4

func (r *SSMRegistration) GetManagedHybridInstanceId() (string, error)

func (*SSMRegistration) GetRegion added in v1.0.4

func (r *SSMRegistration) GetRegion() string

GetRegion returns the region of the managed hybrid instance If the instance is not registered, it returns an empty string errors are ignored and an empty string is returned

func (*SSMRegistration) RegistrationFilePath added in v1.0.4

func (r *SSMRegistration) RegistrationFilePath() string

RegistrationFilePath returns the path to the SSM registration file If installRoot is not set, it will return the path starting from the disk root

type SSMRegistrationOption added in v1.0.4

type SSMRegistrationOption func(*SSMRegistration)

func WithInstallRoot added in v1.0.4

func WithInstallRoot(installRoot string) SSMRegistrationOption

type Source

type Source interface {
	GetSSMInstaller(ctx context.Context) (io.ReadCloser, error)
	GetSSMInstallerSignature(ctx context.Context) (io.ReadCloser, error)
	PublicKey() string
}

Source serves an SSM installer binary for the target platform.

func NewSSMInstaller

func NewSSMInstaller(logger *zap.Logger, region string, opts ...SSMInstallerOption) Source

SSMInstaller provides a Source that retrieves the SSM installer from the official release endpoint.

type UninstallOptions added in v1.0.4

type UninstallOptions struct {
	Logger *zap.Logger
	// InstallRoot is optionally the root directory of the installation
	// If not provided, the default will be /
	InstallRoot     string
	SSMRegistration *SSMRegistration
	SSMClient       SSMClient
	PkgSource       PkgSource
}

Jump to

Keyboard shortcuts

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