aws

package
v0.0.0-...-00f4f89 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TargetTypeInstanceID points to an instance ID type
	TargetTypeInstanceID = "instance-id"
	// TargetTypePrivateDNS points to a private DNS type
	TargetTypePrivateDNS = "private-dns"
	// TargetTypeName points to a name type
	TargetTypeName = "name"
)

Variables

This section is empty.

Functions

func AppendUserAgent

func AppendUserAgent(suffix string) error

AppendUserAgent will add given suffix to HTTP client's user agent

func VerifyDependencies

func VerifyDependencies() error

VerifyDependencies will check all necessary dependencies

Types

type Cloud

type Cloud interface {
	NewWithConfig(c *Config) error
}

Cloud wraps init methods used from the aws package

type CloudInstances

type CloudInstances interface {
	Cloud
	ListInstances() ([]*Instance, error)
	StartSession(targetType, target string) error
}

CloudInstances wraps instances methods used from the aws package

type CloudSSH

type CloudSSH interface {
	Cloud
	StartSSH(targetType, target, osUser string, portNumber uint64, publicKey []byte) error
}

CloudSSH wraps ssh methods used from the aws package

type CloudSessions

type CloudSessions interface {
	Cloud
	ListSessions() ([]*Session, error)
	TerminateSession(sessionID string) error
}

CloudSessions wraps sessions methods used from the aws package

type Config

type Config struct {
	Filters  Filters
	Region   string
	Profile  string
	MFAToken string
	Trace    bool
}

Config contains provider's configuration

type Filters

type Filters struct {
	Instance InstanceFilters `mapstructure:"instance"`
	Session  SessionFilters  `mapstructure:"session"`
}

Filters grouped per type

type Instance

type Instance struct {
	Hostname       string `json:"hostname" yaml:"hostname"`
	IPAddress      string `json:"ip_address" yaml:"ip_address"`
	ID             string `json:"id" yaml:"id"`
	PrivateDNSName string `json:"private_dns_name" yaml:"private_dns_name"`
	Name           string `json:"name" yaml:"name"`
	OSName         string `json:"os_name" yaml:"os_name"`
	OSType         string `json:"os_type" yaml:"os_type"`
	OSVersion      string `json:"os_version" yaml:"os_version"`
}

Instance contain information about the EC2 instance

type InstanceFilters

type InstanceFilters struct {
	IDs  []string    `json:"ids" mapstructure:"ids,remain"`
	Tags []TagValues `json:"tags" mapstructure:"tags,remain"`
}

InstanceFilters contain all types of filters used to limit results

type Provider

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

Provider contains necessary components like the session

func (*Provider) ListInstances

func (p *Provider) ListInstances() ([]*Instance, error)

ListInstances provides a list of active instances with SSM agent

func (*Provider) ListSessions

func (p *Provider) ListSessions() ([]*Session, error)

ListSessions provides a list of active SSM sessions

func (*Provider) NewWithConfig

func (p *Provider) NewWithConfig(c *Config) error

NewWithConfig will generate an AWS Provider with given configuration

func (*Provider) StartSSH

func (p *Provider) StartSSH(targetType, target, osUser string, portNumber uint64, publicKey []byte) error

StartSSH will start a ssh proxy session for a chosed node

func (*Provider) StartSession

func (p *Provider) StartSession(targetType, target string) error

StartSession will start a session for a chosed node

func (*Provider) TerminateSession

func (p *Provider) TerminateSession(sessionID string) error

TerminateSession will close chosed active session

type Session

type Session struct {
	SessionID string `json:"session_id" yaml:"session_id"`
	Target    string `json:"target" yaml:"target"`
	Status    string `json:"status" yaml:"status"`
	StartDate string `json:"start_date" yaml:"start_date"`
	Owner     string `json:"owner" yaml:"owner"`
}

Session contains information about SSM sessions

type SessionFilters

type SessionFilters struct {
	After  string `json:"after" mapstructure:"after,remain"`
	Before string `json:"before" mapstructure:"before,remain"`
	Target string `json:"target" mapstructure:"target,remain"`
	Owner  string `json:"owner" mapstructure:"owner,remain"`
}

SessionFilters for SSM sessions

type TagValues

type TagValues struct {
	Key    string   `json:"key" mapstructure:"key,remain"`
	Values []string `json:"values" mapstructure:"values,remain"`
}

TagValues contain list of values for specific key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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