Documentation ¶
Overview ¶
Package cfn provides functionality for creating AWS CloudFormation templates.
Index ¶
- Constants
- func AccountID() interface{}
- func And(v []interface{}) interface{}
- func Base64(v interface{}) interface{}
- func Equals(a, b interface{}) interface{}
- func FindInMap(name, key, subkey interface{}) interface{}
- func Fn(name string, body interface{}) interface{}
- func GetAZs(region interface{}) interface{}
- func GetAtt(name, attribute interface{}) interface{}
- func If(cond, t, f interface{}) interface{}
- func Join(delim interface{}, values ...interface{}) interface{}
- func NoValue() interface{}
- func Not(v interface{}) interface{}
- func NotificationARNs() interface{}
- func Or(v []interface{}) interface{}
- func Ref(resource interface{}) interface{}
- func Region() interface{}
- func Select(index, values interface{}) interface{}
- func StackID() interface{}
- func StackName() interface{}
- type AccessLoggingPolicy
- type Alarm
- type AttributeDefinition
- type AutoScalingGroup
- type AutoScalingRollingUpdate
- type AutoScalingScheduledAction
- type AutoScalingTag
- type BlockDeviceMapping
- type CloudTrail
- type ConnectionDrainingPolicy
- type CreationPolicy
- type DBInstance
- type DBParameterGroup
- type DBSubnetGroup
- type DeletionPolicy
- type DynamoDBTable
- type EBSBlockDevice
- type GlobalSecondaryIndex
- type HealthCheck
- type InstanceProfile
- type InternetGateway
- type KeySchema
- type LaunchConfiguration
- type Listener
- type LoadBalancer
- type LoadBalancerPolicy
- type LoadBalancerPolicyAttribute
- type LocalSecondaryIndex
- type MetricDimension
- type MetricsCollection
- type NotificationConfiguration
- type Output
- type Parameter
- type Projection
- type ProvisionedThroughput
- type Resource
- type ResourceSignal
- type Resources
- type Role
- type Route
- type RouteTable
- type S3Bucket
- type S3BucketPolicy
- type S3LoggingConfiguration
- type ScalingPolicy
- type ScheduledAction
- type SecurityGroup
- type SecurityGroupRule
- type Subnet
- type SubnetRouteTableAssociation
- type Tag
- type Template
- type UpdatePolicy
- type VPC
- type VPCGatewayAttachment
Constants ¶
const ( ChangeInCapacityAdjustment = "ChangeInCapacity" ExactCapacityAdjustment = "ExactCapacity" PercentChangeInCapacityAdjustment = "PercentChangeInCapacity" )
Possible values for ScalingPolicy's AdjustmentType.
const ( KeyTypeHash = "HASH" KeyTypeRange = "RANGE" )
Possible values for KeySchema's KeyType field.
const ( ProjectionTypeKeysOnly = "KEYS_ONLY" ProjectionTypeInclude = "INCLUDE" ProjectionTypeAll = "ALL" )
Possible values for Projection's ProjectionType field.
const Version = "2010-09-09"
Version is the version of the CloudFormation templates supported by this package.
Variables ¶
This section is empty.
Functions ¶
func AccountID ¶
func AccountID() interface{}
AccountID returns the AWS account ID of the account in which the stack is being created.
func Base64 ¶
func Base64(v interface{}) interface{}
Base64 returns the argument, encoded with Base64.
func Equals ¶
func Equals(a, b interface{}) interface{}
Equals returns true if the arguments are equal.
func FindInMap ¶
func FindInMap(name, key, subkey interface{}) interface{}
FindInMap returns the value corresponding to keys in a two-level map that is declared in the Mappings section of a template.
func Fn ¶
func Fn(name string, body interface{}) interface{}
Fn returns a function with the given name and body.
func GetAZs ¶
func GetAZs(region interface{}) interface{}
GetAZs returns an array that lists Availability Zones for a specified region. For the EC2-VPC platform, GetAZs returns only the Availablity Zones that have default subnets. For the EC2-Classic platform, GetAZs returns all Availability Zones for a region.
func GetAtt ¶
func GetAtt(name, attribute interface{}) interface{}
GetAtt returns the value of an attribute from a resource in the template.
func If ¶
func If(cond, t, f interface{}) interface{}
If returns the t argument if the condition is true; otherwise, it returns the f argument.
func Join ¶
func Join(delim interface{}, values ...interface{}) interface{}
Join appends a set of values into a single value, separated by the specified delimiter. If a delimiter is the empty string, the set of values are concatenated with no delimiter.
func NoValue ¶
func NoValue() interface{}
NoValue removes the corresponding resource property when specified as a return value in the If function.
func NotificationARNs ¶
func NotificationARNs() interface{}
NotificationARNs returns the list of notification Amazon Resource Names (ARNs) for the current stack.
func Ref ¶
func Ref(resource interface{}) interface{}
Ref returns a reference to the given resource.
func Region ¶
func Region() interface{}
Region returns a string representing the AWS Region in which the encompassing resource is being created.
func Select ¶
func Select(index, values interface{}) interface{}
Select returns a single object from a list of objects by index.
Types ¶
type AccessLoggingPolicy ¶
type AccessLoggingPolicy struct { LogEveryNMinutes int `json:"EmitInterval,omitempty"` Enabled bool S3BucketName string S3BucketPrefix string }
An AccessLoggingPolicy configures how the load balancer logs requests.
type Alarm ¶
type Alarm struct { ActionsEnabled interface{} `json:",omitempty"` AlarmActions []string `json:",omitempty"` AlarmDescription string `json:",omitempty"` AlarmName string `json:",omitempty"` ComparisonOperator string Dimensions []MetricDimension `json:",omitempty"` EvaluationPeriods string InsufficientDataActions []string `json:",omitempty"` MetricName string Namespace string OKActions []string `json:",omitempty"` Period string Statistic string Threshold string Unit string `json:",omitempty"` }
An Alarm resource creates an CloudWatch alarm.
type AttributeDefinition ¶
An AttributeDefinition defines an attribute of a DynamoDBTable.
type AutoScalingGroup ¶
type AutoScalingGroup struct { AvailabilityZones interface{} Cooldown string `json:",omitempty"` DesiredCapacity int `json:",omitempty"` HealthCheckGracePeriod int `json:",omitempty"` HealthCheckType string `json:",omitempty"` InstanceID string `json:"InstanceId,omitempty"` LaunchConfigurationName interface{} `json:",omitempty"` LoadBalancerNames []string `json:",omitempty"` MaxSize int MetricsCollection []MetricsCollection `json:",omitempty"` MinSize int NotificationConfiguration *NotificationConfiguration `json:",omitempty"` PlacementGroup string `json:",omitempty"` Tags []AutoScalingTag `json:",omitempty"` TerminationPolicies []string `json:",omitempty"` VPCZoneIdentifier []string `json:",omitempty"` }
An AutoScalingGroup resource creates an Auto Scaling group.
type AutoScalingRollingUpdate ¶
type AutoScalingRollingUpdate struct { MaxBatchSize string `json:",omitempty"` MinInstancesInService string `json:",omitempty"` PauseTime string `json:",omitempty"` SuspendProcesses []interface{} `json:",omitempty"` WaitOnResourceSignals bool `json:",omitempty"` }
An AutoScalingRollingUpdate policy specifies how AWS CloudFormation handles rolling updates for a particular resource.
type AutoScalingScheduledAction ¶
type AutoScalingScheduledAction struct {
IgnoreUnmodifiedGroupSizeProperties bool `json:",omitempty"`
}
An AutoScalingScheduledAction policy describes how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties if an autoscaling group has an associated scheduled action.
type AutoScalingTag ¶
An AutoScalingTag is like a regular tag, but can propagate to ASG instances when they launch.
type BlockDeviceMapping ¶
type BlockDeviceMapping struct { DeviceName string EBS *EBSBlockDevice `json:"Ebs,omitempty"` NoDevice bool `json:",omitempty"` VirtualName string `json:",omitempty"` }
The BlockDeviceMapping type is an embedded property of the LaunchConfiguration type.
type CloudTrail ¶
type CloudTrail struct { IncludeGlobalServiceEvents bool `json:",omitempty"` IsLogging bool S3BucketName interface{} S3KeyPrefix interface{} `json:",omitempty"` SNSTopicName interface{} `json:"SnsTopicName,omitempty"` }
The CloudTrail resource creates a trail and specifies where logs are published. A CloudTrail trail can capture AWS API calls made by your AWS account and publishes the logs to an Amazon S3 bucket.
type ConnectionDrainingPolicy ¶
A ConnectionDrainingPolicy configures how long the load balancer will wait before removing an instance from rotation.
type CreationPolicy ¶
type CreationPolicy struct {
ResouceSignal *ResourceSignal `json:",omitempty"`
}
A CreationPolicy is associated with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded.
type DBInstance ¶
type DBInstance struct { AllocatedStorage int AllowMajorVersionUpgrade bool `json:",omitempty"` AutoMinorVersionUpgrade bool `json:",omitempty"` AvailabilityZone string `json:",omitempty"` BackupRetentionPeriod int `json:",omitempty"` DBInstanceClass string DBInstanceIdentifier string `json:",omitempty"` DBName string `json:",omitempty"` DBParameterGroupName interface{} `json:",omitempty"` DBSecurityGroups []string `json:",omitempty"` DBSnapshotIdentifier string `json:",omitempty"` DBSubnetGroupName interface{} `json:",omitempty"` Engine string `json:",omitempty"` EngineVersion string `json:",omitempty"` Iops int `json:",omitempty"` LicenseModel string `json:",omitempty"` MasterUsername string `json:",omitempty"` MasterUserPassword string `json:",omitempty"` MultiAZ bool `json:",omitempty"` Port int `json:",omitempty"` PreferredBackupWindow string `json:",omitempty"` PreferredMaintenanceWindow string `json:",omitempty"` PubliclyAccessible bool `json:",omitempty"` SourceDBInstanceIdentifier string `json:",omitempty"` Tags []Tag `json:",omitempty"` VPCSecurityGroups []interface{} `json:",omitempty"` }
A DBInstance is a RDS instance.
type DBParameterGroup ¶
type DBParameterGroup struct { Description string Family string Parameters map[string]string `json:",omitempty"` Tags []Tag `json:",omitempty"` }
A DBParameterGroup is group of configuration parameters used for a set of DB instances.
type DBSubnetGroup ¶
type DBSubnetGroup struct { DBSubnetGroupDescription string SubnetIDs []string `json:"SubnetIds"` Tags []Tag `json:",omitempty"` }
A DBSubnetGroup places an RDS instance in a set of VPC subnets.
type DeletionPolicy ¶
type DeletionPolicy string
A DeletionPolicy dictates what is to be done with a resource when it is deleted.
const ( // Delete is the default deletion policy, and will simply delete the // resource in question. Delete DeletionPolicy = "Delete" // Retain will not delete the resource in question. Retain DeletionPolicy = "Retain" // Snapshot will create a snapshot of the resource and then delete it. (Not // available for all resource types.) Snapshot DeletionPolicy = "Snapshot" )
type DynamoDBTable ¶
type DynamoDBTable struct { AttributeDefinitions []AttributeDefinition GlobalSecondaryIndexes []GlobalSecondaryIndex `json:",omitempty"` KeySchema []KeySchema LocalSecondaryIndexes []LocalSecondaryIndex `json:",omitempty"` ProvisionedThroughput ProvisionedThroughput TableName string `json:",omitempty"` }
A DynamoDBTable creates a DynamoDB table.
type EBSBlockDevice ¶
type EBSBlockDevice struct { DeleteOnTermination bool `json:",omitempty"` IOPS int `json:",omitempty"` SnapshotID string `json:"SnapshotId,omitempty"` VolumeSize int `json:",omitempty"` VolumeType string `json:",omitempty"` }
The EBSBlockDevice type is an embedded property of the AutoScaling Block Device Mapping type.
type GlobalSecondaryIndex ¶
type GlobalSecondaryIndex struct { IndexName string KeySchema []KeySchema Projection Projection ProvisionedThroughput ProvisionedThroughput }
A GlobalSecondaryIndex describes a global secondary index for the DynamoDBTable resource.
type HealthCheck ¶
type HealthCheck struct { HealthyThreshold interface{} `json:",omitempty"` Interval interface{} `json:",omitempty"` Target interface{} `json:",omitempty"` Timeout interface{} `json:",omitempty"` UnhealthyThreshold interface{} `json:",omitempty"` }
A HealthCheck determines if an instance registered with a load balancer is healthy.
type InstanceProfile ¶
type InstanceProfile struct { Path string Roles []interface{} }
An InstanceProfile is an IAM instance profile.
type InternetGateway ¶
type InternetGateway struct {
Tags []Tag `json:",omitempty"`
}
An InternetGateway is a VPC internet gateway.
type KeySchema ¶
KeySchema describes a primary key for the DynamoDBTable resource or a key schema for an index.
type LaunchConfiguration ¶
type LaunchConfiguration struct { AssociatePublicIPAddress bool `json:"AssociatePublicIpAddress,omitempty"` BlockDeviceMappings []BlockDeviceMapping `json:",omitempty"` EBSOptimized bool `json:"EbsOptimized,omitempty"` IAMInstanceProfile string `json:"IamInstanceProfile,omitempty"` ImageID string `json:"ImageId"` InstanceID string `json:"InstanceId,omitempty"` InstanceMonitoring *bool `json:",omitempty"` InstanceType string KernelID string `json:"KernelId,omitempty"` KeyName string `json:",omitempty"` RAMDiskID string `json:"RamDiskId,omitempty"` SecurityGroups interface{} `json:",omitempty"` SpotPrice string `json:",omitempty"` UserData []byte `json:",omitempty"` }
The LaunchConfiguration resource creates an Auto Scaling launch configuration that can be used by an Auto Scaling group to configure Amazon EC2 instances in the Auto Scaling group.
type Listener ¶
type Listener struct { InstancePort interface{} `json:",omitempty"` LoadBalancerPort interface{} `json:",omitempty"` Protocol interface{} `json:",omitempty"` InstanceProtocol interface{} `json:",omitempty"` SSLCertificateID interface{} `json:",omitempty"` PolicyNames []interface{} `json:",omitempty"` }
A Listener accepts connections for a load balancer and routes them to an instance port.
type LoadBalancer ¶
type LoadBalancer struct { Name string `json:"LoadBalancerName"` AvailabilityZones []string `json:",omitempty"` CrossZone bool Scheme string `json:",omitempty"` Subnets []string `json:",omitempty"` SecurityGroups []interface{} `json:",omitempty"` AccessLoggingPolicy *AccessLoggingPolicy `json:",omitempty"` ConnectionDrainingPolicy *ConnectionDrainingPolicy `json:",omitempty"` HealthCheck *HealthCheck `json:",omitempty"` Listeners []Listener `json:",omitempty"` Policies []LoadBalancerPolicy `json:",omitempty"` Tags []Tag `json:",omitempty"` }
A LoadBalancer is an EC2 Elastic LoadBalancer (ELB).
type LoadBalancerPolicy ¶
type LoadBalancerPolicy struct { Name string `json:"PolicyName"` Type string `json:"PolicyType"` Attributes []LoadBalancerPolicyAttribute `json:",omitempty"` InstancePorts []int `json:",omitempty"` LoadBalancerPorts []int `json:",omitempty"` }
A LoadBalancerPolicy configures some other arbitrary bits of load balancer behavior, like proxy protocol support and TLS config.
type LoadBalancerPolicyAttribute ¶
A LoadBalancerPolicyAttribute is an attribute of a LoadBalancerPolicy.
type LocalSecondaryIndex ¶
type LocalSecondaryIndex struct { IndexName string KeySchema []KeySchema Projection Projection }
LocalSecondaryIndex describes local secondary indexes for the DynamoDBTable resource. Each index is scoped to a given hash key value. Tables with one or more local secondary indexes are subject to an item collection size limit, where the amount of data within a given item collection cannot exceed 10 GB.
type MetricDimension ¶
type MetricDimension struct { Name string Value interface{} }
The MetricDimension is an embedded property of the AWS::CloudWatch::Alarm type. Dimensions are arbitrary name/value pairs that can be associated with a CloudWatch metric.
type MetricsCollection ¶
The MetricsCollection is a property of the AutoScalingGroup resource that describes the group metrics that an Auto Scaling group sends to CloudWatch.
type NotificationConfiguration ¶
The NotificationConfiguration property is an embedded property of the AWS::AutoScaling::AutoScalingGroup resource that specifies the events for which the Auto Scaling group sends notifications.
type Output ¶
type Output struct { Value interface{} Description string `json:",omitempty"` }
An Output is a value based on the resources in a stack.
type Parameter ¶
type Parameter struct { Type string Default string `json:",omitempty"` NoEcho bool `json:",omitempty"` AllowedValues []interface{} `json:",omitempty"` AllowedPattern string `json:",omitempty"` MaxLength int `json:",omitempty"` MinLength int `json:",omitempty"` MaxValue interface{} `json:",omitempty"` MinValue interface{} `json:",omitempty"` Description string `json:",omitempty"` }
A Parameter is a value which can be passed into a template.
type Projection ¶
A Projection defines attributes that are copied (projected) from the source table into the index. These attributes are additions to the primary key attributes and index key attributes, which are automatically projected.
type ProvisionedThroughput ¶
ProvisionedThroughput describes a set of provisioned throughput values for a DynamoDBTable resource.
type Resource ¶
type Resource struct { Type string CreationPolicy *CreationPolicy `json:",omitempty"` DeletionPolicy DeletionPolicy `json:",omitempty"` DependsOn []interface{} `json:",omitempty"` Metadata interface{} `json:",omitempty"` Properties interface{} UpdatePolicy *UpdatePolicy `json:",omitempty"` }
A Resource is an AWS resource.
type ResourceSignal ¶
A ResourceSignal determines how many signals are required by a CreationPolicy.
type Role ¶
type Role struct { AssumeRolePolicyDocument interface{} Path string Policies interface{} `json:",omitempty"` }
A Role is an IAM role.
type Route ¶
type Route struct { DestinationCIDRBlock string `json:"DestinationCidrBlock"` GatewayID interface{} `json:"GatewayId,omitempty"` InstanceID interface{} `json:"InstanceId,omitempty"` NetworkInterfaceID interface{} `json:"NetworkInterfaceId,omitempty"` RouteTableID interface{} `json:"RouteTableId,omitempty"` VPCPeeringConnectionID interface{} `json:"VpcPeeringConnectionId,omitempty"` }
A Route is an entry in a route table.
type RouteTable ¶
type RouteTable struct { VPCID interface{} `json:"VpcId,omitempty"` Tags []Tag `json:"Tags,omitempty"` }
A RouteTable is a table of routes.
type S3Bucket ¶
type S3Bucket struct { AccessControl string BucketName interface{} LoggingConfiguration *S3LoggingConfiguration `json:",omitempty"` Tags []Tag `json:",omitempty"` }
An S3Bucket is a collection of blobs on S3.
type S3BucketPolicy ¶
type S3BucketPolicy struct { Bucket interface{} PolicyDocument map[string]interface{} }
An S3BucketPolicy is a policy for an S3 bucket.
type S3LoggingConfiguration ¶
type S3LoggingConfiguration struct { DestinationBucketName interface{} LogFilePrefix string `json:",omitempty"` }
An S3LoggingConfiguration configures logging for S3 buckets.
type ScalingPolicy ¶
type ScalingPolicy struct { AdjustmentType string AutoScalingGroupName interface{} Cooldown string `json:",omitempty"` ScalingAdjustment string }
A ScalingPolicy specifies whether to scale the auto scaling group up or down, and by how much.
type ScheduledAction ¶
type ScheduledAction struct { AutoScalingGroupName interface{} DesiredCapacity int `json:",omitempty"` EndTime time.Time `json:",omitempty"` MaxSize int `json:",omitempty"` MinSize int `json:",omitempty"` Recurrence time.Time `json:",omitempty"` StartTime time.Time `json:",omitempty"` }
ScheduledAction creates a scheduled scaling action for an Auto Scaling group, changing the number of servers available for your application in response to predictable load changes.
type SecurityGroup ¶
type SecurityGroup struct { GroupDescription interface{} SecurityGroupEgress []SecurityGroupRule `json:",omitempty"` SecurityGroupIngress []SecurityGroupRule `json:",omitempty"` Tags []Tag `json:",omitempty"` VPCID interface{} `json:"VpcId"` }
A SecurityGroup determines which instances can communicate with each other.
type SecurityGroupRule ¶
type SecurityGroupRule struct { CIDRIP interface{} `json:"CidrIp,omitempty"` DestinationSecurityGroupID interface{} `json:"DestinationSecurityGroupId,omitempty"` FromPort int IPProtocol interface{} `json:"IpProtocol"` SourceSecurityGroupID interface{} `json:"SourceSecurityGroupId,omitempty"` SourceSecurityGroupName string `json:",omitempty"` SourceSecurityGroupOwnerID interface{} `json:"SourceSecurityGroupOwnerId,omitempty"` ToPort int }
A SecurityGroupRule is a rule in a security group.
type Subnet ¶
type Subnet struct { AvailabilityZone string `json:"AvailabilityZone,omitempty"` CIDRBlock string `json:"CidrBlock,omitempty"` Tags []Tag `json:"Tags,omitempty"` VPCID interface{} `json:"VpcId,omitempty"` }
A Subnet is an IP subnet in a VPC.
type SubnetRouteTableAssociation ¶
type SubnetRouteTableAssociation struct { RouteTableID interface{} `json:"RouteTableId,omitempty"` SubnetID interface{} `json:"SubnetId,omitempty"` }
A SubnetRouteTableAssociation associates a route table with a subnet.
type Template ¶
type Template struct { AWSTemplateFormatVersion string `json:",omitempty"` Description string `json:",omitempty"` Parameters map[string]Parameter `json:",omitempty"` Mappings map[string]interface{} `json:",omitempty"` Conditions map[string]interface{} `json:",omitempty"` Resources Resources `json:",omitempty"` Outputs map[string]Output `json:",omitempty"` }
A Template describes a set of AWS resources which belong to a stack.
func NewTemplate ¶
NewTemplate returns a new, blank template with the given description.
type UpdatePolicy ¶
type UpdatePolicy struct { AutoScalingRollingUpdate *AutoScalingRollingUpdate `json:",omitempty"` AutoScalingScheduledAction *AutoScalingScheduledAction `json:",omitempty"` }
An UpdatePolicy dictates how a resource should be updated.
type VPC ¶
type VPC struct { CIDRBlock string `json:"CidrBlock"` EnableDNSSupport bool `json:"EnableDnsSupport,omitempty"` EnableDNSHostnames bool `json:"EnableDnsHostnames,omitempty"` InstanceTenancy string `json:"InstanceTenancy,omitempty"` Tags []Tag `json:"Tags,omitempty"` }
A VPC is a virtual private cloud.
type VPCGatewayAttachment ¶
type VPCGatewayAttachment struct { InternetGatewayID interface{} `json:"InternetGatewayId,omitempty"` VPCID interface{} `json:"VpcId,omitempty"` VPNGatewayID string `json:"VpnGatewayId,omitempty"` }
A VPCGatewayAttachment attaches an internet gateway to a VPC.