aws

package
v0.0.0-...-35696f1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AWSClientContextKey         ContextKeyType = "AWSClient"
	DefaultStackCreationTimeout                = 30 * time.Minute
	DefaultSSHPortReadyTimeout                 = 2 * time.Minute
	DefaultRemoteUser                          = "ubuntu"
)
View Source
const (
	// DefaultRegion is the default AWS region to be used.
	DefaultRegion = "eu-central-1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSEnv

type AWSEnv struct {
	*docker.DockerHelper
	// contains filtered or unexported fields
}

AWS Environment.

func New

func New(config *Config, opts ...ConfigOptFn) (*AWSEnv, error)

func (*AWSEnv) Context

func (e *AWSEnv) Context(ctx context.Context) (context.Context, error)

func (*AWSEnv) Endpoints

func (e *AWSEnv) Endpoints(_ context.Context) (*types.Endpoints, error)

func (*AWSEnv) ServiceLogs

func (e *AWSEnv) ServiceLogs(ctx context.Context, _ []string, startTime time.Time, stdout, stderr io.Writer) error

func (*AWSEnv) SetUp

func (e *AWSEnv) SetUp(ctx context.Context) error

Setup AWS test environment from cloud formation template. * Create a new CloudFormation stack from template (upload template file to S3 is required since the template is larger than 51,200 bytes). * Create test asset. * When infrastructure is ready, start SSH port forwarding and remote docker client.

func (*AWSEnv) TearDown

func (e *AWSEnv) TearDown(ctx context.Context) error

type Config

type Config struct {
	// WorkDir absolute path to the directory where the deployment files prior performing actions
	WorkDir string `mapstructure:"work_dir"`
	// EnvName the name of the stack to be created
	EnvName string `mapstructure:"env_name"`
	// Region the AWS region to be used
	Region string `mapstructure:"region"`
	// PublicKeyFile the public key file to be used for the key pair
	PublicKeyFile string `mapstructure:"public_key_file"`
	// PrivateKeyFile the private key file to be used for the key pair
	PrivateKeyFile string `mapstructure:"private_key_file"`
}

Config defines configuration for AWS environment.

type ConfigOptFn

type ConfigOptFn func(*Config) error

ConfigOptFn defines transformer function for Config.

func WithWorkDir

func WithWorkDir(dir string) ConfigOptFn

WithWorkDir set workDir for Config.

type ContextKeyType

type ContextKeyType string

type Server

type Server struct {
	InstanceID string
	PublicIP   string
}

func (Server) WaitForSSH

func (s Server) WaitForSSH(ctx context.Context, t time.Duration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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