| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
The UpdatePolicy attribute enables you to specify how AWS CloudFormation handles updates for a particular resource.
Note
Currently, the only AWS CloudFormation resource that supports update policies is AWS::AutoScaling::AutoScalingGroup. For auto scaling groups, the update policy is invoked by a change in the launch configuration or in the subnet group membership of the auto scaling group.
"UpdatePolicy" : {
"UpdatePolicyName" : {
"MaxBatchSize" : String,
"MinInstancesInService" : String,
"PauseTime" : String
}
} The maximum number of instances that are terminated at a given time.
Type: String.
Required: No. The default value is one ("1").
The minimum number of instances that must be in service within the auto-scaling group while obsolete instances are being terminated.
Type: String.
Required: No. The default value is zero ("0").
The amount of time to pause before changes are made to a resource, for example, before adding or removing auto-scaling instances when scaling up or terminating instances in an auto-scaling group.
The value must be in ISO8601 duration
format, in the form:
"PT#H#M#S",
where each # is the number of hours, minutes, and/or
seconds, respectively. The maximum amount of time that can be specified for the
pause time is one hour ("PT1H").
Type: String.
Required: No. The default value is zero seconds ("PT0S").
The following example shows how to add an update policy to an auto-scaling group.
"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"
}
}