server

package
v1.2.3-fred.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AWSInstanceStateName represents the state of the AWS EC2
	// instance - (pending | running | shutting-down | terminated | stopping | stopped )
	// https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
	// Used for filtering instances for automatic EC2 discovery
	AWSInstanceStateName = "instance-state-name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EC2Instances

type EC2Instances struct {
	// Region is the AWS region where the instances are located.
	Region string
	// DocumentName is the SSM document that should be executed on the EC2
	// instances.
	DocumentName string
	// Parameters are parameters passed to the SSM document.
	Parameters map[string]string
	// AccountID is the AWS account the instances belong to.
	AccountID string
	// Instances is a list of discovered EC2 instances
	Instances []*ec2.Instance
}

EC2Instances contains information required to send SSM commands to EC2 instances

type SSMInstaller

type SSMInstaller struct {
	SSMInstallerConfig
}

SSMInstaller handles running SSM commands that install Teleport on EC2 instances.

func NewSSMInstaller

func NewSSMInstaller(cfg SSMInstallerConfig) *SSMInstaller

NewSSMInstaller returns a new instance of the SSM installer that installs Teleport on EC2 instances.

func (*SSMInstaller) Run

func (si *SSMInstaller) Run(ctx context.Context, req SSMRunRequest) error

Run executes the SSM document and then blocks until the command has completed.

type SSMInstallerConfig

type SSMInstallerConfig struct {
	// Emitter is an events emitter.
	Emitter apievents.Emitter
}

SSMInstallerConfig represents configuration for an SSM install script executor.

type SSMRunRequest

type SSMRunRequest struct {
	// DocumentName is the name of the SSM document to run.
	DocumentName string
	// SSM is an SSM API client.
	SSM ssmiface.SSMAPI
	// Instances is the list of instances that will have the SSM
	// document executed on them.
	Instances []*ec2.Instance
	// Params is a list of parameters to include when executing the
	// SSM document.
	Params map[string]string
	// Region is the region instances are present in, used in audit
	// events.
	Region string
	// AccountID is the AWS account being used to execute the SSM document.
	AccountID string
}

SSMRunRequest combines parameters for running SSM commands on a set of EC2 instances.

type Watcher

type Watcher struct {
	// InstancesC can be used to consume newly discovered EC2 instances
	InstancesC chan EC2Instances
	// contains filtered or unexported fields
}

Watcher allows callers to discover AWS instances matching specified filters.

func NewCloudWatcher

func NewCloudWatcher(ctx context.Context, matchers []services.AWSMatcher, clients cloud.Clients) (*Watcher, error)

NewCloudWatcher creates a new cloud watcher instance.

func (*Watcher) Run

func (w *Watcher) Run()

Run starts the watcher's main watch loop.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher

Jump to

Keyboard shortcuts

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