ec2

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EBS_ProviderType = storage.ProviderType("ebs")

	// The volume type (default standard):
	//   "gp2" for General Purpose (SSD) volumes
	//   "io1" for Provisioned IOPS (SSD) volumes,
	//   "standard" for Magnetic volumes.
	EBS_VolumeType = "volume-type"

	// The number of I/O operations per second (IOPS) per GiB
	// to provision for the volume. Only valid for Provisioned
	// IOPS (SSD) volumes.
	EBS_IOPS = "iops"

	// Specifies whether the volume should be encrypted.
	EBS_Encrypted = "encrypted"
)

Variables

View Source
var EC2Session = func(region, accessKey, secretKey string) ec2Client {
	sess := session.Must(session.NewSession())
	config := &aws.Config{
		Retryer: client.DefaultRetryer{
			NumMaxRetries:    10,
			MinRetryDelay:    time.Second,
			MinThrottleDelay: time.Second,
			MaxRetryDelay:    time.Minute,
			MaxThrottleDelay: time.Minute,
		},
		Region: aws.String(region),
		Credentials: credentials.NewStaticCredentialsFromCreds(credentials.Value{
			AccessKeyID:     accessKey,
			SecretAccessKey: secretKey,
		}),
	}

	if logger.IsTraceEnabled() {
		config.Logger = awsLogger{sess}
		config.LogLevel = aws.LogLevel(aws.LogDebug | aws.LogDebugWithRequestErrors | aws.LogDebugWithRequestRetries)
	}

	return ec2.New(sess, config)
}

EC2Session returns a session with the given credentials.

Functions

This section is empty.

Types

type AmazonRenderer

type AmazonRenderer struct{}

func (AmazonRenderer) Render

type AvailabilityZoner

type AvailabilityZoner interface {
	AvailabilityZone() (string, bool)
}

AvailabilityZoner defines a institute interface for getting an az from an instance.

type SecurityGroupCleaner

type SecurityGroupCleaner interface {
	// DeleteSecurityGroup deletes security group on the provider.
	DeleteSecurityGroup(group amzec2.SecurityGroup) (resp *amzec2.SimpleResp, err error)
}

SecurityGroupCleaner defines provider instance methods needed to delete a security group.

type SubnetMatcher

type SubnetMatcher interface {
	Match(ec2.Subnet) bool
}

func CreateSubnetMatcher

func CreateSubnetMatcher(subnetQuery string) SubnetMatcher

CreateSubnetMatcher creates a SubnetMatcher that handles a particular method of comparison based on the content of the subnet query. If the query looks like a CIDR, then we will match subnets with the same CIDR. If it follows the syntax of a "subnet-XXXX" then we will match the Subnet ID. Everything else is just matched as a Name.

Jump to

Keyboard shortcuts

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