aws

package
v0.0.0-...-84d5e29 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: 25 Imported by: 1

README

To test AWS

You will first need to create an AWS instance and then provide details of this instance as below.

export AWS_REGION=<instance-region>
export AWS_ZONE=<aws-availibility-zone>
export AWS_INSTANCE_NAME=<aws-instance-name>
export AWS_ACCESS_KEY_ID=<access-id>
export AWS_SECRET_ACCESS_KEY=<access-secret>
export AWS_INSTANCE_TYPE=<aws-instance-type>
go test

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAWSEnvNotAvailable is the error type when aws credentials are not set
	ErrAWSEnvNotAvailable = fmt.Errorf("aws credentials are not set in environment")
)
View Source
var RatelimitingExponentialBackoff = wait.Backoff{
	Duration: 2 * time.Second,
	Factor:   2.0,
	Jitter:   1.0,
	Steps:    5,
}

RatelimitingExponentialBackoff will lead to a backoff of a max of around 2 minutes. TestScale unit tests was used to come up with this empherical number.

Functions

func DescribeInstanceByID

func DescribeInstanceByID(service *ec2Wrapper, id string) (*ec2.Instance, error)

DescribeInstanceByID describes the given instance by instance ID

func GetMetadataInstance

func GetMetadataInstance() (*ec2metadata.EC2Metadata, error)

GetMetadataInstance is the function to be called when trying to get metadata/user data on eks.

func GetMetadataWithTimeoutAndBackoff

func GetMetadataWithTimeoutAndBackoff(metadata *ec2metadata.EC2Metadata, path string) (string, error)

GetMetadataWithTimeoutAndBackoff will get metadata with exponential backoff.

func GetUserDataWithTimeoutAndBackoff

func GetUserDataWithTimeoutAndBackoff(metadata *ec2metadata.EC2Metadata) (string, error)

GetUserDataWithTimeoutAndBackoff will get user data with exponential backoff.

func NewClient

func NewClient(k8sSecretName, k8sSecretNamespace string) (cloudops.Ops, error)

NewClient creates a new cloud operations client for AWS

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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