| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
The AWS::AutoScaling::AutoScalingGroup type creates an Auto Scaling group.
You can add an UpdatePolicy to your auto-scaling group to control how updates are made when a change has been made to either the launch configuration or subnet group membership of the auto scaling group.
Caution
When you update the LoadBalancerNames property, AWS CloudFormation first creates a replacement
auto scaling group resource with a new physical name, changes references from other dependent resources to
point to the replacement resource, and then deletes the old resource.
{
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : [ String, ... ],
"Cooldown" : String,
"DesiredCapacity" : String,
"HealthCheckGracePeriod" : Integer,
"HealthCheckType" : String,
"LaunchConfigurationName" : String,
"LoadBalancerNames : [ String, ... ],
"MaxSize" : String,
"MinSize" : String,
"NotificationConfiguration" : NotificationConfiguration,
"Tags" : [ Auto Scaling Tag, ..., ],
"VPCZoneIdentifier" : [ String, ... ]
}
} Contains a list of availability zones for the group.
Required: Yes.
Type: A list of strings.
The number of seconds after a scaling activity completes before any further scaling activities can start.
Required: No.
Type: String.
Specifies the desired capacity for the auto scaling group.
If SpotPrice is not set in the AWS::AutoScaling::LaunchConfiguration for this auto
scaling group, then Auto Scaling will begin to bring up instances based on
DesiredCapacity. CloudFormation will not mark the auto scaling group as
successful (by setting its status to CREATE_COMPLETE) until the desired capacity is reached.
If SpotPrice is set, then
DesiredCapacity will not be used as a criteria for success, since instances will
only be run when the spot price has been matched. Once the spot price has been matched, however, Auto
Scaling will use DesiredCapacity as the target capacity for bringing up
instances.
Required: No.
Type: String.
The length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
Required: No.
Type: Integer
The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are "EC2" or "ELB."
Required: No.
Type: String.
Specifies the name of the associated AWS::AutoScaling::LaunchConfiguration.
Required: Yes.
Type: String.
Update requires: replacement
A list of load balancers associated with this auto scaling group.
Required: No.
Type: List of Strings
Update requires: replacement
The maximum size of the auto scaling group.
Required: Yes.
Type: String.
The minimum size of the auto scaling group.
Required: Yes.
Type: String.
An embedded property that configures an auto scaling group to send notifications when specified events take place.
Required: No.
The tags you want to attach to this resource.
For more information about tags, go to Tagging Auto Scaling Groups and Amazon EC2 Instances in the Auto Scaling Developer Guide.
Required: Yes.
Type: List of Auto Scaling Tags
Update requires: no interruption
A list of subnet identifiers of Amazon Virtual Private Clouds (Amazon VPCs).
The subnets that you specify for VPCZoneIdentifier must reside in the
availability zones that you specify with the AvailabilityZones parameter.
For more information, go to Using EC2 Dedicated Instances Within Your VPC in the Auto Scaling Developer Guide.
Update requires: replacement
Required: No.
Type: A list of strings.
When the logical ID of this resource is provided to the Ref intrinsic
function, it returns the resource name. For example:
{ "Ref": "MyASGroup" }For an auto scaling group with the logical ID "MyASGroup", Ref will return:
arn:aws:cloudformation:us-east-1:803981987763:stack/mystack-myembeddedstack-sggfrhxhum7w/f449b250-b969-11e0-a185-5081d0136786
For more information about using the Ref function, see Ref.
"WebServerGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : "" },
"LaunchConfigurationName" : { "Ref" : "LaunchConfig" },
"MinSize" : "2",
"MaxSize" : "2",
"LoadBalancerNames" : [ { "Ref" : "ElasticLoadBalancer" } ]
}
}
"ASG1" : {
"UpdatePolicy" : {
"AutoScalingRollingUpdate" : {
"MinInstancesInService" : "1",
"MaxBatchSize" : "1",
"PauseTime" : "PT12M5S"
}
},
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : { "Ref" : "AWS::Region" } },
"LaunchConfigurationName" : { "Ref" : "ASLC" },
"MaxSize" : "3",
"MinSize" : "1"
}
}To view more auto-scaling examples, see Auto Scaling Snippets.
UpdateAutoScalingGroup in the Auto Scaling API Reference