aws

package
v0.0.0-...-7501429 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVmsCount

func CheckVmsCount(regions []string, prefix string) (int, error)

func ClearTFBucket

func ClearTFBucket(name, region string) error

ClearTFBucket ebsure TF bucket exists

func CloudWatchCheck

func CloudWatchCheck(t *testing.T, awsRegions []string, prefix string, expectedAlertsPerRegion map[string]int) bool

CloudWatchCheck checks cloud watch

func DeleteInstances

func DeleteInstances(ctx context.Context, client *ec2.EC2, instanceIDs []string) error

func DeleteTFBucket

func DeleteTFBucket(name, region string) error

DeleteTFBucket clear and deleted bucket

func DetachASGInstances

func DetachASGInstances(ctx context.Context, client *autoscaling.AutoScaling, asgName string, instanceIDs []string) error

func EnsureTFBucket

func EnsureTFBucket(name, region string) (bool, error)

EnsureTFBucket ebsure TF bucket exists

func GetHealthyEc2InstanceIdsByTag

func GetHealthyEc2InstanceIdsByTag(t *testing.T, region string, tagName string, tagValue string) []string

GetHealthyEc2InstanceIdsByTag External function that returns a list of instance IDs that are running in given region

func NLBCheck

func NLBCheck(t *testing.T, lbs []string, awsRegions []string, exposePrometheus bool) bool

NLBCheck checks NLB

func SGCheck

func SGCheck(t *testing.T, awsRegions []string, prefix string, exposePrometheus, exposeSSH bool) bool

SGCheck checks security groups

func SSMCheck

func SSMCheck(t *testing.T, awsRegions []string, prefix string) bool

SSMCheck checks ssm parameters

func VolumesCheck

func VolumesCheck(t *testing.T, awsRegions []string, prefix string) bool

VolumesCheck checks volumes

Types

type AgsGroups

type AgsGroups []*autoscaling.Group

func GetRegionASGs

func GetRegionASGs(ctx context.Context, client *autoscaling.AutoScaling, prefix string) (AgsGroups, error)

func (AgsGroups) AsgInstancePair

func (a AgsGroups) AsgInstancePair(regionID int) []AsgInstancePair

type AgsGroupsList

type AgsGroupsList []AgsGroups

func GetASGs

func GetASGs(ctx context.Context, clients []*autoscaling.AutoScaling, prefix string) (AgsGroupsList, error)

func (AgsGroupsList) AsgInstancePairs

func (a AgsGroupsList) AsgInstancePairs() []AsgInstancePair

func (AgsGroupsList) GroupsCount

func (a AgsGroupsList) GroupsCount() int

func (AgsGroupsList) InstancesCount

func (a AgsGroupsList) InstancesCount() int

func (AgsGroupsList) InstancesCountPerRegion

func (a AgsGroupsList) InstancesCountPerRegion() []int

type AsgInstancePair

type AsgInstancePair struct {
	InstanceID string
	ASGName    string
	RegionID   int
}

type AsgToInstancesByRegion

type AsgToInstancesByRegion []map[string][]string

func NewAsgInstancesByRegion

func NewAsgInstancesByRegion(count int) AsgToInstancesByRegion

func (*AsgToInstancesByRegion) InstancesCount

func (a *AsgToInstancesByRegion) InstancesCount() int

func (*AsgToInstancesByRegion) InstancesIDs

func (a *AsgToInstancesByRegion) InstancesIDs() []string

type Validator

type Validator struct {
	Value int
	AsgInstancePair
}

func GetValidator

func GetValidator(
	ctx context.Context,
	clients []*cloudwatch.CloudWatch,
	asgs AgsGroupsList,
	metricNamespace,
	metricName string,
) (Validator, error)

func WaitForValidator

func WaitForValidator(
	ctx context.Context,
	clients []*cloudwatch.CloudWatch,
	asgs AgsGroupsList,
	metricNamespace,
	metricName string,
	period int,
) (Validator, error)

func WaitForValidatorRegions

func WaitForValidatorRegions(
	regions []string,
	metricNamespace,
	metricName,
	prefix string,
	timeout int,
	period int,
) (Validator, error)

Jump to

Keyboard shortcuts

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