juju: github.com/juju/juju/provider/ec2 Index | Files

package ec2

import "github.com/juju/juju/provider/ec2"


Package Files

config.go credentials.go ebs.go environ.go environ_vpc.go image.go init.go instance.go instancetypes.go provider.go subnet.go userdata.go


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"


var EC2Session = func(region, accessKey, secretKey string) ec2iface.EC2API {
    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)

    ec2Session := ec2.New(sess, config)
    return ec2Session

EC2Session returns a session with the given credentials.

type AmazonRenderer Uses

type AmazonRenderer struct{}

func (AmazonRenderer) Render Uses

func (AmazonRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)

type SecurityGroupCleaner Uses

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

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

type SubnetMatcher Uses

type SubnetMatcher interface {
    Match(ec2.Subnet) bool

func CreateSubnetMatcher Uses

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.

Package ec2 imports 57 packages (graph) and is imported by 44 packages. Updated 2020-09-20. Refresh now. Tools for package owners.