aws

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: MPL-2.0 Imports: 100 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSAMIRetryTimeout    = 10 * time.Minute
	AWSAMIRetryDelay      = 5 * time.Second
	AWSAMIRetryMinTimeout = 3 * time.Second
)
View Source
const DYNAMODB_LIMIT_EXCEEDED_SLEEP = 10 * time.Second

How long to sleep if a limit-exceeded event happens

View Source
const DYNAMODB_MAX_THROTTLE_RETRIES = 5

Number of times to retry if a throttling-related exception occurs

View Source
const DYNAMODB_THROTTLE_SLEEP = 5 * time.Second

How long to sleep when a throttle-event happens

Variables

View Source
var AttributeMap = map[string]string{
	"delay_seconds":               "DelaySeconds",
	"max_message_size":            "MaximumMessageSize",
	"message_retention_seconds":   "MessageRetentionPeriod",
	"receive_wait_time_seconds":   "ReceiveMessageWaitTimeSeconds",
	"visibility_timeout_seconds":  "VisibilityTimeout",
	"policy":                      "Policy",
	"redrive_policy":              "RedrivePolicy",
	"arn":                         "QueueArn",
	"fifo_queue":                  "FifoQueue",
	"content_based_deduplication": "ContentBasedDeduplication",
}
View Source
var LambdaFunctionRegexp = `^(arn:[\w-]+:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
View Source
var SNSAttributeMap = map[string]string{
	"arn":             "TopicArn",
	"display_name":    "DisplayName",
	"policy":          "Policy",
	"delivery_policy": "DeliveryPolicy",
}

Mutable attributes

View Source
var SNSSubscriptionAttributeMap = map[string]string{
	"topic_arn":            "TopicArn",
	"endpoint":             "Endpoint",
	"protocol":             "Protocol",
	"raw_message_delivery": "RawMessageDelivery",
}

Functions

func AMIStateRefreshFunc added in v0.9.1

func AMIStateRefreshFunc(client *ec2.EC2, id string) resource.StateRefreshFunc

func EIGWStateRefreshFunc added in v0.8.8

func EIGWStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

func FQDN added in v0.4.0

func FQDN(name string) string

func GetAccountInfo added in v0.7.6

func GetAccountInfo(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, string, error)

func GetCredentials added in v0.6.16

func GetCredentials(c *Config) (*awsCredentials.Credentials, error)

This function is responsible for reading credentials from the environment in the case that they're not explicitly specified in the Terraform configuration.

func GetSupportedEC2Platforms added in v0.9.1

func GetSupportedEC2Platforms(conn *ec2.EC2) ([]string, error)

func HostedZoneIDForRegion added in v0.5.1

func HostedZoneIDForRegion(region string) string

Returns the hosted zone ID for an S3 website endpoint region. This can be used as input to the aws_route53_record resource's zone_id argument.

func IGAttachStateRefreshFunc

func IGAttachStateRefreshFunc(conn *ec2.EC2, id string, expected string) resource.StateRefreshFunc

IGAttachStateRefreshFunc returns a resource.StateRefreshFunc that is used watch the state of an internet gateway's attachment.

func IGStateRefreshFunc

func IGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

IGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an internet gateway.

func InstanceStateRefreshFunc

func InstanceStateRefreshFunc(conn *ec2.EC2, instanceID string) resource.StateRefreshFunc

InstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an EC2 instance.

func NGStateRefreshFunc added in v0.6.9

func NGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

NGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a NAT Gateway.

func OpsworksInstanceStateRefreshFunc added in v0.6.15

func OpsworksInstanceStateRefreshFunc(conn *opsworks.OpsWorks, instanceID string) resource.StateRefreshFunc

func Provider added in v0.2.0

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

func SGStateRefreshFunc

func SGStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

SGStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a security group.

func SpotInstanceStateRefreshFunc added in v0.6.0

func SpotInstanceStateRefreshFunc(
	conn *ec2.EC2, sir ec2.SpotInstanceRequest) resource.StateRefreshFunc

SpotInstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an EC2 spot instance request

func SubnetStateRefreshFunc

func SubnetStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

SubnetStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a Subnet.

func VPCStateRefreshFunc

func VPCStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc

VPCStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch a VPC.

func WebsiteDomainUrl added in v0.6.2

func WebsiteDomainUrl(region string) string

Types

type AWSClient added in v0.3.5

type AWSClient struct {
	// contains filtered or unexported fields
}

type ByGroupPair added in v0.6.0

type ByGroupPair []*ec2.UserIdGroupPair

ByGroupPair implements sort.Interface for []*ec2.UserIDGroupPairs based on GroupID or GroupName field (only one should be set).

func (ByGroupPair) Len added in v0.6.0

func (b ByGroupPair) Len() int

func (ByGroupPair) Less added in v0.6.0

func (b ByGroupPair) Less(i, j int) bool

func (ByGroupPair) Swap added in v0.6.0

func (b ByGroupPair) Swap(i, j int)

type Config

type Config struct {
	AccessKey     string
	SecretKey     string
	CredsFilename string
	Profile       string
	Token         string
	Region        string
	MaxRetries    int

	AssumeRoleARN         string
	AssumeRoleExternalID  string
	AssumeRoleSessionName string
	AssumeRolePolicy      string

	AllowedAccountIds   []interface{}
	ForbiddenAccountIds []interface{}

	DynamoDBEndpoint string
	KinesisEndpoint  string
	Ec2Endpoint      string
	IamEndpoint      string
	ElbEndpoint      string
	S3Endpoint       string
	Insecure         bool

	SkipCredsValidation     bool
	SkipRegionValidation    bool
	SkipRequestingAccountId bool
	SkipMetadataApiCheck    bool
	S3ForcePathStyle        bool
}

func (*Config) Client added in v0.3.5

func (c *Config) Client() (interface{}, error)

Client configures and returns a fully initialized AWSClient

func (*Config) ValidateAccountId added in v0.5.0

func (c *Config) ValidateAccountId(accountId string) error

ValidateAccountId returns a context-specific error if the configured account id is explicitly forbidden or not authorised; and nil if it is authorised.

func (*Config) ValidateCredentials added in v0.6.2

func (c *Config) ValidateCredentials(stsconn *sts.STS) error

Validate credentials early and fail before we do any graph walking.

func (*Config) ValidateRegion added in v0.4.0

func (c *Config) ValidateRegion() error

ValidateRegion returns an error if the configured region is not a valid aws region and nil otherwise.

type IAMPolicyDoc added in v0.7.0

type IAMPolicyDoc struct {
	Version    string                `json:",omitempty"`
	Id         string                `json:",omitempty"`
	Statements []*IAMPolicyStatement `json:"Statement"`
}

type IAMPolicyStatement added in v0.7.0

type IAMPolicyStatement struct {
	Sid           string
	Effect        string                         `json:",omitempty"`
	Actions       interface{}                    `json:"Action,omitempty"`
	NotActions    interface{}                    `json:"NotAction,omitempty"`
	Resources     interface{}                    `json:"Resource,omitempty"`
	NotResources  interface{}                    `json:"NotResource,omitempty"`
	Principals    IAMPolicyStatementPrincipalSet `json:"Principal,omitempty"`
	NotPrincipals IAMPolicyStatementPrincipalSet `json:"NotPrincipal,omitempty"`
	Conditions    IAMPolicyStatementConditionSet `json:"Condition,omitempty"`
}

type IAMPolicyStatementCondition added in v0.7.0

type IAMPolicyStatementCondition struct {
	Test     string
	Variable string
	Values   interface{}
}

type IAMPolicyStatementConditionSet added in v0.7.0

type IAMPolicyStatementConditionSet []IAMPolicyStatementCondition

func (IAMPolicyStatementConditionSet) MarshalJSON added in v0.7.0

func (cs IAMPolicyStatementConditionSet) MarshalJSON() ([]byte, error)

type IAMPolicyStatementPrincipal added in v0.7.0

type IAMPolicyStatementPrincipal struct {
	Type        string
	Identifiers interface{}
}

type IAMPolicyStatementPrincipalSet added in v0.7.0

type IAMPolicyStatementPrincipalSet []IAMPolicyStatementPrincipal

func (IAMPolicyStatementPrincipalSet) MarshalJSON added in v0.7.0

func (ps IAMPolicyStatementPrincipalSet) MarshalJSON() ([]byte, error)

type LambdaPolicy added in v0.6.12

type LambdaPolicy struct {
	Version   string
	Statement []LambdaPolicyStatement
	Id        string
}

type LambdaPolicyStatement added in v0.6.12

type LambdaPolicyStatement struct {
	Condition map[string]map[string]string
	Action    string
	Resource  string
	Effect    string
	Principal map[string]string
	Sid       string
}

type Reassignment added in v0.7.1

type Reassignment struct {
	// contains filtered or unexported fields
}

type S3Website added in v0.6.2

type S3Website struct {
	Endpoint, Domain string
}

func WebsiteEndpoint added in v0.6.2

func WebsiteEndpoint(bucket string, region string) *S3Website

type StringPtrSlice added in v0.7.0

type StringPtrSlice []*string

Define Sort interface for []*string so we can ensure the order of geo_restrictions.locations

func (StringPtrSlice) Len added in v0.7.0

func (p StringPtrSlice) Len() int

func (StringPtrSlice) Less added in v0.7.0

func (p StringPtrSlice) Less(i, j int) bool

func (StringPtrSlice) Swap added in v0.7.0

func (p StringPtrSlice) Swap(i, j int)

type TunnelInfo added in v0.6.12

type TunnelInfo struct {
	Tunnel1Address      string
	Tunnel1PreSharedKey string
	Tunnel2Address      string
	Tunnel2PreSharedKey string
}

type XmlIpsecTunnel added in v0.6.12

type XmlIpsecTunnel struct {
	OutsideAddress string `xml:"vpn_gateway>tunnel_outside_address>ip_address"`
	PreSharedKey   string `xml:"ike>pre_shared_key"`
}

type XmlVpnConnectionConfig added in v0.6.12

type XmlVpnConnectionConfig struct {
	Tunnels []XmlIpsecTunnel `xml:"ipsec_tunnel"`
}

func (XmlVpnConnectionConfig) Len added in v0.6.12

func (slice XmlVpnConnectionConfig) Len() int

func (XmlVpnConnectionConfig) Less added in v0.6.12

func (slice XmlVpnConnectionConfig) Less(i, j int) bool

func (XmlVpnConnectionConfig) Swap added in v0.6.12

func (slice XmlVpnConnectionConfig) Swap(i, j int)

Source Files

Jump to

Keyboard shortcuts

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