cloud

package
Version: v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package cloud wraps AWS API. Used for CSI EBS driver testing.

Index

Constants

View Source
const (
	ResourceTypeELBLoadBalancer  = "elasticloadbalancing:loadbalancer"
	ResourceTypeELBTargetGroup   = "elasticloadbalancing:targetgroup"
	ResourceTypeEC2SecurityGroup = "ec2:security-group"
	ResourceTypeEC2Subnet        = "ec2:subnet"
)

Variables

This section is empty.

Functions

func NewRGTTagFilters

func NewRGTTagFilters(tags map[string]string) []*resourcegroupstaggingapi.TagFilter

func NewRGTTagFiltersV2

func NewRGTTagFiltersV2(tags map[string][]string) []*resourcegroupstaggingapi.TagFilter

func ParseRGTTags

func ParseRGTTags(tags []*resourcegroupstaggingapi.Tag) map[string]string

Types

type ACM

type ACM interface {
	acmiface.ACMAPI

	ListCertificatesAsList(ctx context.Context, input *acm.ListCertificatesInput) ([]*acm.CertificateSummary, error)
}

ACM is an wrapper around original ACMAPI with additional convenient APIs.

func NewACM

func NewACM(session *session.Session) ACM

type AutoScaling

type AutoScaling interface {
	autoscalingiface.AutoScalingAPI
	DescribeAutoScalingGroupsAsList(ctx context.Context, input *autoscaling.DescribeAutoScalingGroupsInput) ([]*autoscaling.Group, error)
	DescribeAutoScalingGroupInstancesAsList(ctx context.Context, input *autoscaling.DescribeAutoScalingGroupsInput) ([]*autoscaling.Instance, error)
	DescribeInServiceAutoScalingGroupInstancesAsList(ctx context.Context, input *autoscaling.DescribeAutoScalingGroupsInput) ([]*autoscaling.Instance, error)
	WaitUntilAutoScalingGroupInService(ctx context.Context, input *autoscaling.DescribeAutoScalingGroupsInput) error
	DescribeAutoScalingInstancesAsList(ctx context.Context, input *autoscaling.DescribeAutoScalingInstancesInput) ([]*autoscaling.InstanceDetails, error)
}

AutoScaling is an wrapper around the original AutoscalingAPI with additional convenient APIs.

func NewAutoScaling

func NewAutoScaling(session *session.Session) AutoScaling

NewAutoScaling creates a new autoscaling session

type Cloud

type Cloud interface {
	ACM() ACM
	AutoScaling() AutoScaling
	ELBV2() ELBV2
	EC2() EC2
	RGT() RGT

	ClusterName() string
	VpcID() string
}

func New

func New(cfg Config) (Cloud, error)

Initialize the global AWS clients.

type Config

type Config struct {
	ClusterName   string
	VpcID         string
	Region        string
	APIMaxRetries int
	APIDebug      bool
}

func (*Config) BindEnv

func (cfg *Config) BindEnv() error

func (*Config) BindFlags

func (cfg *Config) BindFlags(fs *pflag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type EC2

type EC2 interface {
	ec2iface.EC2API

	GetSubnetsByNameOrID(ctx context.Context, nameOrIDs []string) ([]*ec2.Subnet, error)
	DescribeSecurityGroupsAsList(ctx context.Context, input *ec2.DescribeSecurityGroupsInput) ([]*ec2.SecurityGroup, error)
	DescribeInstancesAsList(ctx context.Context, input *ec2.DescribeInstancesInput) ([]*ec2.Instance, error)
	WaitForDesiredNetworkInterfaceCount(input *ec2.DescribeNetworkInterfacesInput, count int) error
	WaitForDesiredNetworkInterfaceCountWithContext(ctx aws.Context, input *ec2.DescribeNetworkInterfacesInput, count int, opts ...request.WaiterOption) error
}

EC2 is an wrapper around original EC2API with additional convenient APIs.

func NewEC2

func NewEC2(session *session.Session) EC2

type EC2Metadata

type EC2Metadata interface {
	VpcID() (string, error)
	Region() (string, error)
}

func NewEC2Metadata

func NewEC2Metadata(session *session.Session) EC2Metadata

type ELBV2

type ELBV2 interface {
	elbv2iface.ELBV2API

	DescribeLoadBalancersAsList(ctx context.Context, input *elbv2.DescribeLoadBalancersInput) ([]*elbv2.LoadBalancer, error)
	DescribeListenersAsList(ctx context.Context, input *elbv2.DescribeListenersInput) ([]*elbv2.Listener, error)
	DescribeListenerCertificatesAsList(ctx context.Context, input *elbv2.DescribeListenerCertificatesInput) ([]*elbv2.Certificate, error)
	DescribeRulesAsList(ctx context.Context, input *elbv2.DescribeRulesInput) ([]*elbv2.Rule, error)
	DescribeTargetGroupsAsList(ctx context.Context, input *elbv2.DescribeTargetGroupsInput) ([]*elbv2.TargetGroup, error)
}

ELBV2 is an wrapper around original ELBV2API with additional convenient APIs.

func NewELBV2

func NewELBV2(session *session.Session) ELBV2

Jump to

Keyboard shortcuts

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