

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# Amazon EC2 Auto Scaling
<a name="AWS_AutoScaling"></a>

Amazon EC2 Auto Scaling supports creating Auto Scaling groups and related resources in AWS CloudFormation. This section details the supported resources and also includes examples of templates for each resource type.

You can find additional useful examples that create Auto Scaling groups and related resources in the following sections of the *AWS CloudFormation User Guide*.
+ For additional examples of Auto Scaling groups, see [Auto scaling template snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html).
+ For examples of Amazon EC2 launch templates, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-ec2-launchtemplate.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-ec2-launchtemplate.html). 

**Resource types**
+ [AWS::AutoScaling::AutoScalingGroup](aws-resource-autoscaling-autoscalinggroup.md)
+ [AWS::AutoScaling::LaunchConfiguration](aws-resource-autoscaling-launchconfiguration.md)
+ [AWS::AutoScaling::LifecycleHook](aws-resource-autoscaling-lifecyclehook.md)
+ [AWS::AutoScaling::ScalingPolicy](aws-resource-autoscaling-scalingpolicy.md)
+ [AWS::AutoScaling::ScheduledAction](aws-resource-autoscaling-scheduledaction.md)
+ [AWS::AutoScaling::WarmPool](aws-resource-autoscaling-warmpool.md)

# AWS::AutoScaling::AutoScalingGroup
<a name="aws-resource-autoscaling-autoscalinggroup"></a>

The `AWS::AutoScaling::AutoScalingGroup` resource defines an Amazon EC2 Auto Scaling group, which is a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management. 

For more information about Amazon EC2 Auto Scaling, see the [Amazon EC2 Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html). 

**Note**  
Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a [launch template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) or a launch configuration. We strongly recommend that you do not use launch configurations. For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html) in the *Amazon EC2 Auto Scaling User Guide*.  
For help migrating from launch configurations to launch templates, see [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-resource-autoscaling-autoscalinggroup-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-autoscalinggroup-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::AutoScalingGroup",
  "Properties" : {
      "[AutoScalingGroupName](#cfn-autoscaling-autoscalinggroup-autoscalinggroupname)" : String,
      "[AvailabilityZoneDistribution](#cfn-autoscaling-autoscalinggroup-availabilityzonedistribution)" : AvailabilityZoneDistribution,
      "[AvailabilityZoneIds](#cfn-autoscaling-autoscalinggroup-availabilityzoneids)" : [ String, ... ],
      "[AvailabilityZoneImpairmentPolicy](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy)" : AvailabilityZoneImpairmentPolicy,
      "[AvailabilityZones](#cfn-autoscaling-autoscalinggroup-availabilityzones)" : [ String, ... ],
      "[CapacityRebalance](#cfn-autoscaling-autoscalinggroup-capacityrebalance)" : Boolean,
      "[CapacityReservationSpecification](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification)" : CapacityReservationSpecification,
      "[Context](#cfn-autoscaling-autoscalinggroup-context)" : String,
      "[Cooldown](#cfn-autoscaling-autoscalinggroup-cooldown)" : String,
      "[DefaultInstanceWarmup](#cfn-autoscaling-autoscalinggroup-defaultinstancewarmup)" : Integer,
      "[DeletionProtection](#cfn-autoscaling-autoscalinggroup-deletionprotection)" : String,
      "[DesiredCapacity](#cfn-autoscaling-autoscalinggroup-desiredcapacity)" : String,
      "[DesiredCapacityType](#cfn-autoscaling-autoscalinggroup-desiredcapacitytype)" : String,
      "[HealthCheckGracePeriod](#cfn-autoscaling-autoscalinggroup-healthcheckgraceperiod)" : Integer,
      "[HealthCheckType](#cfn-autoscaling-autoscalinggroup-healthchecktype)" : String,
      "[InstanceId](#cfn-autoscaling-autoscalinggroup-instanceid)" : String,
      "[InstanceLifecyclePolicy](#cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy)" : InstanceLifecyclePolicy,
      "[InstanceMaintenancePolicy](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy)" : InstanceMaintenancePolicy,
      "[LaunchConfigurationName](#cfn-autoscaling-autoscalinggroup-launchconfigurationname)" : String,
      "[LaunchTemplate](#cfn-autoscaling-autoscalinggroup-launchtemplate)" : LaunchTemplateSpecification,
      "[LifecycleHookSpecificationList](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecificationlist)" : [ LifecycleHookSpecification, ... ],
      "[LoadBalancerNames](#cfn-autoscaling-autoscalinggroup-loadbalancernames)" : [ String, ... ],
      "[MaxInstanceLifetime](#cfn-autoscaling-autoscalinggroup-maxinstancelifetime)" : Integer,
      "[MaxSize](#cfn-autoscaling-autoscalinggroup-maxsize)" : String,
      "[MetricsCollection](#cfn-autoscaling-autoscalinggroup-metricscollection)" : [ MetricsCollection, ... ],
      "[MinSize](#cfn-autoscaling-autoscalinggroup-minsize)" : String,
      "[MixedInstancesPolicy](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy)" : MixedInstancesPolicy,
      "[NewInstancesProtectedFromScaleIn](#cfn-autoscaling-autoscalinggroup-newinstancesprotectedfromscalein)" : Boolean,
      "[NotificationConfigurations](#cfn-autoscaling-autoscalinggroup-notificationconfigurations)" : [ NotificationConfiguration, ... ],
      "[PlacementGroup](#cfn-autoscaling-autoscalinggroup-placementgroup)" : String,
      "[ServiceLinkedRoleARN](#cfn-autoscaling-autoscalinggroup-servicelinkedrolearn)" : String,
      "[SkipZonalShiftValidation](#cfn-autoscaling-autoscalinggroup-skipzonalshiftvalidation)" : Boolean,
      "[Tags](#cfn-autoscaling-autoscalinggroup-tags)" : [ TagProperty, ... ],
      "[TargetGroupARNs](#cfn-autoscaling-autoscalinggroup-targetgrouparns)" : [ String, ... ],
      "[TerminationPolicies](#cfn-autoscaling-autoscalinggroup-terminationpolicies)" : [ String, ... ],
      "[TrafficSources](#cfn-autoscaling-autoscalinggroup-trafficsources)" : [ TrafficSourceIdentifier, ... ],
      "[VPCZoneIdentifier](#cfn-autoscaling-autoscalinggroup-vpczoneidentifier)" : [ String, ... ]
    }
}
```

### YAML
<a name="aws-resource-autoscaling-autoscalinggroup-syntax.yaml"></a>

```
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
  [AutoScalingGroupName](#cfn-autoscaling-autoscalinggroup-autoscalinggroupname): String
  [AvailabilityZoneDistribution](#cfn-autoscaling-autoscalinggroup-availabilityzonedistribution): 
    AvailabilityZoneDistribution
  [AvailabilityZoneIds](#cfn-autoscaling-autoscalinggroup-availabilityzoneids): 
    - String
  [AvailabilityZoneImpairmentPolicy](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy): 
    AvailabilityZoneImpairmentPolicy
  [AvailabilityZones](#cfn-autoscaling-autoscalinggroup-availabilityzones): 
    - String
  [CapacityRebalance](#cfn-autoscaling-autoscalinggroup-capacityrebalance): Boolean
  [CapacityReservationSpecification](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification): 
    CapacityReservationSpecification
  [Context](#cfn-autoscaling-autoscalinggroup-context): String
  [Cooldown](#cfn-autoscaling-autoscalinggroup-cooldown): String
  [DefaultInstanceWarmup](#cfn-autoscaling-autoscalinggroup-defaultinstancewarmup): Integer
  [DeletionProtection](#cfn-autoscaling-autoscalinggroup-deletionprotection): String
  [DesiredCapacity](#cfn-autoscaling-autoscalinggroup-desiredcapacity): String
  [DesiredCapacityType](#cfn-autoscaling-autoscalinggroup-desiredcapacitytype): String
  [HealthCheckGracePeriod](#cfn-autoscaling-autoscalinggroup-healthcheckgraceperiod): Integer
  [HealthCheckType](#cfn-autoscaling-autoscalinggroup-healthchecktype): String
  [InstanceId](#cfn-autoscaling-autoscalinggroup-instanceid): String
  [InstanceLifecyclePolicy](#cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy): 
    InstanceLifecyclePolicy
  [InstanceMaintenancePolicy](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy): 
    InstanceMaintenancePolicy
  [LaunchConfigurationName](#cfn-autoscaling-autoscalinggroup-launchconfigurationname): String
  [LaunchTemplate](#cfn-autoscaling-autoscalinggroup-launchtemplate): 
    LaunchTemplateSpecification
  [LifecycleHookSpecificationList](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecificationlist): 
    - LifecycleHookSpecification
  [LoadBalancerNames](#cfn-autoscaling-autoscalinggroup-loadbalancernames): 
    - String
  [MaxInstanceLifetime](#cfn-autoscaling-autoscalinggroup-maxinstancelifetime): Integer
  [MaxSize](#cfn-autoscaling-autoscalinggroup-maxsize): String
  [MetricsCollection](#cfn-autoscaling-autoscalinggroup-metricscollection): 
    - MetricsCollection
  [MinSize](#cfn-autoscaling-autoscalinggroup-minsize): String
  [MixedInstancesPolicy](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy): 
    MixedInstancesPolicy
  [NewInstancesProtectedFromScaleIn](#cfn-autoscaling-autoscalinggroup-newinstancesprotectedfromscalein): Boolean
  [NotificationConfigurations](#cfn-autoscaling-autoscalinggroup-notificationconfigurations): 
    - NotificationConfiguration
  [PlacementGroup](#cfn-autoscaling-autoscalinggroup-placementgroup): String
  [ServiceLinkedRoleARN](#cfn-autoscaling-autoscalinggroup-servicelinkedrolearn): String
  [SkipZonalShiftValidation](#cfn-autoscaling-autoscalinggroup-skipzonalshiftvalidation): Boolean
  [Tags](#cfn-autoscaling-autoscalinggroup-tags): 
    - TagProperty
  [TargetGroupARNs](#cfn-autoscaling-autoscalinggroup-targetgrouparns): 
    - String
  [TerminationPolicies](#cfn-autoscaling-autoscalinggroup-terminationpolicies): 
    - String
  [TrafficSources](#cfn-autoscaling-autoscalinggroup-trafficsources): 
    - TrafficSourceIdentifier
  [VPCZoneIdentifier](#cfn-autoscaling-autoscalinggroup-vpczoneidentifier): 
    - String
```

## Properties
<a name="aws-resource-autoscaling-autoscalinggroup-properties"></a>

`AutoScalingGroupName`  <a name="cfn-autoscaling-autoscalinggroup-autoscalinggroupname"></a>
The name of the Auto Scaling group. This name must be unique per Region per account.  
The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and lowercased letters.  
You cannot use a colon (:) in the name.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`AvailabilityZoneDistribution`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzonedistribution"></a>
The EC2 instance capacity distribution across Availability Zones for the Auto Scaling group.  
*Required*: No  
*Type*: [AvailabilityZoneDistribution](aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AvailabilityZoneIds`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzoneids"></a>
 The Availability Zone IDs where the Auto Scaling group can launch instances.   
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AvailabilityZoneImpairmentPolicy`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy"></a>
The Availability Zone impairment policy for the Auto Scaling group.  
*Required*: No  
*Type*: [AvailabilityZoneImpairmentPolicy](aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AvailabilityZones`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzones"></a>
A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the `VPCZoneIdentifier` property, or for attaching a network interface when an existing network interface ID is specified in a launch template.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CapacityRebalance`  <a name="cfn-autoscaling-autoscalinggroup-capacityrebalance"></a>
Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see [Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html) in the in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CapacityReservationSpecification`  <a name="cfn-autoscaling-autoscalinggroup-capacityreservationspecification"></a>
The capacity reservation specification for the Auto Scaling group.  
*Required*: No  
*Type*: [CapacityReservationSpecification](aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Context`  <a name="cfn-autoscaling-autoscalinggroup-context"></a>
Reserved.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Cooldown`  <a name="cfn-autoscaling-autoscalinggroup-cooldown"></a>
 *Only needed if you use simple scaling policies.*   
The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see [Scaling cooldowns for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scaling-cooldowns.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Default: `300` seconds  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DefaultInstanceWarmup`  <a name="cfn-autoscaling-autoscalinggroup-defaultinstancewarmup"></a>
The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the `InService` state.   
During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see [Set the default instance warmup for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) in the *Amazon EC2 Auto Scaling User Guide*.  
To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, *even if it is set to 0 seconds*. To remove a value that you previously set, include the property but specify `-1` for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of `0` or other nominal value.
Default: None   
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DeletionProtection`  <a name="cfn-autoscaling-autoscalinggroup-deletionprotection"></a>
The deletion protection setting for the Auto Scaling group.  
*Required*: No  
*Type*: String  
*Allowed values*: `none | prevent-force-deletion | prevent-all-deletion`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DesiredCapacity`  <a name="cfn-autoscaling-autoscalinggroup-desiredcapacity"></a>
The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure automatic scaling.  
The number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity when creating the stack, the default is the minimum size of the group.  
CloudFormation marks the Auto Scaling group as successful (by setting its status to CREATE\$1COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in the launch template or launch configuration that you specified, then desired capacity is not used as a criteria for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price.  
*Required*: No  
*Type*: String  
*Pattern*: `^[0-9]+$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DesiredCapacityType`  <a name="cfn-autoscaling-autoscalinggroup-desiredcapacitytype"></a>
The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports `DesiredCapacityType` for attribute-based instance type selection only. For more information, see [Create a mixed instances group using attribute-based instance type selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-mixed-instances-group-attribute-based-instance-type-selection.html) in the *Amazon EC2 Auto Scaling User Guide*.  
By default, Amazon EC2 Auto Scaling specifies `units`, which translates into number of instances.  
Valid values: `units` \$1 `vcpu` \$1 `memory-mib`  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HealthCheckGracePeriod`  <a name="cfn-autoscaling-autoscalinggroup-healthcheckgraceperiod"></a>
The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the `InService` state. For more information, see [Set the health check grace period for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Default: `0` seconds  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HealthCheckType`  <a name="cfn-autoscaling-autoscalinggroup-healthchecktype"></a>
A comma-separated value string of one or more health check types.  
The valid values are `EC2`, `EBS`, `ELB`, and `VPC_LATTICE`. `EC2` is the default health check and cannot be disabled. For more information, see [Health checks for instances in an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-health-checks.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Only specify `EC2` if you must clear a value that was previously set.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InstanceId`  <a name="cfn-autoscaling-autoscalinggroup-instanceid"></a>
The ID of the instance used to base the launch configuration on. For more information, see [Create an Auto Scaling group using an EC2 instance](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) in the *Amazon EC2 Auto Scaling User Guide*.  
If you specify `LaunchTemplate`, `MixedInstancesPolicy`, or `LaunchConfigurationName`, don't specify `InstanceId`.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceLifecyclePolicy`  <a name="cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy"></a>
The instance lifecycle policy for the Auto Scaling group.  
*Required*: No  
*Type*: [InstanceLifecyclePolicy](aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InstanceMaintenancePolicy`  <a name="cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy"></a>
An instance maintenance policy. For more information, see [Set instance maintenance policy](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: [InstanceMaintenancePolicy](aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LaunchConfigurationName`  <a name="cfn-autoscaling-autoscalinggroup-launchconfigurationname"></a>
The name of the launch configuration to use to launch instances.  
Required only if you don't specify `LaunchTemplate`, `MixedInstancesPolicy`, or `InstanceId`.  
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LaunchTemplate`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplate"></a>
Information used to specify the launch template and version to use to launch instances. You can alternatively associate a launch template to the Auto Scaling group by specifying a `MixedInstancesPolicy`. For more information about creating launch templates, see [Create a launch template for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto Scaling User Guide*.  
If you omit this property, you must specify `MixedInstancesPolicy`, `LaunchConfigurationName`, or `InstanceId`.  
*Required*: No  
*Type*: [LaunchTemplateSpecification](aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LifecycleHookSpecificationList`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecificationlist"></a>
One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.  
*Required*: No  
*Type*: Array of [LifecycleHookSpecification](aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LoadBalancerNames`  <a name="cfn-autoscaling-autoscalinggroup-loadbalancernames"></a>
A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the `TargetGroupARNs` property instead.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxInstanceLifetime`  <a name="cfn-autoscaling-autoscalinggroup-maxinstancelifetime"></a>
The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see [Replace Auto Scaling instances based on maximum instance lifetime](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxSize`  <a name="cfn-autoscaling-autoscalinggroup-maxsize"></a>
The maximum size of the group.  
With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above `MaxSize` to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above `MaxSize` by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).
*Required*: Yes  
*Type*: String  
*Pattern*: `^[0-9]+$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricsCollection`  <a name="cfn-autoscaling-autoscalinggroup-metricscollection"></a>
Enables the monitoring of group metrics of an Auto Scaling group. By default, these metrics are disabled.   
*Required*: No  
*Type*: [Array](aws-properties-autoscaling-autoscalinggroup-metricscollection.md) of [MetricsCollection](aws-properties-autoscaling-autoscalinggroup-metricscollection.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinSize`  <a name="cfn-autoscaling-autoscalinggroup-minsize"></a>
The minimum size of the group.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[0-9]+$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MixedInstancesPolicy`  <a name="cfn-autoscaling-autoscalinggroup-mixedinstancespolicy"></a>
An embedded object that specifies a mixed instances policy.  
The policy includes properties that not only define the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances (optional), and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities, but also the properties that specify the instance configuration information—the launch template and instance types. The policy can also include a weight for each instance type and different launch templates for individual instance types.  
For more information, see [Auto Scaling groups with multiple instance types and purchase options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: [MixedInstancesPolicy](aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`NewInstancesProtectedFromScaleIn`  <a name="cfn-autoscaling-autoscalinggroup-newinstancesprotectedfromscalein"></a>
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see [Use instance scale-in protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationConfigurations`  <a name="cfn-autoscaling-autoscalinggroup-notificationconfigurations"></a>
Configures an Auto Scaling group to send notifications when specified events take place.  
*Required*: No  
*Type*: Array of [NotificationConfiguration](aws-properties-autoscaling-autoscalinggroup-notificationconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PlacementGroup`  <a name="cfn-autoscaling-autoscalinggroup-placementgroup"></a>
The name of the placement group into which to launch your instances. For more information, see [Placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in the *Amazon EC2 User Guide*.  
A *cluster* placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. 
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServiceLinkedRoleARN`  <a name="cfn-autoscaling-autoscalinggroup-servicelinkedrolearn"></a>
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named `AWSServiceRoleForAutoScaling`, which it creates if it does not exist. For more information, see [Service-linked roles](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SkipZonalShiftValidation`  <a name="cfn-autoscaling-autoscalinggroup-skipzonalshiftvalidation"></a>
Property description not available.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-autoscaling-autoscalinggroup-tags"></a>
One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see [Tag Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Array of [TagProperty](aws-properties-autoscaling-autoscalinggroup-tagproperty.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TargetGroupARNs`  <a name="cfn-autoscaling-autoscalinggroup-targetgrouparns"></a>
The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and route requests to one or more registered targets. For more information, see [Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TerminationPolicies`  <a name="cfn-autoscaling-autoscalinggroup-terminationpolicies"></a>
A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see [Configure termination policies for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Valid values: `Default` \$1 `AllocationStrategy` \$1 `ClosestToNextInstanceHour` \$1 `NewestInstance` \$1 `OldestInstance` \$1 `OldestLaunchConfiguration` \$1 `OldestLaunchTemplate` \$1 `arn:aws:lambda:region:account-id:function:my-function:my-alias`  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TrafficSources`  <a name="cfn-autoscaling-autoscalinggroup-trafficsources"></a>
The traffic sources associated with this Auto Scaling group.  
*Required*: No  
*Type*: Array of [TrafficSourceIdentifier](aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`VPCZoneIdentifier`  <a name="cfn-autoscaling-autoscalinggroup-vpczoneidentifier"></a>
A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created.  
If this resource specifies public subnets and is also in a VPC that is defined in the same stack template, you must use the [DependsOn attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to declare a dependency on the [VPC-gateway attachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway-attachment.html).  
When you update `VPCZoneIdentifier`, this retains the same Auto Scaling group and replaces old instances with new ones, according to the specified subnets. You can optionally specify how CloudFormation handles these updates by using an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html).
Required to launch instances into a nondefault VPC. If you specify `VPCZoneIdentifier` with `AvailabilityZones`, the subnets that you specify for this property must reside in those Availability Zones.   
*Required*: Conditional  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

## Return values
<a name="aws-resource-autoscaling-autoscalinggroup-return-values"></a>

### Ref
<a name="aws-resource-autoscaling-autoscalinggroup-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name. For example: `mystack-myasgroup-NT5EUXTNTXXD`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-autoscaling-autoscalinggroup-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-autoscaling-autoscalinggroup-return-values-fn--getatt-fn--getatt"></a>

`AutoScalingGroupARN`  <a name="AutoScalingGroupARN-fn::getatt"></a>
The Amazon Resource Name (ARN) of the Auto Scaling group.

## Remarks
<a name="aws-resource-autoscaling-autoscalinggroup--remarks"></a>

When you update the launch template or launch configuration for an Auto Scaling group, this update action does not deploy any change across the running Amazon EC2 instances in the Auto Scaling group. All new instances will get the updated configuration, but existing instances continue to run with the configuration that they were originally launched with. This works the same way as any other Auto Scaling group. 

You can add an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) to your stack to perform rolling updates (or replace the group) when a change has been made to the group. You can find a sample update policy for rolling updates in [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html). Alternatively, you can force a rolling update on your instances at any time after updating the stack by starting an instance refresh. For more information, see [Replace Auto Scaling instances based on an instance refresh](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) in the *Amazon EC2 Auto Scaling User Guide*.

You can use a [CreationPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html) with an Auto Scaling group to prevent its status from reaching create complete until CloudFormation receives a specified number of success signals. For more information, see [Use a CreationPolicy to Wait for On-Instance Configurations](https://aws.amazon.com/blogs/devops/use-a-creationpolicy-to-wait-for-on-instance-configurations/) on the AWS DevOps Blog. For an example template, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).

Note that Amazon EC2 Auto Scaling provides scaling activities to help you monitor the progress of your Auto Scaling group and to assist in troubleshooting any configuration issues when launching Amazon EC2 instances. For more information, see [Verify a scaling activity for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Examples
<a name="aws-resource-autoscaling-autoscalinggroup--examples"></a>

The following examples create or make changes to an Auto Scaling group. 

**Topics**
+ [An Auto Scaling group and a launch template with a parameters section](#aws-resource-autoscaling-autoscalinggroup--examples--An_Auto_Scaling_group_and_a_launch_template_with_a_parameters_section)
+ [Auto Scaling group with CloudWatch monitoring enabled and custom tags](#aws-resource-autoscaling-autoscalinggroup--examples--Auto_Scaling_group_with_CloudWatch_monitoring_enabled_and_custom_tags)

### An Auto Scaling group and a launch template with a parameters section
<a name="aws-resource-autoscaling-autoscalinggroup--examples--An_Auto_Scaling_group_and_a_launch_template_with_a_parameters_section"></a>

The following example shows an Auto Scaling group. You specify values for the `MaxSize` and `MinSize` properties.

It also shows an [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) resource that contains the instance configuration information for the group, which uses the `LaunchTemplate` property to specify the launch template. The [Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html) intrinsic function gets the ID of the `AWS::EC2::LaunchTemplate` resource `myLaunchTemplate`. The [GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html) function gets the latest version number (for example, `1`) of the launch template for the `Version` property.

This example references [parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html) to specify the `ImageId` and `InstanceType` properties for the launch template and the `VPCZoneIdentifier` property for the group. Parameters are variables that you can specify when you create or update the stack. By default, the `ImageId` property of the launch template references the latest Amazon Linux 2 AMI from the AWS Systems Manager Parameter Store. For more information, see [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) in the *AWS Systems Manager User Guide* and the blog post [Query for the latest Amazon Linux AMI IDs using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/) on the AWS Compute Blog.

#### JSON
<a name="aws-resource-autoscaling-autoscalinggroup--examples--An_Auto_Scaling_group_and_a_launch_template_with_a_parameters_section--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Parameters": {
        "LatestAmiId": {
            "Description": "Region specific image from the Parameter Store",
            "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
            "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
        },
        "InstanceType": {
            "Description": "Amazon EC2 instance type for the instances",
            "Type": "String",
            "AllowedValues": [
                "t3.micro",
                "t3.small",
                "t3.medium"
            ],
            "Default": "t3.micro"
        },
        "Subnets": {
            "Type": "List<AWS::EC2::Subnet::Id>",
            "Description": "A list of subnets for the Auto Scaling group"
        }
    },
    "Resources": {
        "myLaunchTemplate": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "LaunchTemplateName": { "Fn::Sub": "${AWS::StackName}-launch-template" },
                "LaunchTemplateData": {
                    "ImageId": { "Ref": "LatestAmiId" },
                    "InstanceType": { "Ref": "InstanceType" }
                }
            }
        },
        "myASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": { "Ref": "myLaunchTemplate" },
                    "Version": { "Fn::GetAtt": [ "myLaunchTemplate", "LatestVersionNumber" ] }
                },
                "MaxSize": "1",
                "MinSize": "1",
                "VPCZoneIdentifier": { "Ref": "Subnets" }
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-autoscaling-autoscalinggroup--examples--An_Auto_Scaling_group_and_a_launch_template_with_a_parameters_section--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  LatestAmiId:
    Description: Region specific image from the Parameter Store
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
  InstanceType:
    Description: Amazon EC2 instance type for the instances
    Type: String
    AllowedValues:
      - t3.micro
      - t3.small
      - t3.medium
    Default: t3.micro
  Subnets:
    Type: 'List<AWS::EC2::Subnet::Id>'
    Description: A list of subnets for the Auto Scaling group
Resources:
  myLaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties: 
      LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
      LaunchTemplateData:
        ImageId: !Ref LatestAmiId
        InstanceType: !Ref InstanceType
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      LaunchTemplate:
        LaunchTemplateId: !Ref myLaunchTemplate
        Version: !GetAtt myLaunchTemplate.LatestVersionNumber
      MaxSize: '1'
      MinSize: '1'
      VPCZoneIdentifier: !Ref Subnets
```

### Auto Scaling group with CloudWatch monitoring enabled and custom tags
<a name="aws-resource-autoscaling-autoscalinggroup--examples--Auto_Scaling_group_with_CloudWatch_monitoring_enabled_and_custom_tags"></a>

The following snippet shows an Auto Scaling group with CloudWatch monitoring enabled and custom tags. The `LaunchTemplate` property references an [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) resource with the logical name `myLaunchTemplate` that is defined elsewhere in your template.

You specify the CloudWatch metrics to monitor using the `MetricsCollection` property. If you keep the metrics as they are, only `GroupMinSize` and `GroupMaxSize` metrics are enabled.

You specify the tag keys and tag key values for the `Tags` property. If you keep the provided tags, the first tag, `Environment`=`Production`, is assigned to the Auto Scaling group and to any EC2 instances launched as part of the Auto Scaling group. The second tag, `Purpose`=`WebServerGroup`, is assigned only to the Auto Scaling group itself.

You also specify values for the `MaxSize`, `MinSize`, and `VPCZoneIdentifier` properties.

#### JSON
<a name="aws-resource-autoscaling-autoscalinggroup--examples--Auto_Scaling_group_with_CloudWatch_monitoring_enabled_and_custom_tags--json"></a>

```
{
    "Resources": {
        "myASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": { "Ref": "myLaunchTemplate" },
                    "Version": { "Fn::GetAtt": [ "myLaunchTemplate", "LatestVersionNumber" ] }
                },
                "MaxSize": "1",
                "MinSize": "1",
                "VPCZoneIdentifier": [
                    "subnetIdAz1",
                    "subnetIdAz2",
                    "subnetIdAz3"
                ],
                "MetricsCollection": [
                    {
                        "Granularity": "1Minute",
                        "Metrics": [
                            "GroupMinSize",
                            "GroupMaxSize"
                        ]
                    }
                ],
                "Tags": [
                    {
                        "Key": "Environment",
                        "Value": "Production",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "Purpose",
                        "Value": "WebServerGroup",
                        "PropagateAtLaunch": "false"
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-autoscaling-autoscalinggroup--examples--Auto_Scaling_group_with_CloudWatch_monitoring_enabled_and_custom_tags--yaml"></a>

```
---
Resources:
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      LaunchTemplate:
        LaunchTemplateId: !Ref myLaunchTemplate
        Version: !GetAtt myLaunchTemplate.LatestVersionNumber
      MaxSize: '1'
      MinSize: '1'
      VPCZoneIdentifier:   
        - subnetIdAz1
        - subnetIdAz2
        - subnetIdAz3
      MetricsCollection: 
        - Granularity: 1Minute
          Metrics: 
            - GroupMinSize
            - GroupMaxSize
      Tags:
        - Key: Environment
          Value: Production
          PropagateAtLaunch: true
        - Key: Purpose
          Value: WebServerGroup
          PropagateAtLaunch: false
```

## See also
<a name="aws-resource-autoscaling-autoscalinggroup--seealso"></a>
+ You can find additional useful snippets in the following sections of the *AWS CloudFormation User Guide*:
  + For examples of Auto Scaling groups, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).
  + For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).
+ [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide*
+ [CreateAutoScalingGroup](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateAutoScalingGroup.html) and [UpdateAutoScalingGroup](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_UpdateAutoScalingGroup.html) in the *Amazon EC2 Auto Scaling API Reference*



# AWS::AutoScaling::AutoScalingGroup AcceleratorCountRequest
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest"></a>

`AcceleratorCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of accelerators for an instance type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-max"></a>
The maximum value.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-min"></a>
The minimum value.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup AcceleratorTotalMemoryMiBRequest
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest"></a>

`AcceleratorTotalMemoryMiBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum total memory size for the accelerators for an instance type, in MiB.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-max"></a>
The memory maximum in MiB.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-min"></a>
The memory minimum in MiB.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup AvailabilityZoneDistribution
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution"></a>

`AvailabilityZoneDistribution` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution-syntax.json"></a>

```
{
  "[CapacityDistributionStrategy](#cfn-autoscaling-autoscalinggroup-availabilityzonedistribution-capacitydistributionstrategy)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution-syntax.yaml"></a>

```
  [CapacityDistributionStrategy](#cfn-autoscaling-autoscalinggroup-availabilityzonedistribution-capacitydistributionstrategy): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzonedistribution-properties"></a>

`CapacityDistributionStrategy`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzonedistribution-capacitydistributionstrategy"></a>
 If launches fail in an Availability Zone, the following strategies are available. The default is `balanced-best-effort`.   
+ `balanced-only` - If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution.
+ `balanced-best-effort` - If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead.
*Required*: No  
*Type*: String  
*Allowed values*: `balanced-best-effort | balanced-only`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup AvailabilityZoneImpairmentPolicy
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy"></a>

 Describes an Availability Zone impairment policy. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-syntax.json"></a>

```
{
  "[ImpairedZoneHealthCheckBehavior](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-impairedzonehealthcheckbehavior)" : String,
  "[ZonalShiftEnabled](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-zonalshiftenabled)" : Boolean
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-syntax.yaml"></a>

```
  [ImpairedZoneHealthCheckBehavior](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-impairedzonehealthcheckbehavior): String
  [ZonalShiftEnabled](#cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-zonalshiftenabled): Boolean
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-properties"></a>

`ImpairedZoneHealthCheckBehavior`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-impairedzonehealthcheckbehavior"></a>
 Specifies the health check behavior for the impaired Availability Zone in an active zonal shift. If you select `Replace unhealthy`, instances that appear unhealthy will be replaced in all Availability Zones. If you select `Ignore unhealthy`, instances will not be replaced in the Availability Zone with the active zonal shift. For more information, see [Auto Scaling group zonal shift](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html) in the *Amazon EC2 Auto Scaling User Guide*.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `IgnoreUnhealthy | ReplaceUnhealthy`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ZonalShiftEnabled`  <a name="cfn-autoscaling-autoscalinggroup-availabilityzoneimpairmentpolicy-zonalshiftenabled"></a>
 If `true`, enable zonal shift for your Auto Scaling group.   
*Required*: Yes  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup BaselineEbsBandwidthMbpsRequest
<a name="aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest"></a>

`BaselineEbsBandwidthMbpsRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in Mbps.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-max"></a>
The maximum value in Mbps.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-min"></a>
The minimum value in Mbps.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup BaselinePerformanceFactorsRequest
<a name="aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest"></a>

 The baseline performance to consider, using an instance family as a baseline reference. The instance family establishes the lowest acceptable level of performance. Auto Scaling uses this baseline to guide instance type selection, but there is no guarantee that the selected instance types will always exceed the baseline for every application. 

Currently, this parameter only supports CPU performance as a baseline performance factor. For example, specifying `c6i` uses the CPU performance of the `c6i` family as the baseline reference.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-syntax.json"></a>

```
{
  "[Cpu](#cfn-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-cpu)" : CpuPerformanceFactorRequest
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-syntax.yaml"></a>

```
  [Cpu](#cfn-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-cpu): 
    CpuPerformanceFactorRequest
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-properties"></a>

`Cpu`  <a name="cfn-autoscaling-autoscalinggroup-baselineperformancefactorsrequest-cpu"></a>
 The CPU performance to consider, using an instance family as the baseline reference.   
*Required*: No  
*Type*: [CpuPerformanceFactorRequest](aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup CapacityReservationSpecification
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification"></a>

 Describes the Capacity Reservation preference and targeting options. If you specify `open` or `none` for `CapacityReservationPreference`, do not specify a `CapacityReservationTarget`. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification-syntax.json"></a>

```
{
  "[CapacityReservationPreference](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationpreference)" : String,
  "[CapacityReservationTarget](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationtarget)" : CapacityReservationTarget
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification-syntax.yaml"></a>

```
  [CapacityReservationPreference](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationpreference): String
  [CapacityReservationTarget](#cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationtarget): 
    CapacityReservationTarget
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationspecification-properties"></a>

`CapacityReservationPreference`  <a name="cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationpreference"></a>
 The capacity reservation preference. The following options are available:   
+ `capacity-reservations-only` - Auto Scaling will only launch instances into a Capacity Reservation or Capacity Reservation resource group. If capacity isn't available, instances will fail to launch.
+ `capacity-reservations-first` - Auto Scaling will try to launch instances into a Capacity Reservation or Capacity Reservation resource group first. If capacity isn't available, instances will run in On-Demand capacity.
+ `none` - Auto Scaling will not launch instances into a Capacity Reservation. Instances will run in On-Demand capacity. 
+ `default` - Auto Scaling uses the Capacity Reservation preference from your launch template or an open Capacity Reservation.
*Required*: Yes  
*Type*: String  
*Allowed values*: `capacity-reservations-only | capacity-reservations-first | none | default`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CapacityReservationTarget`  <a name="cfn-autoscaling-autoscalinggroup-capacityreservationspecification-capacityreservationtarget"></a>
 Describes a target Capacity Reservation or Capacity Reservation resource group.   
*Required*: No  
*Type*: [CapacityReservationTarget](aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup CapacityReservationTarget
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget"></a>

 The target for the Capacity Reservation. Specify Capacity Reservations IDs or Capacity Reservation resource group ARNs. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget-syntax.json"></a>

```
{
  "[CapacityReservationIds](#cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationids)" : [ String, ... ],
  "[CapacityReservationResourceGroupArns](#cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationresourcegrouparns)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget-syntax.yaml"></a>

```
  [CapacityReservationIds](#cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationids): 
    - String
  [CapacityReservationResourceGroupArns](#cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationresourcegrouparns): 
    - String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-capacityreservationtarget-properties"></a>

`CapacityReservationIds`  <a name="cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationids"></a>
 The Capacity Reservation IDs to launch instances into.   
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CapacityReservationResourceGroupArns`  <a name="cfn-autoscaling-autoscalinggroup-capacityreservationtarget-capacityreservationresourcegrouparns"></a>
 The resource group ARNs of the Capacity Reservation to launch instances into.   
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup CpuPerformanceFactorRequest
<a name="aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest"></a>

 The CPU performance to consider, using an instance family as the baseline reference. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest-syntax.json"></a>

```
{
  "[References](#cfn-autoscaling-autoscalinggroup-cpuperformancefactorrequest-references)" : [ PerformanceFactorReferenceRequest, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest-syntax.yaml"></a>

```
  [References](#cfn-autoscaling-autoscalinggroup-cpuperformancefactorrequest-references): 
    - PerformanceFactorReferenceRequest
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-cpuperformancefactorrequest-properties"></a>

`References`  <a name="cfn-autoscaling-autoscalinggroup-cpuperformancefactorrequest-references"></a>
 Specify an instance family to use as the baseline reference for CPU performance. All instance types that match your specified attributes will be compared against the CPU performance of the referenced instance family, regardless of CPU manufacturer or architecture differences.   
Currently only one instance family can be specified in the list.
*Required*: No  
*Type*: Array of [PerformanceFactorReferenceRequest](aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup InstanceLifecyclePolicy
<a name="aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy"></a>

 The instance lifecycle policy for the Auto Scaling group. This policy controls instance behavior when an instance transitions through its lifecycle states. Configure retention triggers to specify when instances should move to a `Retained` state instead of automatic termination. 

For more information, see [ Control instance retention with instance lifecycle policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/instance-lifecycle-policy.html) in the *Amazon EC2 Auto Scaling User Guide*. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy-syntax.json"></a>

```
{
  "[RetentionTriggers](#cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy-retentiontriggers)" : RetentionTriggers
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy-syntax.yaml"></a>

```
  [RetentionTriggers](#cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy-retentiontriggers): 
    RetentionTriggers
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-instancelifecyclepolicy-properties"></a>

`RetentionTriggers`  <a name="cfn-autoscaling-autoscalinggroup-instancelifecyclepolicy-retentiontriggers"></a>
 Specifies the conditions that trigger instance retention behavior. These triggers determine when instances should move to a `Retained` state instead of automatic termination. This allows you to maintain control over instance management when lifecycles transition and operations fail.   
*Required*: No  
*Type*: [RetentionTriggers](aws-properties-autoscaling-autoscalinggroup-retentiontriggers.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup InstanceMaintenancePolicy
<a name="aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy"></a>

`InstanceMaintenancePolicy` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource.

For more information, see [Instance maintenance policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy-syntax.json"></a>

```
{
  "[MaxHealthyPercentage](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-maxhealthypercentage)" : Integer,
  "[MinHealthyPercentage](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-minhealthypercentage)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy-syntax.yaml"></a>

```
  [MaxHealthyPercentage](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-maxhealthypercentage): Integer
  [MinHealthyPercentage](#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-minhealthypercentage): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy-properties"></a>

`MaxHealthyPercentage`  <a name="cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-maxhealthypercentage"></a>
Specifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group. It represents the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. Value range is 100 to 200. To clear a previously set value, specify a value of `-1`.  
Both `MinHealthyPercentage` and `MaxHealthyPercentage` must be specified, and the difference between them cannot be greater than 100. A large range increases the number of instances that can be replaced at the same time.  
*Required*: No  
*Type*: Integer  
*Minimum*: `-1`  
*Maximum*: `200`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinHealthyPercentage`  <a name="cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-minhealthypercentage"></a>
Specifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group. It represents the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload when replacing instances. Value range is 0 to 100. To clear a previously set value, specify a value of `-1`.  
*Required*: No  
*Type*: Integer  
*Minimum*: `-1`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup InstanceRequirements
<a name="aws-properties-autoscaling-autoscalinggroup-instancerequirements"></a>

The attributes for the instance types for a mixed instances policy. Amazon EC2 Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch instances from these instance types.

When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.

To limit the list of instance types from which Amazon EC2 Auto Scaling can identify matching instance types, you can use one of the following parameters, but not both in the same request:
+ `AllowedInstanceTypes` - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.
+ `ExcludedInstanceTypes` - The instance types to exclude from the list, even if they match your specified attributes.

**Note**  
You must specify `VCpuCount` and `MemoryMiB`. All other attributes are optional. Any unspecified optional attribute is set to its default.

For an example template, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).

For more information, see [Creating an Auto Scaling group using attribute-based instance type selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in the *Amazon EC2 Auto Scaling User Guide*. For help determining which instance types match your attributes before you apply them to your Auto Scaling group, see [Preview instance types with specified attributes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-get-instance-types-from-instance-requirements) in the *Amazon EC2 User Guide for Linux Instances*.

`InstanceRequirements` is a property of the `LaunchTemplateOverrides` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) property type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-instancerequirements-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-instancerequirements-syntax.json"></a>

```
{
  "[AcceleratorCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratorcount)" : AcceleratorCountRequest,
  "[AcceleratorManufacturers](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratormanufacturers)" : [ String, ... ],
  "[AcceleratorNames](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratornames)" : [ String, ... ],
  "[AcceleratorTotalMemoryMiB](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortotalmemorymib)" : AcceleratorTotalMemoryMiBRequest,
  "[AcceleratorTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortypes)" : [ String, ... ],
  "[AllowedInstanceTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-allowedinstancetypes)" : [ String, ... ],
  "[BareMetal](#cfn-autoscaling-autoscalinggroup-instancerequirements-baremetal)" : String,
  "[BaselineEbsBandwidthMbps](#cfn-autoscaling-autoscalinggroup-instancerequirements-baselineebsbandwidthmbps)" : BaselineEbsBandwidthMbpsRequest,
  "[BaselinePerformanceFactors](#cfn-autoscaling-autoscalinggroup-instancerequirements-baselineperformancefactors)" : BaselinePerformanceFactorsRequest,
  "[BurstablePerformance](#cfn-autoscaling-autoscalinggroup-instancerequirements-burstableperformance)" : String,
  "[CpuManufacturers](#cfn-autoscaling-autoscalinggroup-instancerequirements-cpumanufacturers)" : [ String, ... ],
  "[ExcludedInstanceTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-excludedinstancetypes)" : [ String, ... ],
  "[InstanceGenerations](#cfn-autoscaling-autoscalinggroup-instancerequirements-instancegenerations)" : [ String, ... ],
  "[LocalStorage](#cfn-autoscaling-autoscalinggroup-instancerequirements-localstorage)" : String,
  "[LocalStorageTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-localstoragetypes)" : [ String, ... ],
  "[MaxSpotPriceAsPercentageOfOptimalOnDemandPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-maxspotpriceaspercentageofoptimalondemandprice)" : Integer,
  "[MemoryGiBPerVCpu](#cfn-autoscaling-autoscalinggroup-instancerequirements-memorygibpervcpu)" : MemoryGiBPerVCpuRequest,
  "[MemoryMiB](#cfn-autoscaling-autoscalinggroup-instancerequirements-memorymib)" : MemoryMiBRequest,
  "[NetworkBandwidthGbps](#cfn-autoscaling-autoscalinggroup-instancerequirements-networkbandwidthgbps)" : NetworkBandwidthGbpsRequest,
  "[NetworkInterfaceCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-networkinterfacecount)" : NetworkInterfaceCountRequest,
  "[OnDemandMaxPricePercentageOverLowestPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-ondemandmaxpricepercentageoverlowestprice)" : Integer,
  "[RequireHibernateSupport](#cfn-autoscaling-autoscalinggroup-instancerequirements-requirehibernatesupport)" : Boolean,
  "[SpotMaxPricePercentageOverLowestPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-spotmaxpricepercentageoverlowestprice)" : Integer,
  "[TotalLocalStorageGB](#cfn-autoscaling-autoscalinggroup-instancerequirements-totallocalstoragegb)" : TotalLocalStorageGBRequest,
  "[VCpuCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-vcpucount)" : VCpuCountRequest
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-instancerequirements-syntax.yaml"></a>

```
  [AcceleratorCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratorcount): 
    AcceleratorCountRequest
  [AcceleratorManufacturers](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratormanufacturers): 
    - String
  [AcceleratorNames](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratornames): 
    - String
  [AcceleratorTotalMemoryMiB](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortotalmemorymib): 
    AcceleratorTotalMemoryMiBRequest
  [AcceleratorTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortypes): 
    - String
  [AllowedInstanceTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-allowedinstancetypes): 
    - String
  [BareMetal](#cfn-autoscaling-autoscalinggroup-instancerequirements-baremetal): String
  [BaselineEbsBandwidthMbps](#cfn-autoscaling-autoscalinggroup-instancerequirements-baselineebsbandwidthmbps): 
    BaselineEbsBandwidthMbpsRequest
  [BaselinePerformanceFactors](#cfn-autoscaling-autoscalinggroup-instancerequirements-baselineperformancefactors): 
    BaselinePerformanceFactorsRequest
  [BurstablePerformance](#cfn-autoscaling-autoscalinggroup-instancerequirements-burstableperformance): String
  [CpuManufacturers](#cfn-autoscaling-autoscalinggroup-instancerequirements-cpumanufacturers): 
    - String
  [ExcludedInstanceTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-excludedinstancetypes): 
    - String
  [InstanceGenerations](#cfn-autoscaling-autoscalinggroup-instancerequirements-instancegenerations): 
    - String
  [LocalStorage](#cfn-autoscaling-autoscalinggroup-instancerequirements-localstorage): String
  [LocalStorageTypes](#cfn-autoscaling-autoscalinggroup-instancerequirements-localstoragetypes): 
    - String
  [MaxSpotPriceAsPercentageOfOptimalOnDemandPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-maxspotpriceaspercentageofoptimalondemandprice): Integer
  [MemoryGiBPerVCpu](#cfn-autoscaling-autoscalinggroup-instancerequirements-memorygibpervcpu): 
    MemoryGiBPerVCpuRequest
  [MemoryMiB](#cfn-autoscaling-autoscalinggroup-instancerequirements-memorymib): 
    MemoryMiBRequest
  [NetworkBandwidthGbps](#cfn-autoscaling-autoscalinggroup-instancerequirements-networkbandwidthgbps): 
    NetworkBandwidthGbpsRequest
  [NetworkInterfaceCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-networkinterfacecount): 
    NetworkInterfaceCountRequest
  [OnDemandMaxPricePercentageOverLowestPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-ondemandmaxpricepercentageoverlowestprice): Integer
  [RequireHibernateSupport](#cfn-autoscaling-autoscalinggroup-instancerequirements-requirehibernatesupport): Boolean
  [SpotMaxPricePercentageOverLowestPrice](#cfn-autoscaling-autoscalinggroup-instancerequirements-spotmaxpricepercentageoverlowestprice): Integer
  [TotalLocalStorageGB](#cfn-autoscaling-autoscalinggroup-instancerequirements-totallocalstoragegb): 
    TotalLocalStorageGBRequest
  [VCpuCount](#cfn-autoscaling-autoscalinggroup-instancerequirements-vcpucount): 
    VCpuCountRequest
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-instancerequirements-properties"></a>

`AcceleratorCount`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratorcount"></a>
The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.  
To exclude accelerator-enabled instance types, set `Max` to `0`.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [AcceleratorCountRequest](aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`AcceleratorManufacturers`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratormanufacturers"></a>
Indicates whether instance types must have accelerators by specific manufacturers.  
+ For instance types with NVIDIA devices, specify `nvidia`.
+ For instance types with AMD devices, specify `amd`.
+ For instance types with AWS devices, specify `amazon-web-services`.
+ For instance types with Xilinx devices, specify `xilinx`.
Default: Any manufacturer  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`AcceleratorNames`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratornames"></a>
Lists the accelerators that must be on an instance type.  
+ For instance types with NVIDIA A100 GPUs, specify `a100`.
+ For instance types with NVIDIA V100 GPUs, specify `v100`.
+ For instance types with NVIDIA K80 GPUs, specify `k80`.
+ For instance types with NVIDIA T4 GPUs, specify `t4`.
+ For instance types with NVIDIA M60 GPUs, specify `m60`.
+ For instance types with AMD Radeon Pro V520 GPUs, specify `radeon-pro-v520`.
+ For instance types with Xilinx VU9P FPGAs, specify `vu9p`.
Default: Any accelerator  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`AcceleratorTotalMemoryMiB`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortotalmemorymib"></a>
The minimum and maximum total memory size for the accelerators on an instance type, in MiB.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [AcceleratorTotalMemoryMiBRequest](aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`AcceleratorTypes`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortypes"></a>
Lists the accelerator types that must be on an instance type.  
+ For instance types with GPU accelerators, specify `gpu`.
+ For instance types with FPGA accelerators, specify `fpga`.
+ For instance types with inference accelerators, specify `inference`.
Default: Any accelerator type  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`AllowedInstanceTypes`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-allowedinstancetypes"></a>
The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes.  
You can use strings with one or more wild cards, represented by an asterisk (`*`), to allow an instance type, size, or generation. The following are examples: `m5.8xlarge`, `c5*.*`, `m5a.*`, `r*`, `*3*`.  
For example, if you specify `c5*`, Amazon EC2 Auto Scaling will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify `m5a.*`, Amazon EC2 Auto Scaling will allow all the M5a instance types, but not the M5n instance types.  
If you specify `AllowedInstanceTypes`, you can't specify `ExcludedInstanceTypes`.
Default: All instance types  
*Required*: No  
*Type*: Array of String  
*Maximum*: `400`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`BareMetal`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-baremetal"></a>
Indicates whether bare metal instance types are included, excluded, or required.  
Default: `excluded`  
*Required*: No  
*Type*: String  
*Allowed values*: `included | excluded | required`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`BaselineEbsBandwidthMbps`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-baselineebsbandwidthmbps"></a>
The minimum and maximum baseline bandwidth performance for an instance type, in Mbps. For more information, see [Amazon EBS–optimized instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) in the *Amazon EC2 User Guide*.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [BaselineEbsBandwidthMbpsRequest](aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`BaselinePerformanceFactors`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-baselineperformancefactors"></a>
 The baseline performance factors for the instance requirements.   
*Required*: No  
*Type*: [BaselinePerformanceFactorsRequest](aws-properties-autoscaling-autoscalinggroup-baselineperformancefactorsrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`BurstablePerformance`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-burstableperformance"></a>
Indicates whether burstable performance instance types are included, excluded, or required. For more information, see [Burstable performance instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) in the *Amazon EC2 User Guide*.  
Default: `excluded`  
*Required*: No  
*Type*: String  
*Allowed values*: `included | excluded | required`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`CpuManufacturers`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-cpumanufacturers"></a>
Lists which specific CPU manufacturers to include.  
+ For instance types with Intel CPUs, specify `intel`.
+ For instance types with AMD CPUs, specify `amd`.
+ For instance types with AWS CPUs, specify `amazon-web-services`.
+ For instance types with Apple CPUs, specify `apple`.
Don't confuse the CPU hardware manufacturer with the CPU hardware architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template. 
Default: Any manufacturer  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`ExcludedInstanceTypes`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-excludedinstancetypes"></a>
The instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk (`*`), to exclude an instance family, type, size, or generation. The following are examples: `m5.8xlarge`, `c5*.*`, `m5a.*`, `r*`, `*3*`.   
For example, if you specify `c5*`, you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you specify `m5a.*`, Amazon EC2 Auto Scaling will exclude all the M5a instance types, but not the M5n instance types.  
If you specify `ExcludedInstanceTypes`, you can't specify `AllowedInstanceTypes`.
Default: No excluded instance types  
*Required*: No  
*Type*: Array of String  
*Maximum*: `400`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`InstanceGenerations`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-instancegenerations"></a>
Indicates whether current or previous generation instance types are included.  
+ For current generation instance types, specify `current`. The current generation includes EC2 instance types currently recommended for use. This typically includes the latest two to three generations in each instance family. For more information, see [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide*.
+ For previous generation instance types, specify `previous`.
Default: Any current or previous generation  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LocalStorage`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-localstorage"></a>
Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, see [Amazon EC2 instance store](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the *Amazon EC2 User Guide*.  
Default: `included`  
*Required*: No  
*Type*: String  
*Allowed values*: `included | excluded | required`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LocalStorageTypes`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-localstoragetypes"></a>
Indicates the type of local storage that is required.  
+ For instance types with hard disk drive (HDD) storage, specify `hdd`.
+ For instance types with solid state drive (SSD) storage, specify `ssd`.
Default: Any local storage type  
*Required*: No  
*Type*: Array of String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-maxspotpriceaspercentageofoptimalondemandprice"></a>
[Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.  
The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage.  
If you set `DesiredCapacityType` to `vcpu` or `memory-mib`, the price protection threshold is based on the per-vCPU or per-memory price instead of the per instance price.   
Only one of `SpotMaxPricePercentageOverLowestPrice` or `MaxSpotPriceAsPercentageOfOptimalOnDemandPrice` can be specified. If you don't specify either, Amazon EC2 Auto Scaling will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as `999999`. 
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`MemoryGiBPerVCpu`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-memorygibpervcpu"></a>
The minimum and maximum amount of memory per vCPU for an instance type, in GiB.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [MemoryGiBPerVCpuRequest](aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`MemoryMiB`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-memorymib"></a>
The minimum and maximum instance memory size for an instance type, in MiB.  
*Required*: Yes  
*Type*: [MemoryMiBRequest](aws-properties-autoscaling-autoscalinggroup-memorymibrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`NetworkBandwidthGbps`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-networkbandwidthgbps"></a>
The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [NetworkBandwidthGbpsRequest](aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`NetworkInterfaceCount`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-networkinterfacecount"></a>
The minimum and maximum number of network interfaces for an instance type.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [NetworkInterfaceCountRequest](aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`OnDemandMaxPricePercentageOverLowestPrice`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-ondemandmaxpricepercentageoverlowestprice"></a>
[Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.   
The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage.  
To turn off price protection, specify a high value, such as `999999`.   
If you set `DesiredCapacityType` to `vcpu` or `memory-mib`, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per instance price.   
Default: `20`  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`RequireHibernateSupport`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-requirehibernatesupport"></a>
Indicates whether instance types must provide On-Demand Instance hibernation support.  
Default: `false`  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`SpotMaxPricePercentageOverLowestPrice`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-spotmaxpricepercentageoverlowestprice"></a>
[Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price. The identified Spot price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.  
The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage.   
If you set `DesiredCapacityType` to `vcpu` or `memory-mib`, the price protection threshold is based on the per-vCPU or per-memory price instead of the per instance price.   
Only one of `SpotMaxPricePercentageOverLowestPrice` or `MaxSpotPriceAsPercentageOfOptimalOnDemandPrice` can be specified. If you don't specify either, Amazon EC2 Auto Scaling will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as `999999`. 
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`TotalLocalStorageGB`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-totallocalstoragegb"></a>
The minimum and maximum total local storage size for an instance type, in GB.  
Default: No minimum or maximum limits  
*Required*: No  
*Type*: [TotalLocalStorageGBRequest](aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`VCpuCount`  <a name="cfn-autoscaling-autoscalinggroup-instancerequirements-vcpucount"></a>
The minimum and maximum number of vCPUs for an instance type.  
*Required*: Yes  
*Type*: [VCpuCountRequest](aws-properties-autoscaling-autoscalinggroup-vcpucountrequest.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup InstancesDistribution
<a name="aws-properties-autoscaling-autoscalinggroup-instancesdistribution"></a>

Use this structure to specify the distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand and Spot capacities for a mixed instances policy.

For more information, see [Auto Scaling groups with multiple instance types and purchase options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in the *Amazon EC2 Auto Scaling User Guide*.

`InstancesDistribution` is a property of the [AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) property type. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-instancesdistribution-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-instancesdistribution-syntax.json"></a>

```
{
  "[OnDemandAllocationStrategy](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandallocationstrategy)" : String,
  "[OnDemandBaseCapacity](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandbasecapacity)" : Integer,
  "[OnDemandPercentageAboveBaseCapacity](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandpercentageabovebasecapacity)" : Integer,
  "[SpotAllocationStrategy](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotallocationstrategy)" : String,
  "[SpotInstancePools](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotinstancepools)" : Integer,
  "[SpotMaxPrice](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotmaxprice)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-instancesdistribution-syntax.yaml"></a>

```
  [OnDemandAllocationStrategy](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandallocationstrategy): String
  [OnDemandBaseCapacity](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandbasecapacity): Integer
  [OnDemandPercentageAboveBaseCapacity](#cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandpercentageabovebasecapacity): Integer
  [SpotAllocationStrategy](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotallocationstrategy): String
  [SpotInstancePools](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotinstancepools): Integer
  [SpotMaxPrice](#cfn-autoscaling-autoscalinggroup-instancesdistribution-spotmaxprice): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-instancesdistribution-properties"></a>

`OnDemandAllocationStrategy`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandallocationstrategy"></a>
The allocation strategy to apply to your On-Demand Instances when they are launched. Possible instance types are determined by the launch template overrides that you specify.  
The following lists the valid values:    
lowest-price  
Uses price to determine which instance types are the highest priority, launching the lowest priced instance types within an Availability Zone first. This is the default value for Auto Scaling groups that specify `InstanceRequirements`.   
prioritized  
You set the order of instance types for the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling launches your highest priority instance types first. If all your On-Demand capacity cannot be fulfilled using your highest priority instance type, then Amazon EC2 Auto Scaling launches the remaining capacity using the second priority instance type, and so on. This is the default value for Auto Scaling groups that don't specify `InstanceRequirements` and cannot be used for groups that do.
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`OnDemandBaseCapacity`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandbasecapacity"></a>
The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base portion is launched first as your group scales.  
This number has the same unit of measurement as the group's desired capacity. If you change the default unit of measurement (number of instances) by specifying weighted capacity values in your launch template overrides list, or by changing the default desired capacity type setting of the group, you must specify this number using the same unit of measurement.  
Default: 0  
An update to this setting means a gradual replacement of instances to adjust the current On-Demand Instance levels. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.
*Required*: No  
*Type*: Integer  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`OnDemandPercentageAboveBaseCapacity`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-ondemandpercentageabovebasecapacity"></a>
Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond `OnDemandBaseCapacity`. Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used.  
Default: 100  
An update to this setting means a gradual replacement of instances to adjust the current On-Demand and Spot Instance levels for your additional capacity higher than the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.
*Required*: No  
*Type*: Integer  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`SpotAllocationStrategy`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-spotallocationstrategy"></a>
The allocation strategy to apply to your Spot Instances when they are launched. Possible instance types are determined by the launch template overrides that you specify.  
The following lists the valid values:    
capacity-optimized  
Requests Spot Instances using pools that are optimally chosen based on the available Spot capacity. This strategy has the lowest risk of interruption. To give certain instance types a higher chance of launching first, use `capacity-optimized-prioritized`.  
capacity-optimized-prioritized  
You set the order of instance types for the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best effort basis but optimizes for capacity first. Note that if the On-Demand allocation strategy is set to `prioritized`, the same priority is applied when fulfilling On-Demand capacity. This is not a valid value for Auto Scaling groups that specify `InstanceRequirements`.  
lowest-price  
Requests Spot Instances using the lowest priced pools within an Availability Zone, across the number of Spot pools that you specify for the `SpotInstancePools` property. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. This is the default value, but it might lead to high interruption rates because this strategy only considers instance price and not available capacity.  
price-capacity-optimized (recommended)  
The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price.
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`SpotInstancePools`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-spotinstancepools"></a>
The number of Spot Instance pools across which to allocate your Spot Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the `SpotAllocationStrategy` is `lowest-price`. Value must be in the range of 1–20.  
Default: 2  
*Required*: No  
*Type*: Integer  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`SpotMaxPrice`  <a name="cfn-autoscaling-autoscalinggroup-instancesdistribution-spotmaxprice"></a>
The maximum price per unit hour that you are willing to pay for a Spot Instance. If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances are not launched. We do not recommend specifying a maximum price because it can lead to increased interruptions. When Spot Instances launch, you pay the current Spot price. To remove a maximum price that you previously set, include the property but specify an empty string ("") for the value.  
If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify one.
Valid Range: Minimum value of 0.001  
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup LaunchTemplate
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplate"></a>

Use this structure to specify the launch templates and instance types (overrides) for a mixed instances policy.

`LaunchTemplate` is a property of the [AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) property type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplate-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplate-syntax.json"></a>

```
{
  "[LaunchTemplateSpecification](#cfn-autoscaling-autoscalinggroup-launchtemplate-launchtemplatespecification)" : LaunchTemplateSpecification,
  "[Overrides](#cfn-autoscaling-autoscalinggroup-launchtemplate-overrides)" : [ LaunchTemplateOverrides, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplate-syntax.yaml"></a>

```
  [LaunchTemplateSpecification](#cfn-autoscaling-autoscalinggroup-launchtemplate-launchtemplatespecification): 
    LaunchTemplateSpecification
  [Overrides](#cfn-autoscaling-autoscalinggroup-launchtemplate-overrides): 
    - LaunchTemplateOverrides
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplate-properties"></a>

`LaunchTemplateSpecification`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplate-launchtemplatespecification"></a>
The launch template.  
*Required*: Yes  
*Type*: [LaunchTemplateSpecification](aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Overrides`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplate-overrides"></a>
Any properties that you specify override the same properties in the launch template.  
*Required*: No  
*Type*: Array of [LaunchTemplateOverrides](aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides"></a>

Use this structure to let Amazon EC2 Auto Scaling do the following when the Auto Scaling group has a mixed instances policy:
+ Override the instance type that is specified in the launch template.
+ Use multiple instance types.

Specify the instance types that you want, or define your instance requirements instead and let Amazon EC2 Auto Scaling provision the available instance types that meet your requirements. This can provide Amazon EC2 Auto Scaling with a larger selection of instance types to choose from when fulfilling Spot and On-Demand capacities. You can view which instance types are matched before you apply the instance requirements to your Auto Scaling group.

After you define your instance requirements, you don't have to keep updating these settings to get new EC2 instance types automatically. Amazon EC2 Auto Scaling uses the instance requirements of the Auto Scaling group to determine whether a new EC2 instance type can be used.

`LaunchTemplateOverrides` is a property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) property type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides-syntax.json"></a>

```
{
  "[ImageId](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-imageid)" : String,
  "[InstanceRequirements](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancerequirements)" : InstanceRequirements,
  "[InstanceType](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancetype)" : String,
  "[LaunchTemplateSpecification](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-launchtemplatespecification)" : LaunchTemplateSpecification,
  "[WeightedCapacity](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-weightedcapacity)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides-syntax.yaml"></a>

```
  [ImageId](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-imageid): String
  [InstanceRequirements](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancerequirements): 
    InstanceRequirements
  [InstanceType](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancetype): String
  [LaunchTemplateSpecification](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-launchtemplatespecification): 
    LaunchTemplateSpecification
  [WeightedCapacity](#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-weightedcapacity): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides-properties"></a>

`ImageId`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-imageid"></a>
 The ID of the Amazon Machine Image (AMI) to use for instances launched with this override. When using Instance Refresh with `ReplaceRootVolume` strategy, this specifies the AMI for root volume replacement operations.   
 For `ReplaceRootVolume` operations:   
+ All overrides in the `MixedInstancesPolicy` must specify an ImageId
+ The AMI must contain only a single root volume
+ Root volume replacement doesn't support multi-volume AMIs
*Required*: No  
*Type*: String  
*Pattern*: `^ami-[a-z0-9]{1,17}$`  
*Minimum*: `5`  
*Maximum*: `21`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`InstanceRequirements`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancerequirements"></a>
The instance requirements. Amazon EC2 Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch instances from these instance types.  
You can specify up to four separate sets of instance requirements per Auto Scaling group. This is useful for provisioning instances from different Amazon Machine Images (AMIs) in the same Auto Scaling group. To do this, create the AMIs and create a new launch template for each AMI. Then, create a compatible set of instance requirements for each launch template.   
If you specify `InstanceRequirements`, you can't specify `InstanceType`.
*Required*: No  
*Type*: [InstanceRequirements](aws-properties-autoscaling-autoscalinggroup-instancerequirements.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`InstanceType`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancetype"></a>
The instance type, such as `m3.xlarge`. You must specify an instance type that is supported in your requested Region and Availability Zones. For more information, see [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide*.  
You can specify up to 40 instance types per Auto Scaling group.  
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LaunchTemplateSpecification`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-launchtemplatespecification"></a>
Provides a launch template for the specified instance type or set of instance requirements. For example, some instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that's specified in the `LaunchTemplate` definition. For more information, see [Specifying a different launch template for an instance type](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-launch-template-overrides.html) in the *Amazon EC2 Auto Scaling User Guide*.   
You can specify up to 20 launch templates per Auto Scaling group. The launch templates specified in the overrides and in the `LaunchTemplate` definition count towards this limit.  
*Required*: No  
*Type*: [LaunchTemplateSpecification](aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`WeightedCapacity`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-weightedcapacity"></a>
If you provide a list of instance types to use, you can specify the number of capacity units provided by each instance type in terms of virtual CPUs, memory, storage, throughput, or other relative performance characteristic. When a Spot or On-Demand Instance is launched, the capacity units count toward the desired capacity. Amazon EC2 Auto Scaling launches instances until the desired capacity is totally fulfilled, even if this results in an overage. For example, if there are two units remaining to fulfill capacity, and Amazon EC2 Auto Scaling can only launch an instance with a `WeightedCapacity` of five units, the instance is launched, and the desired capacity is exceeded by three units. For more information, see [Configure instance weighting for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-instance-weighting.html) in the *Amazon EC2 Auto Scaling User Guide*. Value must be in the range of 1-999.   
If you specify a value for `WeightedCapacity` for one instance type, you must specify a value for `WeightedCapacity` for all of them.  
Every Auto Scaling group has three size parameters (`DesiredCapacity`, `MaxSize`, and `MinSize`). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances. 
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup LaunchTemplateSpecification
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification"></a>

Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group.

You must specify the following:
+ The ID or the name of the launch template, but not both.
+ The version of the launch template.

`LaunchTemplateSpecification` is property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) and [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property types.

For information about creating a launch template, see [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) and [Create a launch template for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto Scaling User Guide*.

For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification-syntax.json"></a>

```
{
  "[LaunchTemplateId](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplateid)" : String,
  "[LaunchTemplateName](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplatename)" : String,
  "[Version](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-version)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification-syntax.yaml"></a>

```
  [LaunchTemplateId](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplateid): String
  [LaunchTemplateName](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplatename): String
  [Version](#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-version): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification-properties"></a>

`LaunchTemplateId`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplateid"></a>
The ID of the launch template.  
You must specify the `LaunchTemplateID` or the `LaunchTemplateName`, but not both.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LaunchTemplateName`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplatename"></a>
The name of the launch template.  
You must specify the `LaunchTemplateName` or the `LaunchTemplateID`, but not both.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Version`  <a name="cfn-autoscaling-autoscalinggroup-launchtemplatespecification-version"></a>
The version number of the launch template.  
Specifying `$Latest` or `$Default` for the template version number is not supported. However, you can specify `LatestVersionNumber` or `DefaultVersionNumber` using the `Fn::GetAtt` intrinsic function. For more information, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).  
For an example of using the `Fn::GetAtt` function, see the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) section of the `AWS::AutoScaling::AutoScalingGroup` resource.
*Required*: Yes  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

## See also
<a name="aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification--seealso"></a>
+  [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) 
+  [AWS::EC2::LaunchTemplate BlockDeviceMapping](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-blockdevicemapping.html) 
+ [Required KMS key policy for use with encrypted volumes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html) in the *Amazon EC2 Auto Scaling User Guide*
+ [Use encryption with EBS-backed AMIs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html) in the *Amazon EC2 User Guide for Linux Instances*



# AWS::AutoScaling::AutoScalingGroup LifecycleHookSpecification
<a name="aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification"></a>

`LifecycleHookSpecification` specifies a lifecycle hook for the `LifecycleHookSpecificationList` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource. A lifecycle hook specifies actions to perform when Amazon EC2 Auto Scaling launches or terminates instances. 

For more information, see [Amazon EC2 Auto Scaling lifecycle hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) in the *Amazon EC2 Auto Scaling User Guide*. You can find a sample template snippet in the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-lifecyclehook.html#aws-resource-as-lifecyclehook--examples) section of the `AWS::AutoScaling::LifecycleHook` resource.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification-syntax.json"></a>

```
{
  "[DefaultResult](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-defaultresult)" : String,
  "[HeartbeatTimeout](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-heartbeattimeout)" : Integer,
  "[LifecycleHookName](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecyclehookname)" : String,
  "[LifecycleTransition](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecycletransition)" : String,
  "[NotificationMetadata](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationmetadata)" : String,
  "[NotificationTargetARN](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationtargetarn)" : String,
  "[RoleARN](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-rolearn)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification-syntax.yaml"></a>

```
  [DefaultResult](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-defaultresult): String
  [HeartbeatTimeout](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-heartbeattimeout): Integer
  [LifecycleHookName](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecyclehookname): String
  [LifecycleTransition](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecycletransition): String
  [NotificationMetadata](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationmetadata): String
  [NotificationTargetARN](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationtargetarn): String
  [RoleARN](#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-rolearn): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification-properties"></a>

`DefaultResult`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-defaultresult"></a>
The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is `ABANDON`.  
Valid values: `CONTINUE` \$1 `ABANDON`  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HeartbeatTimeout`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-heartbeattimeout"></a>
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from `30` to `7200` seconds. The default value is `3600` seconds (1 hour).  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LifecycleHookName`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecyclehookname"></a>
The name of the lifecycle hook.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[A-Za-z0-9\-_\/]+`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LifecycleTransition`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecycletransition"></a>
The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.  
+ To create a lifecycle hook for scale-out events, specify `autoscaling:EC2_INSTANCE_LAUNCHING`.
+ To create a lifecycle hook for scale-in events, specify `autoscaling:EC2_INSTANCE_TERMINATING`.
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationMetadata`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationmetadata"></a>
Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0009\u000A\u000D\u0020-\u007e]+`  
*Minimum*: `1`  
*Maximum*: `4000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationTargetARN`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationtargetarn"></a>
The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleARN`  <a name="cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-rolearn"></a>
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see [Prepare to add a lifecycle hook to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup MemoryGiBPerVCpuRequest
<a name="aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest"></a>

`MemoryGiBPerVCpuRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-max)" : Number,
  "[Min](#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-min)" : Number
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-max): Number
  [Min](#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-min): Number
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-max"></a>
The memory maximum in GiB.  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-min"></a>
The memory minimum in GiB.  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup MemoryMiBRequest
<a name="aws-properties-autoscaling-autoscalinggroup-memorymibrequest"></a>

`MemoryMiBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum instance memory size for an instance type, in MiB.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-memorymibrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-memorymibrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-memorymibrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-memorymibrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-memorymibrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-memorymibrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-memorymibrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-memorymibrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-memorymibrequest-max"></a>
The memory maximum in MiB.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-memorymibrequest-min"></a>
The memory minimum in MiB.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup MetricsCollection
<a name="aws-properties-autoscaling-autoscalinggroup-metricscollection"></a>

`MetricsCollection` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource that describes the group metrics that an Amazon EC2 Auto Scaling group sends to Amazon CloudWatch. These metrics describe the group rather than any of its instances. 

For more information, see [Monitor CloudWatch metrics for your Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html) in the *Amazon EC2 Auto Scaling User Guide*. You can find a sample template snippet in the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) section of the `AWS::AutoScaling::AutoScalingGroup` resource.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-metricscollection-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-metricscollection-syntax.json"></a>

```
{
  "[Granularity](#cfn-autoscaling-autoscalinggroup-metricscollection-granularity)" : String,
  "[Metrics](#cfn-autoscaling-autoscalinggroup-metricscollection-metrics)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-metricscollection-syntax.yaml"></a>

```
  [Granularity](#cfn-autoscaling-autoscalinggroup-metricscollection-granularity): String
  [Metrics](#cfn-autoscaling-autoscalinggroup-metricscollection-metrics): 
    - String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-metricscollection-properties"></a>

`Granularity`  <a name="cfn-autoscaling-autoscalinggroup-metricscollection-granularity"></a>
The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is `1Minute`.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Metrics`  <a name="cfn-autoscaling-autoscalinggroup-metricscollection-metrics"></a>
Identifies the metrics to enable.  
You can specify one or more of the following metrics:  
+  `GroupMinSize` 
+  `GroupMaxSize` 
+  `GroupDesiredCapacity` 
+  `GroupInServiceInstances` 
+  `GroupPendingInstances` 
+  `GroupStandbyInstances` 
+  `GroupTerminatingInstances` 
+  `GroupTotalInstances` 
+  `GroupInServiceCapacity` 
+  `GroupPendingCapacity` 
+  `GroupStandbyCapacity` 
+  `GroupTerminatingCapacity` 
+  `GroupTotalCapacity` 
+  `WarmPoolDesiredCapacity` 
+  `WarmPoolWarmedCapacity` 
+  `WarmPoolPendingCapacity` 
+  `WarmPoolTerminatingCapacity` 
+  `WarmPoolTotalCapacity` 
+  `GroupAndWarmPoolDesiredCapacity` 
+  `GroupAndWarmPoolTotalCapacity` 
If you specify `Granularity` and don't specify any metrics, all metrics are enabled.  
For more information, see [Amazon CloudWatch metrics for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-metrics.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy
<a name="aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy"></a>

Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.

A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see [Auto Scaling groups with multiple instance types and purchase options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in the *Amazon EC2 Auto Scaling User Guide*.

You can create a mixed instances policy for new and existing Auto Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration.

There are key differences between Spot Instances and On-Demand Instances:
+ The price for Spot Instances varies based on demand
+ Amazon EC2 can terminate an individual Spot Instance as the availability of, or price for, Spot Instances changes

When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a replacement instance to maintain the desired capacity for the group. 

`MixedInstancesPolicy` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy-syntax.json"></a>

```
{
  "[InstancesDistribution](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-instancesdistribution)" : InstancesDistribution,
  "[LaunchTemplate](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-launchtemplate)" : LaunchTemplate
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy-syntax.yaml"></a>

```
  [InstancesDistribution](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-instancesdistribution): 
    InstancesDistribution
  [LaunchTemplate](#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-launchtemplate): 
    LaunchTemplate
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy-properties"></a>

`InstancesDistribution`  <a name="cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-instancesdistribution"></a>
The instances distribution.  
*Required*: No  
*Type*: [InstancesDistribution](aws-properties-autoscaling-autoscalinggroup-instancesdistribution.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`LaunchTemplate`  <a name="cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-launchtemplate"></a>
One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill On-Demand and Spot capacities.  
*Required*: Yes  
*Type*: [LaunchTemplate](aws-properties-autoscaling-autoscalinggroup-launchtemplate.md)  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup NetworkBandwidthGbpsRequest
<a name="aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest"></a>

`NetworkBandwidthGbpsRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum network bandwidth for an instance type, in Gbps.

**Note**  
Setting the minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance might go below the specified minimum at times. For more information, see [Available instance bandwidth](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth) in the *Amazon EC2 User Guide for Linux Instances*.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-max)" : Number,
  "[Min](#cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-min)" : Number
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-max): Number
  [Min](#cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-min): Number
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-max"></a>
The maximum amount of network bandwidth, in gigabits per second (Gbps).  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-networkbandwidthgbpsrequest-min"></a>
The minimum amount of network bandwidth, in gigabits per second (Gbps).  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup NetworkInterfaceCountRequest
<a name="aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest"></a>

`NetworkInterfaceCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of network interfaces for an instance type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-max"></a>
The maximum number of network interfaces.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-min"></a>
The minimum number of network interfaces.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup NotificationConfiguration
<a name="aws-properties-autoscaling-autoscalinggroup-notificationconfiguration"></a>

A structure that specifies an Amazon SNS notification configuration for the `NotificationConfigurations` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource.

For an example template snippet, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).

For more information, see [Get Amazon SNS notifications when your Auto Scaling group scales](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-notificationconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-notificationconfiguration-syntax.json"></a>

```
{
  "[NotificationTypes](#cfn-autoscaling-autoscalinggroup-notificationconfiguration-notificationtypes)" : [ String, ... ],
  "[TopicARN](#cfn-autoscaling-autoscalinggroup-notificationconfiguration-topicarn)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-notificationconfiguration-syntax.yaml"></a>

```
  [NotificationTypes](#cfn-autoscaling-autoscalinggroup-notificationconfiguration-notificationtypes): 
    - String
  [TopicARN](#cfn-autoscaling-autoscalinggroup-notificationconfiguration-topicarn): 
    - String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-notificationconfiguration-properties"></a>

`NotificationTypes`  <a name="cfn-autoscaling-autoscalinggroup-notificationconfiguration-notificationtypes"></a>
A list of event types that send a notification. Event types can include any of the following types.   
*Allowed values*:  
+  `autoscaling:EC2_INSTANCE_LAUNCH` 
+  `autoscaling:EC2_INSTANCE_LAUNCH_ERROR` 
+  `autoscaling:EC2_INSTANCE_TERMINATE` 
+  `autoscaling:EC2_INSTANCE_TERMINATE_ERROR` 
+  `autoscaling:TEST_NOTIFICATION` 
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TopicARN`  <a name="cfn-autoscaling-autoscalinggroup-notificationconfiguration-topicarn"></a>
The Amazon Resource Name (ARN) of the Amazon SNS topic.  
*Required*: Yes  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup PerformanceFactorReferenceRequest
<a name="aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest"></a>

 Specify an instance family to use as the baseline reference for CPU performance. All instance types that All instance types that match your specified attributes will be compared against the CPU performance of the referenced instance family, regardless of CPU manufacturer or architecture differences. 

**Note**  
Currently only one instance family can be specified in the list.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest-syntax.json"></a>

```
{
  "[InstanceFamily](#cfn-autoscaling-autoscalinggroup-performancefactorreferencerequest-instancefamily)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest-syntax.yaml"></a>

```
  [InstanceFamily](#cfn-autoscaling-autoscalinggroup-performancefactorreferencerequest-instancefamily): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-performancefactorreferencerequest-properties"></a>

`InstanceFamily`  <a name="cfn-autoscaling-autoscalinggroup-performancefactorreferencerequest-instancefamily"></a>
 The instance family to use as a baseline reference.   
Make sure that you specify the correct value for the instance family. The instance family is everything before the period (.) in the instance type name. For example, in the instance `c6i.large`, the instance family is `c6i`, not `c6`. For more information, see [Amazon EC2 instance type naming conventions](https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-type-names.html) in *Amazon EC2 Instance Types*.
The following instance types are *not supported* for performance protection.  
+  `c1` 
+  `g3| g3s` 
+  `hpc7g` 
+  `m1| m2` 
+  `mac1 | mac2 | mac2-m1ultra | mac2-m2 | mac2-m2pro` 
+  `p3dn | p4d | p5` 
+  `t1` 
+  `u-12tb1 | u-18tb1 | u-24tb1 | u-3tb1 | u-6tb1 | u-9tb1 | u7i-12tb | u7in-16tb | u7in-24tb | u7in-32tb` 
If you performance protection by specifying a supported instance family, the returned instance types will exclude the preceding unsupported instance families.  
If you specify an unsupported instance family as a value for baseline performance, the API returns an empty response.  
*Required*: No  
*Type*: String  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup RetentionTriggers
<a name="aws-properties-autoscaling-autoscalinggroup-retentiontriggers"></a>

 Defines the specific triggers that cause instances to be retained in a Retained state rather than terminated. Each trigger corresponds to a different failure scenario during the instance lifecycle. This allows fine-grained control over when to preserve instances for manual intervention. 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-retentiontriggers-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-retentiontriggers-syntax.json"></a>

```
{
  "[TerminateHookAbandon](#cfn-autoscaling-autoscalinggroup-retentiontriggers-terminatehookabandon)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-retentiontriggers-syntax.yaml"></a>

```
  [TerminateHookAbandon](#cfn-autoscaling-autoscalinggroup-retentiontriggers-terminatehookabandon): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-retentiontriggers-properties"></a>

`TerminateHookAbandon`  <a name="cfn-autoscaling-autoscalinggroup-retentiontriggers-terminatehookabandon"></a>
 Specifies the action when a termination lifecycle hook is abandoned due to failure, timeout, or explicit abandonment (calling CompleteLifecycleAction).   
 Set to `retain` to move instances to a retained state. Set to `terminate` for default termination behavior.   
 Retained instances don't count toward desired capacity and remain until you call `TerminateInstanceInAutoScalingGroup`.   
*Required*: No  
*Type*: String  
*Allowed values*: `retain | terminate`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup TagProperty
<a name="aws-properties-autoscaling-autoscalinggroup-tagproperty"></a>

A structure that specifies a tag for the `Tags` property of [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource.

For more information, see [Tag Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) in the *Amazon EC2 Auto Scaling User Guide*. You can find a sample template snippet in the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) section of the `AWS::AutoScaling::AutoScalingGroup` resource.

CloudFormation adds the following tags to all Auto Scaling groups and associated instances: 
+ aws:cloudformation:stack-name
+ aws:cloudformation:stack-id
+ aws:cloudformation:logical-id 

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-tagproperty-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-tagproperty-syntax.json"></a>

```
{
  "[Key](#cfn-autoscaling-autoscalinggroup-tagproperty-key)" : String,
  "[PropagateAtLaunch](#cfn-autoscaling-autoscalinggroup-tagproperty-propagateatlaunch)" : Boolean,
  "[Value](#cfn-autoscaling-autoscalinggroup-tagproperty-value)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-tagproperty-syntax.yaml"></a>

```
  [Key](#cfn-autoscaling-autoscalinggroup-tagproperty-key): String
  [PropagateAtLaunch](#cfn-autoscaling-autoscalinggroup-tagproperty-propagateatlaunch): Boolean
  [Value](#cfn-autoscaling-autoscalinggroup-tagproperty-value): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-tagproperty-properties"></a>

`Key`  <a name="cfn-autoscaling-autoscalinggroup-tagproperty-key"></a>
The tag key.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PropagateAtLaunch`  <a name="cfn-autoscaling-autoscalinggroup-tagproperty-propagateatlaunch"></a>
Set to `true` if you want CloudFormation to copy the tag to EC2 instances that are launched as part of the Auto Scaling group. Set to `false` if you want the tag attached only to the Auto Scaling group and not copied to any instances launched as part of the Auto Scaling group.   
*Required*: Yes  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-autoscaling-autoscalinggroup-tagproperty-value"></a>
The tag value.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup TotalLocalStorageGBRequest
<a name="aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest"></a>

`TotalLocalStorageGBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum total local storage size for an instance type, in GB.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-max)" : Number,
  "[Min](#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-min)" : Number
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-max): Number
  [Min](#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-min): Number
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-max"></a>
The storage maximum in GB.  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-min"></a>
The storage minimum in GB.  
*Required*: No  
*Type*: Number  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::AutoScalingGroup TrafficSourceIdentifier
<a name="aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier"></a>

Identifying information for a traffic source.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier-syntax.json"></a>

```
{
  "[Identifier](#cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-identifier)" : String,
  "[Type](#cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-type)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier-syntax.yaml"></a>

```
  [Identifier](#cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-identifier): String
  [Type](#cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-type): String
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-trafficsourceidentifier-properties"></a>

`Identifier`  <a name="cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-identifier"></a>
Identifies the traffic source.  
For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.  
For example:   
+ Application Load Balancer ARN: `arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/1234567890123456`
+ Classic Load Balancer name: `my-classic-load-balancer`
+ VPC Lattice ARN: `arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-1234567890123456`
To get the ARN of a target group for a Application Load Balancer, Gateway Load Balancer, or Network Load Balancer, or the name of a Classic Load Balancer, use the Elastic Load Balancing [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) and [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operations.  
To get the ARN of a target group for VPC Lattice, use the VPC Lattice [GetTargetGroup](https://docs.aws.amazon.com/vpc-lattice/latest/APIReference/API_GetTargetGroup.html) API operation.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `511`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-autoscaling-autoscalinggroup-trafficsourceidentifier-type"></a>
Provides additional context for the value of `Identifier`.  
The following lists the valid values:  
+ `elb` if `Identifier` is the name of a Classic Load Balancer.
+ `elbv2` if `Identifier` is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.
+ `vpc-lattice` if `Identifier` is the ARN of a VPC Lattice target group.
Required if the identifier is the name of a Classic Load Balancer.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `511`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::AutoScalingGroup VCpuCountRequest
<a name="aws-properties-autoscaling-autoscalinggroup-vcpucountrequest"></a>

`VCpuCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of vCPUs for an instance type.

## Syntax
<a name="aws-properties-autoscaling-autoscalinggroup-vcpucountrequest-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-autoscalinggroup-vcpucountrequest-syntax.json"></a>

```
{
  "[Max](#cfn-autoscaling-autoscalinggroup-vcpucountrequest-max)" : Integer,
  "[Min](#cfn-autoscaling-autoscalinggroup-vcpucountrequest-min)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-autoscalinggroup-vcpucountrequest-syntax.yaml"></a>

```
  [Max](#cfn-autoscaling-autoscalinggroup-vcpucountrequest-max): Integer
  [Min](#cfn-autoscaling-autoscalinggroup-vcpucountrequest-min): Integer
```

## Properties
<a name="aws-properties-autoscaling-autoscalinggroup-vcpucountrequest-properties"></a>

`Max`  <a name="cfn-autoscaling-autoscalinggroup-vcpucountrequest-max"></a>
The maximum number of vCPUs.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`Min`  <a name="cfn-autoscaling-autoscalinggroup-vcpucountrequest-min"></a>
The minimum number of vCPUs.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

# AWS::AutoScaling::LaunchConfiguration
<a name="aws-resource-autoscaling-launchconfiguration"></a>

The `AWS::AutoScaling::LaunchConfiguration` resource specifies the launch configuration that can be used by an Auto Scaling group to configure Amazon EC2 instances. 

When you update the launch configuration for an Auto Scaling group, CloudFormation deletes that resource and creates a new launch configuration with the updated properties and a new name. Existing instances are not affected. To update existing instances when you update the `AWS::AutoScaling::LaunchConfiguration` resource, you can specify an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) for the group. You can find sample update policies for rolling updates in [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html). 

**Note**  
Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a [launch template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) or a launch configuration. We strongly recommend that you do not use launch configurations. For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html) in the *Amazon EC2 Auto Scaling User Guide*.  
For help migrating from launch configurations to launch templates, see [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-resource-autoscaling-launchconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-launchconfiguration-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::LaunchConfiguration",
  "Properties" : {
      "[AssociatePublicIpAddress](#cfn-autoscaling-launchconfiguration-associatepublicipaddress)" : Boolean,
      "[BlockDeviceMappings](#cfn-autoscaling-launchconfiguration-blockdevicemappings)" : [ BlockDeviceMapping, ... ],
      "[ClassicLinkVPCId](#cfn-autoscaling-launchconfiguration-classiclinkvpcid)" : String,
      "[ClassicLinkVPCSecurityGroups](#cfn-autoscaling-launchconfiguration-classiclinkvpcsecuritygroups)" : [ String, ... ],
      "[EbsOptimized](#cfn-autoscaling-launchconfiguration-ebsoptimized)" : Boolean,
      "[IamInstanceProfile](#cfn-autoscaling-launchconfiguration-iaminstanceprofile)" : String,
      "[ImageId](#cfn-autoscaling-launchconfiguration-imageid)" : String,
      "[InstanceId](#cfn-autoscaling-launchconfiguration-instanceid)" : String,
      "[InstanceMonitoring](#cfn-autoscaling-launchconfiguration-instancemonitoring)" : Boolean,
      "[InstanceType](#cfn-autoscaling-launchconfiguration-instancetype)" : String,
      "[KernelId](#cfn-autoscaling-launchconfiguration-kernelid)" : String,
      "[KeyName](#cfn-autoscaling-launchconfiguration-keyname)" : String,
      "[LaunchConfigurationName](#cfn-autoscaling-launchconfiguration-launchconfigurationname)" : String,
      "[MetadataOptions](#cfn-autoscaling-launchconfiguration-metadataoptions)" : MetadataOptions,
      "[PlacementTenancy](#cfn-autoscaling-launchconfiguration-placementtenancy)" : String,
      "[RamDiskId](#cfn-autoscaling-launchconfiguration-ramdiskid)" : String,
      "[SecurityGroups](#cfn-autoscaling-launchconfiguration-securitygroups)" : [ String, ... ],
      "[SpotPrice](#cfn-autoscaling-launchconfiguration-spotprice)" : String,
      "[UserData](#cfn-autoscaling-launchconfiguration-userdata)" : String
    }
}
```

### YAML
<a name="aws-resource-autoscaling-launchconfiguration-syntax.yaml"></a>

```
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
  [AssociatePublicIpAddress](#cfn-autoscaling-launchconfiguration-associatepublicipaddress): Boolean
  [BlockDeviceMappings](#cfn-autoscaling-launchconfiguration-blockdevicemappings): 
    - BlockDeviceMapping
  [ClassicLinkVPCId](#cfn-autoscaling-launchconfiguration-classiclinkvpcid): String
  [ClassicLinkVPCSecurityGroups](#cfn-autoscaling-launchconfiguration-classiclinkvpcsecuritygroups): 
    - String
  [EbsOptimized](#cfn-autoscaling-launchconfiguration-ebsoptimized): Boolean
  [IamInstanceProfile](#cfn-autoscaling-launchconfiguration-iaminstanceprofile): String
  [ImageId](#cfn-autoscaling-launchconfiguration-imageid): String
  [InstanceId](#cfn-autoscaling-launchconfiguration-instanceid): String
  [InstanceMonitoring](#cfn-autoscaling-launchconfiguration-instancemonitoring): Boolean
  [InstanceType](#cfn-autoscaling-launchconfiguration-instancetype): String
  [KernelId](#cfn-autoscaling-launchconfiguration-kernelid): String
  [KeyName](#cfn-autoscaling-launchconfiguration-keyname): String
  [LaunchConfigurationName](#cfn-autoscaling-launchconfiguration-launchconfigurationname): String
  [MetadataOptions](#cfn-autoscaling-launchconfiguration-metadataoptions): 
    MetadataOptions
  [PlacementTenancy](#cfn-autoscaling-launchconfiguration-placementtenancy): String
  [RamDiskId](#cfn-autoscaling-launchconfiguration-ramdiskid): String
  [SecurityGroups](#cfn-autoscaling-launchconfiguration-securitygroups): 
    - String
  [SpotPrice](#cfn-autoscaling-launchconfiguration-spotprice): String
  [UserData](#cfn-autoscaling-launchconfiguration-userdata): String
```

## Properties
<a name="aws-resource-autoscaling-launchconfiguration-properties"></a>

`AssociatePublicIpAddress`  <a name="cfn-autoscaling-launchconfiguration-associatepublicipaddress"></a>
Specifies whether to assign a public IPv4 address to the group's instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.  
If you specify `true`, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see [Provide network connectivity for your Auto Scaling instances using Amazon VPC](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) in the *Amazon EC2 Auto Scaling User Guide*.  
If you specify this property, you must specify at least one subnet for `VPCZoneIdentifier` when you create your group.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`BlockDeviceMappings`  <a name="cfn-autoscaling-launchconfiguration-blockdevicemappings"></a>
The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see [Block device mappings](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) in the *Amazon EC2 User Guide*.  
*Required*: No  
*Type*: Array of [BlockDeviceMapping](aws-properties-autoscaling-launchconfiguration-blockdevicemapping.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ClassicLinkVPCId`  <a name="cfn-autoscaling-launchconfiguration-classiclinkvpcid"></a>
Available for backward compatibility.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ClassicLinkVPCSecurityGroups`  <a name="cfn-autoscaling-launchconfiguration-classiclinkvpcsecuritygroups"></a>
Available for backward compatibility.  
*Required*: Conditional  
*Type*: Array of String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`EbsOptimized`  <a name="cfn-autoscaling-launchconfiguration-ebsoptimized"></a>
Specifies whether the launch configuration is optimized for EBS I/O (`true`) or not (`false`). The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see [Amazon EBS-optimized instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) in the *Amazon EC2 User Guide*.  
The default value is `false`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`IamInstanceProfile`  <a name="cfn-autoscaling-launchconfiguration-iaminstanceprofile"></a>
The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see [IAM role for applications that run on Amazon EC2 instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ImageId`  <a name="cfn-autoscaling-launchconfiguration-imageid"></a>
The ID of the Amazon Machine Image (AMI) that was assigned during registration. For more information, see [Find a Linux AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) in the *Amazon EC2 User Guide*.  
If you specify `InstanceId`, an `ImageId` is not required.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceId`  <a name="cfn-autoscaling-launchconfiguration-instanceid"></a>
The ID of the Amazon EC2 instance to use to create the launch configuration. When you use an instance to create a launch configuration, all properties are derived from the instance with the exception of `BlockDeviceMapping` and `AssociatePublicIpAddress`. You can override any properties from the instance by specifying them in the launch configuration.   
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceMonitoring`  <a name="cfn-autoscaling-launchconfiguration-instancemonitoring"></a>
Controls whether instances in this group are launched with detailed (`true`) or basic (`false`) monitoring.  
The default value is `true` (enabled).  
When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see [Configure monitoring for Auto Scaling instances](https://docs.aws.amazon.com/autoscaling/latest/userguide/enable-as-instance-metrics.html) in the *Amazon EC2 Auto Scaling User Guide*.
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceType`  <a name="cfn-autoscaling-launchconfiguration-instancetype"></a>
Specifies the instance type of the EC2 instance. For information about available instance types, see [Available instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) in the *Amazon EC2 User Guide*.  
If you specify `InstanceId`, an `InstanceType` is not required.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`KernelId`  <a name="cfn-autoscaling-launchconfiguration-kernelid"></a>
The ID of the kernel associated with the AMI.  
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see [User provided kernels](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html) in the *Amazon EC2 User Guide*.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`KeyName`  <a name="cfn-autoscaling-launchconfiguration-keyname"></a>
The name of the key pair. For more information, see [Amazon EC2 key pairs and Amazon EC2 instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) in the *Amazon EC2 User Guide*.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`LaunchConfigurationName`  <a name="cfn-autoscaling-launchconfiguration-launchconfigurationname"></a>
The name of the launch configuration. This name must be unique per Region per account.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetadataOptions`  <a name="cfn-autoscaling-launchconfiguration-metadataoptions"></a>
The metadata options for the instances. For more information, see [Configure the instance metadata options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-config.html#launch-configurations-imds) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: No  
*Type*: [MetadataOptions](aws-properties-autoscaling-launchconfiguration-metadataoptions.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`PlacementTenancy`  <a name="cfn-autoscaling-launchconfiguration-placementtenancy"></a>
The tenancy of the instance, either `default` or `dedicated`. An instance with `dedicated` tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set to `default`), you must set the value of this property to `dedicated`.  
If you specify `PlacementTenancy`, you must specify at least one subnet for `VPCZoneIdentifier` when you create your group.  
Valid values: `default` \$1 `dedicated`  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RamDiskId`  <a name="cfn-autoscaling-launchconfiguration-ramdiskid"></a>
The ID of the RAM disk to select.  
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see [User provided kernels](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html) in the *Amazon EC2 User Guide*.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SecurityGroups`  <a name="cfn-autoscaling-launchconfiguration-securitygroups"></a>
A list that contains the security groups to assign to the instances in the Auto Scaling group. The list can contain both the IDs of existing security groups and references to [SecurityGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html) resources created in the template.  
For more information, see [Control traffic to resources using security groups](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) in the *Amazon Virtual Private Cloud User Guide*.   
*Required*: No  
*Type*: Array of String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SpotPrice`  <a name="cfn-autoscaling-launchconfiguration-spotprice"></a>
The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see [Request Spot Instances for fault-tolerant and flexible applications](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-template-spot-instances.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Valid Range: Minimum value of 0.001  
When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`UserData`  <a name="cfn-autoscaling-launchconfiguration-userdata"></a>
The Base64-encoded user data to make available to the launched EC2 instances. For more information, see [Instance metadata and user data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) in the *Amazon EC2 User Guide for Linux Instances*.  
*Required*: No  
*Type*: String  
*Maximum*: `21847`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-autoscaling-launchconfiguration-return-values"></a>

### Ref
<a name="aws-resource-autoscaling-launchconfiguration-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name. For example: `mystack-mylaunchconfig-1DDYF1E3B3I`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

## Remarks
<a name="aws-resource-autoscaling-launchconfiguration--remarks"></a>

CloudFormation marks the Auto Scaling group as successful (by setting its status to CREATE\$1COMPLETE) when its desired capacity is reached. However, if `SpotPrice` is set in the launch configuration, then desired capacity is not used as a criteria for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price. If the current Spot price is less than your specified maximum price, Amazon EC2 Auto Scaling uses the desired capacity as the target capacity for the group. If the request for Spot Instances is unsuccessful, it keeps trying. 

If your Auto Scaling instances receive a public IPv4 address and are launched in a VPC that is defined in the same stack template, you must use the [DependsOn attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to declare a dependency on the [VPC-gateway attachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway-attachment.html). 

## Examples
<a name="aws-resource-autoscaling-launchconfiguration--examples"></a>

The following examples create launch configurations that can be used by an Auto Scaling group to configure Amazon EC2 instances. 

**Topics**
+ [Amazon EBS-backed AMI and defined block device mappings](#aws-resource-autoscaling-launchconfiguration--examples--Amazon_EBS-backed_AMI_and_defined_block_device_mappings)
+ [Instance store-backed AMI with Spot price and IAM role](#aws-resource-autoscaling-launchconfiguration--examples--Instance_store-backed_AMI_with_Spot_price_and_IAM_role)
+ [Provisioned IOPS EBS-optimized volume with key-pair name and user data](#aws-resource-autoscaling-launchconfiguration--examples--Provisioned_IOPS_EBS-optimized_volume_with_key-pair_name_and_user_data)

### Amazon EBS-backed AMI and defined block device mappings
<a name="aws-resource-autoscaling-launchconfiguration--examples--Amazon_EBS-backed_AMI_and_defined_block_device_mappings"></a>

This example shows a launch configuration with a `BlockDeviceMappings` property that lists two devices: a 30 gigabyte EBS root volume mapped to /dev/sda1 and a 100 gigabyte EBS volume mapped to /dev/sdm. The /dev/sdm volume uses the default EBS volume type based on the region and is not deleted when terminating the instance it is attached to. 

CloudFormation supports parameters from the AWS Systems Manager Parameter Store. In this example, the `ImageId` property references the latest Amazon Linux 2 AMI (EBS-backed image) from the Parameter Store. For more information, see [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) in the *AWS Systems Manager User Guide* and the blog post [Query for the latest Amazon Linux AMI IDs using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/) on the AWS Compute Blog.

#### JSON
<a name="aws-resource-autoscaling-launchconfiguration--examples--Amazon_EBS-backed_AMI_and_defined_block_device_mappings--json"></a>

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Parameters": {
    "LatestAmiId": {
      "Description": "Region specific image from the Parameter Store",
      "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
      "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
    },
    "InstanceType": {
      "Description": "Amazon EC2 instance type for the instances",
      "Type": "String",
      "AllowedValues": [
        "t3.micro",
        "t3.small",
        "t3.medium"
      ],
      "Default": "t3.micro"
    }
  },  
  "Resources":{
    "myLaunchConfig":{
      "Type":"AWS::AutoScaling::LaunchConfiguration",
      "Properties":{
        "ImageId":{ "Ref":"LatestAmiId" },
        "SecurityGroups":[ { "Ref":"myEC2SecurityGroup" } ],
        "InstanceType":{ "Ref":"InstanceType" },
        "BlockDeviceMappings":[
          {
            "DeviceName":"/dev/sda1",
            "Ebs":{
              "VolumeSize":"30",
              "VolumeType":"gp3"
            }
          },
          {
            "DeviceName":"/dev/sdm",
            "Ebs":{
              "VolumeSize":"100",
              "DeleteOnTermination":"false"
            }
          }
        ]
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-launchconfiguration--examples--Amazon_EBS-backed_AMI_and_defined_block_device_mappings--yaml"></a>

```
---
AWSTemplateFormatVersion: 2010-09-09
Parameters:
  LatestAmiId:
    Description: Region specific image from the Parameter Store
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
  InstanceType:
    Description: Amazon EC2 instance type for the instances
    Type: String
    AllowedValues:
      - t3.micro
      - t3.small
      - t3.medium
    Default: t3.micro
Resources:
  myLaunchConfig: 
    Type: AWS::AutoScaling::LaunchConfiguration
    Properties:
      ImageId: !Ref LatestAmiId
      SecurityGroups: 
        - !Ref myEC2SecurityGroup
      InstanceType: 
        !Ref InstanceType
      BlockDeviceMappings: 
        - DeviceName: /dev/sda1
          Ebs: 
            VolumeSize: '30'
            VolumeType: gp3
        - DeviceName: /dev/sdm
          Ebs: 
            VolumeSize: '100'
            DeleteOnTermination: false
```

### Instance store-backed AMI with Spot price and IAM role
<a name="aws-resource-autoscaling-launchconfiguration--examples--Instance_store-backed_AMI_with_Spot_price_and_IAM_role"></a>

This example shows a launch configuration that launches Spot Instances in the Auto Scaling group. This launch configuration will only be active if the current Spot price is less than the price in the template specification (0.045). It also demonstrates a launch configuration that uses the `IamInstanceProfile` property. For an example of a full template, including the definition of, and further references from the [InstanceProfile](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html) object referenced here as `RootInstanceProfile`, see [auto\$1scaling\$1with\$1instance\$1profile.template](https://s3.amazonaws.com/cloudformation-templates-us-east-1/auto_scaling_with_instance_profile.template).

In this example, the `ImageId` property references the latest Amazon Linux AMI (instance store/S3-backed image) from the Parameter Store. The BlockDeviceMappings property lists a virtual device `ephemeral0` mapped to /dev/sdc.

#### JSON
<a name="aws-resource-autoscaling-launchconfiguration--examples--Instance_store-backed_AMI_with_Spot_price_and_IAM_role--json"></a>

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Parameters": {
    "LatestAmiId": {
      "Description": "Region specific image from the Parameter Store",
      "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
      "Default": "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-s3"
    }
  },
  "Resources":{
    "myLaunchConfig":{
      "Type":"AWS::AutoScaling::LaunchConfiguration",
      "Properties":{
        "ImageId":{ "Ref":"LatestAmiId" },
        "SecurityGroups":[ { "Ref":"myEC2SecurityGroup" } ],
        "InstanceType":"m3.medium",
        "SpotPrice":"0.045",
        "IamInstanceProfile":{ "Ref":"RootInstanceProfile" },
        "BlockDeviceMappings": [
          {
            "DeviceName": "/dev/sdc",
            "VirtualName": "ephemeral0"
          }
        ]
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-launchconfiguration--examples--Instance_store-backed_AMI_with_Spot_price_and_IAM_role--yaml"></a>

```
---
AWSTemplateFormatVersion: 2010-09-09
Parameters:
  LatestAmiId:
    Description: Region specific image from the Parameter Store
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-s3'
Resources:
  myLaunchConfig: 
    Type: AWS::AutoScaling::LaunchConfiguration
    Properties: 
      ImageId: !Ref LatestAmiId
      SecurityGroups: 
        - !Ref myEC2SecurityGroup
      InstanceType: m3.medium
      SpotPrice: '0.045'
      IamInstanceProfile: !Ref RootInstanceProfile
      BlockDeviceMappings:
      - DeviceName: /dev/sdc
        VirtualName: ephemeral0
```

### Provisioned IOPS EBS-optimized volume with key-pair name and user data
<a name="aws-resource-autoscaling-launchconfiguration--examples--Provisioned_IOPS_EBS-optimized_volume_with_key-pair_name_and_user_data"></a>

This example demonstrates a launch configuration that configures the `EbsOptmized` property to launch instances with a provisioned IOPS EBS-optimized volume. This can increase the performance of your EBS-backed instances.

**Note**  
For instances that are not EBS–optimized by default, you must enable EBS optimization to achieve the level of performance described in the [Amazon EBS-optimized instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) documentation in the *Amazon Elastic Compute Cloud User Guide*. For current generation instance types, EBS-optimization is enabled by default at no additional cost. Enabling EBS optimization for a previous generation instance type that is not EBS-optimized by default incurs additional fees.

When you use a launch configuration such as this one, your `m1.large` instances will contain optimized EBS root volumes with the provisioned IOPS settings that you specified in the AMI. Because you cannot specify the IOPS settings in a launch configuration, the AMI must be configured with a block device mapping that specifies the desired number of IOPS. The following are key attributes of this EBS-optimized instance configuration:
+ An instance type of `m1.large` or greater. This is required for EBS optimization. This optimization is only available for certain instance types and sizes.
+ An EBS-backed AMI with a volume type of `io1` and the number of IOPS you want to provision for the volume. 
+ The size of the EBS volume must accommodate the IOPS you need. There is a 50:1 ratio between IOPS and Gibibytes (GiB) of storage.

For more information about IOPS performance with provisioned IOPS volumes, see [Provisioned IOPS SSD (`io1` and `io2`) volumes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops) in the *Amazon Elastic Compute Cloud User Guide*.

For more performance tips, see [Amazon EBS volume performance on Linux instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html) in the *Amazon Elastic Compute Cloud User Guide*. 

 

#### JSON
<a name="aws-resource-autoscaling-launchconfiguration--examples--Provisioned_IOPS_EBS-optimized_volume_with_key-pair_name_and_user_data--json"></a>

```
{
  "Resources":{
    "myLaunchConfig":{
      "Type":"AWS::AutoScaling::LaunchConfiguration",
      "Properties":{
        "ImageId":"ami-02354e95b3example",
        "SecurityGroups":[ { "Ref":"myEC2SecurityGroup" }, "myExistingEC2SecurityGroup" ],
        "InstanceType":"m1.large",
        "UserData": {"Fn::Base64": {"Fn::Join": ["", [
          "#!/bin/bash -x\n",
          "/opt/aws/bin/cfn-signal -e $? --stack ", {"Ref": "AWS::StackName"}, " --resource myASG ", " --region ", {"Ref": "AWS::Region"}, "\n"
        ]]}},
        "EbsOptimized":"true"
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-launchconfiguration--examples--Provisioned_IOPS_EBS-optimized_volume_with_key-pair_name_and_user_data--yaml"></a>

```
---
Resources:
  myLaunchConfig: 
    Type: AWS::AutoScaling::LaunchConfiguration
    Properties: 
      ImageId: ami-02354e95b3example
      SecurityGroups: 
        - !Ref myEC2SecurityGroup
        - myExistingEC2SecurityGroup
      InstanceType: m1.large
      UserData: !Base64 |
        #!/bin/bash -x
        yum install -y aws-cfn-bootstrap
        /opt/aws/bin/cfn-signal -e $? --stack !Ref 'AWS::StackName' --resource myASG --region !Ref 'AWS::Region'
      EbsOptimized: true
```

## See also
<a name="aws-resource-autoscaling-launchconfiguration--seealso"></a>
+ You can find additional useful snippets in the following sections of the *AWS CloudFormation User Guide*:
  + For examples of Auto Scaling groups, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).
  + For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).
+ [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide*
+ [CreateLaunchConfiguration](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateLaunchConfiguration.html) in the *Amazon EC2 Auto Scaling API Reference*



# AWS::AutoScaling::LaunchConfiguration BlockDevice
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice"></a>

`BlockDevice` is a property of the `EBS` property of the [AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html) property type that describes an Amazon EBS volume.

## Syntax
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice-syntax.json"></a>

```
{
  "[DeleteOnTermination](#cfn-autoscaling-launchconfiguration-blockdevice-deleteontermination)" : Boolean,
  "[Encrypted](#cfn-autoscaling-launchconfiguration-blockdevice-encrypted)" : Boolean,
  "[Iops](#cfn-autoscaling-launchconfiguration-blockdevice-iops)" : Integer,
  "[SnapshotId](#cfn-autoscaling-launchconfiguration-blockdevice-snapshotid)" : String,
  "[Throughput](#cfn-autoscaling-launchconfiguration-blockdevice-throughput)" : Integer,
  "[VolumeSize](#cfn-autoscaling-launchconfiguration-blockdevice-volumesize)" : Integer,
  "[VolumeType](#cfn-autoscaling-launchconfiguration-blockdevice-volumetype)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice-syntax.yaml"></a>

```
  [DeleteOnTermination](#cfn-autoscaling-launchconfiguration-blockdevice-deleteontermination): Boolean
  [Encrypted](#cfn-autoscaling-launchconfiguration-blockdevice-encrypted): Boolean
  [Iops](#cfn-autoscaling-launchconfiguration-blockdevice-iops): Integer
  [SnapshotId](#cfn-autoscaling-launchconfiguration-blockdevice-snapshotid): String
  [Throughput](#cfn-autoscaling-launchconfiguration-blockdevice-throughput): Integer
  [VolumeSize](#cfn-autoscaling-launchconfiguration-blockdevice-volumesize): Integer
  [VolumeType](#cfn-autoscaling-launchconfiguration-blockdevice-volumetype): String
```

## Properties
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice-properties"></a>

`DeleteOnTermination`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-deleteontermination"></a>
Indicates whether the volume is deleted on instance termination. For Amazon EC2 Auto Scaling, the default value is `true`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Encrypted`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-encrypted"></a>
Specifies whether the volume should be encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see [Requirements for Amazon EBS encryption](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html) in the *Amazon EBS User Guide*. If your AMI uses encrypted volumes, you can also only launch it on supported instance types.  
If you are creating a volume from a snapshot, you cannot create an unencrypted volume from an encrypted snapshot. Also, you cannot specify a KMS key ID when using a launch configuration.  
If you enable encryption by default, the EBS volumes that you create are always encrypted, either using the AWS managed KMS key or a customer-managed KMS key, regardless of whether the snapshot was encrypted.   
For more information, see [Use AWS KMS keys to encrypt Amazon EBS volumes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-data-protection.html#encryption) in the *Amazon EC2 Auto Scaling User Guide*.
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Iops`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-iops"></a>
The number of input/output (I/O) operations per second (IOPS) to provision for the volume. For `gp3` and `io1` volumes, this represents the number of IOPS that are provisioned for the volume. For `gp2` volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.   
The following are the supported values for each volume type:   
+ `gp3`: 3,000-16,000 IOPS
+ `io1`: 100-64,000 IOPS
For `io1` volumes, we guarantee 64,000 IOPS only for [Instances built on the Nitro System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). Other instance families guarantee performance up to 32,000 IOPS.   
`Iops` is supported when the volume type is `gp3` or `io1` and required only when the volume type is `io1`. (Not used with `standard`, `gp2`, `st1`, or `sc1` volumes.)   
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SnapshotId`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-snapshotid"></a>
The snapshot ID of the volume to use.  
You must specify either a `VolumeSize` or a `SnapshotId`.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Throughput`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-throughput"></a>
The throughput (MiBps) to provision for a `gp3` volume.  
*Required*: No  
*Type*: Integer  
*Minimum*: `125`  
*Maximum*: `1000`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`VolumeSize`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-volumesize"></a>
The volume size, in GiBs. The following are the supported volumes sizes for each volume type:   
+ `gp2` and `gp3`: 1-16,384
+ `io1`: 4-16,384
+ `st1` and `sc1`: 125-16,384
+ `standard`: 1-1,024
You must specify either a `SnapshotId` or a `VolumeSize`. If you specify both `SnapshotId` and `VolumeSize`, the volume size must be equal or greater than the size of the snapshot.  
*Required*: Conditional  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `16384`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`VolumeType`  <a name="cfn-autoscaling-launchconfiguration-blockdevice-volumetype"></a>
The volume type. For more information, see [Amazon EBS volume types](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html) in the *Amazon EBS User Guide*.  
Valid values: `standard` \$1 `io1` \$1 `gp2` \$1 `st1` \$1 `sc1` \$1 `gp3`  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## See also
<a name="aws-properties-autoscaling-launchconfiguration-blockdevice--seealso"></a>
+ [Required KMS key policy for use with encrypted volumes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html) in the *Amazon EC2 Auto Scaling User Guide*
+ [Use encryption with EBS-backed AMIs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html) in the *Amazon EC2 User Guide for Linux Instances*



# AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping"></a>

`BlockDeviceMapping` specifies a block device mapping for the `BlockDeviceMappings` property of the [AWS::AutoScaling::LaunchConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-launchconfiguration.html) resource.

Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched. 

For more information, see [Example block device mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#block-device-mapping-ex) in the *Amazon EC2 User Guide for Linux Instances*.

## Syntax
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping-syntax.json"></a>

```
{
  "[DeviceName](#cfn-autoscaling-launchconfiguration-blockdevicemapping-devicename)" : String,
  "[Ebs](#cfn-autoscaling-launchconfiguration-blockdevicemapping-ebs)" : BlockDevice,
  "[NoDevice](#cfn-autoscaling-launchconfiguration-blockdevicemapping-nodevice)" : Boolean,
  "[VirtualName](#cfn-autoscaling-launchconfiguration-blockdevicemapping-virtualname)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping-syntax.yaml"></a>

```
  [DeviceName](#cfn-autoscaling-launchconfiguration-blockdevicemapping-devicename): String
  [Ebs](#cfn-autoscaling-launchconfiguration-blockdevicemapping-ebs): 
    BlockDevice
  [NoDevice](#cfn-autoscaling-launchconfiguration-blockdevicemapping-nodevice): Boolean
  [VirtualName](#cfn-autoscaling-launchconfiguration-blockdevicemapping-virtualname): String
```

## Properties
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping-properties"></a>

`DeviceName`  <a name="cfn-autoscaling-launchconfiguration-blockdevicemapping-devicename"></a>
The device name assigned to the volume (for example, `/dev/sdh` or `xvdh`). For more information, see [Device naming on Linux instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html) in the *Amazon EC2 User Guide*.  
To define a block device mapping, set the device name and exactly one of the following properties: `Ebs`, `NoDevice`, or `VirtualName`.
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Ebs`  <a name="cfn-autoscaling-launchconfiguration-blockdevicemapping-ebs"></a>
Information to attach an EBS volume to an instance at launch.  
*Required*: No  
*Type*: [BlockDevice](aws-properties-autoscaling-launchconfiguration-blockdevice.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`NoDevice`  <a name="cfn-autoscaling-launchconfiguration-blockdevicemapping-nodevice"></a>
Setting this value to `true` prevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch.  
If `NoDevice` is `true` for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`VirtualName`  <a name="cfn-autoscaling-launchconfiguration-blockdevicemapping-virtualname"></a>
The name of the instance store volume (virtual device) to attach to an instance at launch. The name must be in the form ephemeral*X* where *X* is a number starting from zero (0), for example, `ephemeral0`.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## See also
<a name="aws-properties-autoscaling-launchconfiguration-blockdevicemapping--seealso"></a>
+ [Amazon EC2 instance store](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the *Amazon EC2 User Guide for Linux Instances*
+ [Amazon Elastic Block Store (Amazon EBS)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) in the *Amazon EC2 User Guide for Linux Instances*



# AWS::AutoScaling::LaunchConfiguration MetadataOptions
<a name="aws-properties-autoscaling-launchconfiguration-metadataoptions"></a>

`MetadataOptions` is a property of [AWS::AutoScaling::LaunchConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-launchconfiguration.html) that describes metadata options for the instances.

For more information, see [Configure the instance metadata options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-config.html#launch-configurations-imds) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-launchconfiguration-metadataoptions-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-launchconfiguration-metadataoptions-syntax.json"></a>

```
{
  "[HttpEndpoint](#cfn-autoscaling-launchconfiguration-metadataoptions-httpendpoint)" : String,
  "[HttpPutResponseHopLimit](#cfn-autoscaling-launchconfiguration-metadataoptions-httpputresponsehoplimit)" : Integer,
  "[HttpTokens](#cfn-autoscaling-launchconfiguration-metadataoptions-httptokens)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-launchconfiguration-metadataoptions-syntax.yaml"></a>

```
  [HttpEndpoint](#cfn-autoscaling-launchconfiguration-metadataoptions-httpendpoint): String
  [HttpPutResponseHopLimit](#cfn-autoscaling-launchconfiguration-metadataoptions-httpputresponsehoplimit): Integer
  [HttpTokens](#cfn-autoscaling-launchconfiguration-metadataoptions-httptokens): String
```

## Properties
<a name="aws-properties-autoscaling-launchconfiguration-metadataoptions-properties"></a>

`HttpEndpoint`  <a name="cfn-autoscaling-launchconfiguration-metadataoptions-httpendpoint"></a>
This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is `enabled`.  
If you specify a value of `disabled`, you will not be able to access your instance metadata. 
*Required*: No  
*Type*: String  
*Allowed values*: `disabled | enabled`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`HttpPutResponseHopLimit`  <a name="cfn-autoscaling-launchconfiguration-metadataoptions-httpputresponsehoplimit"></a>
The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.  
Default: 1  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`HttpTokens`  <a name="cfn-autoscaling-launchconfiguration-metadataoptions-httptokens"></a>
The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is `optional`.  
If the state is `optional`, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.  
If the state is `required`, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.  
*Required*: No  
*Type*: String  
*Allowed values*: `optional | required`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::AutoScaling::LifecycleHook
<a name="aws-resource-autoscaling-lifecyclehook"></a>

The `AWS::AutoScaling::LifecycleHook` resource specifies lifecycle hooks for an Auto Scaling group. These hooks let you create solutions that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to wait for the action to complete before the instance transitions to the next state. 

Use lifecycle hooks to prepare new instances for use or to delay them from being registered behind a load balancer before their configuration has been applied completely. You can also use lifecycle hooks to prepare running instances to be terminated by, for example, downloading logs or other data. 

For more information, see [Amazon EC2 Auto Scaling lifecycle hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-resource-autoscaling-lifecyclehook-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-lifecyclehook-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::LifecycleHook",
  "Properties" : {
      "[AutoScalingGroupName](#cfn-autoscaling-lifecyclehook-autoscalinggroupname)" : String,
      "[DefaultResult](#cfn-autoscaling-lifecyclehook-defaultresult)" : String,
      "[HeartbeatTimeout](#cfn-autoscaling-lifecyclehook-heartbeattimeout)" : Integer,
      "[LifecycleHookName](#cfn-autoscaling-lifecyclehook-lifecyclehookname)" : String,
      "[LifecycleTransition](#cfn-autoscaling-lifecyclehook-lifecycletransition)" : String,
      "[NotificationMetadata](#cfn-autoscaling-lifecyclehook-notificationmetadata)" : String,
      "[NotificationTargetARN](#cfn-autoscaling-lifecyclehook-notificationtargetarn)" : String,
      "[RoleARN](#cfn-autoscaling-lifecyclehook-rolearn)" : String
    }
}
```

### YAML
<a name="aws-resource-autoscaling-lifecyclehook-syntax.yaml"></a>

```
Type: AWS::AutoScaling::LifecycleHook
Properties:
  [AutoScalingGroupName](#cfn-autoscaling-lifecyclehook-autoscalinggroupname): String
  [DefaultResult](#cfn-autoscaling-lifecyclehook-defaultresult): String
  [HeartbeatTimeout](#cfn-autoscaling-lifecyclehook-heartbeattimeout): Integer
  [LifecycleHookName](#cfn-autoscaling-lifecyclehook-lifecyclehookname): String
  [LifecycleTransition](#cfn-autoscaling-lifecyclehook-lifecycletransition): String
  [NotificationMetadata](#cfn-autoscaling-lifecyclehook-notificationmetadata): String
  [NotificationTargetARN](#cfn-autoscaling-lifecyclehook-notificationtargetarn): String
  [RoleARN](#cfn-autoscaling-lifecyclehook-rolearn): String
```

## Properties
<a name="aws-resource-autoscaling-lifecyclehook-properties"></a>

`AutoScalingGroupName`  <a name="cfn-autoscaling-lifecyclehook-autoscalinggroupname"></a>
The name of the Auto Scaling group.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`DefaultResult`  <a name="cfn-autoscaling-lifecyclehook-defaultresult"></a>
The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is `ABANDON`.  
Valid values: `CONTINUE` \$1 `ABANDON`  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HeartbeatTimeout`  <a name="cfn-autoscaling-lifecyclehook-heartbeattimeout"></a>
The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from `30` to `7200` seconds. The default value is `3600` seconds (1 hour).  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LifecycleHookName`  <a name="cfn-autoscaling-lifecyclehook-lifecyclehookname"></a>
The name of the lifecycle hook.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`LifecycleTransition`  <a name="cfn-autoscaling-lifecyclehook-lifecycletransition"></a>
The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.  
+ To create a lifecycle hook for scale-out events, specify `autoscaling:EC2_INSTANCE_LAUNCHING`.
+ To create a lifecycle hook for scale-in events, specify `autoscaling:EC2_INSTANCE_TERMINATING`.
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationMetadata`  <a name="cfn-autoscaling-lifecyclehook-notificationmetadata"></a>
Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1023`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationTargetARN`  <a name="cfn-autoscaling-lifecyclehook-notificationtargetarn"></a>
The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleARN`  <a name="cfn-autoscaling-lifecyclehook-rolearn"></a>
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see [Prepare to add a lifecycle hook to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-autoscaling-lifecyclehook-return-values"></a>

### Ref
<a name="aws-resource-autoscaling-lifecyclehook-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name. For example: `mylifecyclehook`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

## Examples
<a name="aws-resource-autoscaling-lifecyclehook--examples"></a>

The following examples specify lifecycle hooks. 

For other examples of lifecycle hooks, see our [GitHub repository](https://github.com/aws-samples/amazon-ec2-auto-scaling-group-examples). Included are examples of lifecycle hooks that work with warm pools.

**Topics**
+ [Lifecycle hook for instance launch](#aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_launch)
+ [Lifecycle hook for instance termination](#aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_termination)
+ [Lifecycle hook that specifies a notification target ARN and role ARN](#aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_that_specifies_a_notification_target_ARN_and_role_ARN)

### Lifecycle hook for instance launch
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_launch"></a>

The following example creates a launch template, an Auto Scaling group, and a lifecycle hook that supports a custom action on your instances at launch. When you create a launch template, you can include user data to perform configuration tasks and run scripts when an instance launches. By doing so, you do not need to configure a notification target. In this example, the hook keeps each instance in a wait state for 60 seconds to give the user data script time to complete before the instance enters the `InService` state. 

The example bash script in the user data customizes the hostname on instances to include the launch template name and the instance ID. The script gets the ID of the instance from the instance metadata. For more information, see [Retrieve instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html) in the *Amazon EC2 User Guide for Linux Instances*.

#### JSON
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_launch--json"></a>

```
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Parameters": {
        "LatestAmiId": {
            "Description": "Region specific image from the Parameter Store",
            "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
            "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
        },
        "InstanceType": {
            "Description": "Amazon EC2 instance type for the instances",
            "Type": "String",
            "AllowedValues": [
                "t3.micro",
                "t3.small",
                "t3.medium"
            ],
            "Default": "t3.micro"
        },
        "Subnets": {
            "Type": "CommaDelimitedList"
        }
    },
    "Resources": {
        "myAppLaunchTemplate": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "LaunchTemplateName": { "Fn::Sub": "${AWS::StackName}-launch-template" },
                "LaunchTemplateData": {
                    "ImageId": { "Ref": "LatestAmiId" },
                    "InstanceType": { "Ref": "InstanceType" },
                    "KeyName": "MyKeyPair",
                    "SecurityGroupIds": [  "sg-083cd3bfb8example" ],
                    "UserData": {"Fn::Base64": {"Fn::Join": [ "", [
                      "#!/usr/bin/env bash\n",
                      "set -e\n",
                      "export INSTANCE_ID=$(curl -sLf http://169.254.169.254/latest/meta-data/instance-id)", "\n",
                      "export NEW_HOSTNAME=\"${LaunchTemplateName}-$INSTANCE_ID\"", "\n",
                      "hostname $NEW_HOSTNAME", "\n"
                    ]]}}
                }
            }
        },
        "myASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "myAppLaunchTemplate"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "myAppLaunchTemplate",
                            "DefaultVersionNumber"
                        ]
                    }
                },
                "MaxSize": 10,
                "MinSize": 1,
                "VPCZoneIdentifier": {
                    "Ref": "Subnets"
                },
                "LifecycleHookSpecificationList": [
                    {
                        "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING",
                        "LifecycleHookName": "myLaunchLifecycleHook",
                        "DefaultResult": "CONTINUE",
                        "HeartbeatTimeout": 60
                    }
                ]
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_launch--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Parameters:
  LatestAmiId:
    Description: Region specific image from the Parameter Store
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
  InstanceType:
    Description: Amazon EC2 instance type for the instances
    Type: String
    AllowedValues:
      - t3.micro
      - t3.small
      - t3.medium
    Default: t3.micro
  Subnets:
    Type: CommaDelimitedList
Resources:
  myAppLaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties:
      LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
      LaunchTemplateData:
        ImageId: !Ref LatestAmiId
        InstanceType: !Ref InstanceType
        KeyName: MyKeyPair
        SecurityGroupIds:
          - sg-083cd3bfb8example
        UserData:
          Fn::Base64: !Sub |
            #!/usr/bin/env bash
            set -e
            export INSTANCE_ID=$(curl -sLf http://169.254.169.254/latest/meta-data/instance-id)
            export NEW_HOSTNAME="${LaunchTemplateName}-$INSTANCE_ID"
            hostname $NEW_HOSTNAME
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      LaunchTemplate:
        LaunchTemplateId: !Ref myAppLaunchTemplate
        Version: !GetAtt myAppLaunchTemplate.DefaultVersionNumber
      MaxSize: '10'
      MinSize: '1'
      VPCZoneIdentifier: !Ref Subnets
      LifecycleHookSpecificationList:
        - LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
          LifecycleHookName: myLaunchLifecycleHook
          DefaultResult: CONTINUE
          HeartbeatTimeout: '60'
```

### Lifecycle hook for instance termination
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_termination"></a>

The following example specifies a lifecycle hook that supports a custom action at instance termination. It uses the `Ref` intrinsic function to refer to an Auto Scaling group (whose logical name is `myASG`) that is declared elsewhere in the same template. It uses the `NotificationMetadata` property to specify additional information to be sent with the notification, such as the name of the cluster to which the instance belongs.

This snippet does not include the notification target that would need to exist or be created to complete the configuration. For information about creating these resources, see [Configure a notification target for lifecycle notifications](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle-hook-notification-target) in the *Amazon EC2 Auto Scaling User Guide*.

#### JSON
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_termination--json"></a>

```
{
  "myTerminationLifecycleHook":{
    "Type":"AWS::AutoScaling::LifecycleHook",
    "Properties":{
      "AutoScalingGroupName":{
        "Ref":"myASG"
      },
      "LifecycleTransition":"autoscaling:EC2_INSTANCE_TERMINATING",
      "HeartbeatTimeout": 300,
      "DefaultResult": "CONTINUE",
      "NotificationMetadata": "optional metadata"
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_for_instance_termination--yaml"></a>

```
---
myTerminationLifecycleHook: 
  Type: AWS::AutoScaling::LifecycleHook
  Properties: 
    AutoScalingGroupName: !Ref myASG
    LifecycleTransition: autoscaling:EC2_INSTANCE_TERMINATING
    HeartbeatTimeout: '300'
    DefaultResult: CONTINUE
    NotificationMetadata: optional metadata
```

### Lifecycle hook that specifies a notification target ARN and role ARN
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_that_specifies_a_notification_target_ARN_and_role_ARN"></a>

The following example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance launch. This example snippet uses the `NotificationTargetARN` and `RoleARN` properties to specify the Amazon SQS queue and IAM role to use to receive notification when a lifecycle action occurs.

This snippet does not include the Amazon SQS queue and IAM role resources that would need to exist or be created to complete the configuration. For information about creating these resources, see [Configure a notification target for lifecycle notifications](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle-hook-notification-target) in the *Amazon EC2 Auto Scaling User Guide*.

#### JSON
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_that_specifies_a_notification_target_ARN_and_role_ARN--json"></a>

```
{
  "AWSTemplateFormatVersion":"2010-09-09",
  "Parameters":{
    "Subnets":{
      "Type":"CommaDelimitedList"
    }
  },
  "Resources":{
    "myASG":{
      "Type":"AWS::AutoScaling::AutoScalingGroup",
      "Properties":{
        "MaxSize":"3",
        "MinSize":"1",
        "LaunchTemplate": {
          "LaunchTemplateId": {
            "Ref":"myLaunchTemplate"
          },
          "Version":{
            "Ref":"myLaunchTemplateVersionNumber"
          }
        },
        "VPCZoneIdentifier":{
          "Ref":"Subnets"
        },
        "LifecycleHookSpecificationList":[
          {
            "LifecycleTransition":"autoscaling:EC2_INSTANCE_LAUNCHING",
            "LifecycleHookName":"myLaunchLifecycleHook",
            "HeartbeatTimeout":4800,
            "NotificationTargetARN":{
              "Fn::GetAtt":[
                "SQS",
                "Arn"
              ]
            },
            "RoleArn":{
              "Fn::Join":[
                ":",
                [
                  "arn:aws:iam:",
                  {
                    "Ref":"AWS::AccountId"
                  },
                  "role/role-name"
                ]
              ]
            }
          }
        ]
      }
    },
    "SQS":{
      "Type":"AWS::SQS::Queue"
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-lifecyclehook--examples--Lifecycle_hook_that_specifies_a_notification_target_ARN_and_role_ARN--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Parameters:
  Subnets:
    Type: CommaDelimitedList
Resources:
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      MaxSize: '3'
      MinSize: '1'
      LaunchTemplate:
        LaunchTemplateId: !Ref myLaunchTemplate
        Version: !Ref myLaunchTemplateVersionNumber
      VPCZoneIdentifier: !Ref Subnets
      LifecycleHookSpecificationList:
        - LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
          LifecycleHookName: myLaunchLifecycleHook
          HeartbeatTimeout: '4800'
          NotificationTargetARN: !GetAtt SQS.Arn
          RoleARN: !Join 
            - ':'
            - - 'arn:aws:iam:'
              - !Ref 'AWS::AccountId'
              - role/role-name
  SQS:
    Type: AWS::SQS::Queue
```

## See also
<a name="aws-resource-autoscaling-lifecyclehook--seealso"></a>
+ You can find additional useful snippets in the following sections of the *AWS CloudFormation User Guide*:
  + For examples of Auto Scaling groups, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).
  + For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).
+ [PutLifecycleHook](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PutLifecycleHook.html) in the *Amazon EC2 Auto Scaling API Reference*

# AWS::AutoScaling::ScalingPolicy
<a name="aws-resource-autoscaling-scalingpolicy"></a>

The `AWS::AutoScaling::ScalingPolicy` resource specifies an Amazon EC2 Auto Scaling scaling policy so that the Auto Scaling group can scale the number of instances available for your application.

For more information about using scaling policies to scale your Auto Scaling group automatically, see [Dynamic scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) and [Predictive scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-resource-autoscaling-scalingpolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-scalingpolicy-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::ScalingPolicy",
  "Properties" : {
      "[AdjustmentType](#cfn-autoscaling-scalingpolicy-adjustmenttype)" : String,
      "[AutoScalingGroupName](#cfn-autoscaling-scalingpolicy-autoscalinggroupname)" : String,
      "[Cooldown](#cfn-autoscaling-scalingpolicy-cooldown)" : String,
      "[EstimatedInstanceWarmup](#cfn-autoscaling-scalingpolicy-estimatedinstancewarmup)" : Integer,
      "[MetricAggregationType](#cfn-autoscaling-scalingpolicy-metricaggregationtype)" : String,
      "[MinAdjustmentMagnitude](#cfn-autoscaling-scalingpolicy-minadjustmentmagnitude)" : Integer,
      "[PolicyType](#cfn-autoscaling-scalingpolicy-policytype)" : String,
      "[PredictiveScalingConfiguration](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration)" : PredictiveScalingConfiguration,
      "[ScalingAdjustment](#cfn-autoscaling-scalingpolicy-scalingadjustment)" : Integer,
      "[StepAdjustments](#cfn-autoscaling-scalingpolicy-stepadjustments)" : [ StepAdjustment, ... ],
      "[TargetTrackingConfiguration](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration)" : TargetTrackingConfiguration
    }
}
```

### YAML
<a name="aws-resource-autoscaling-scalingpolicy-syntax.yaml"></a>

```
Type: AWS::AutoScaling::ScalingPolicy
Properties:
  [AdjustmentType](#cfn-autoscaling-scalingpolicy-adjustmenttype): String
  [AutoScalingGroupName](#cfn-autoscaling-scalingpolicy-autoscalinggroupname): String
  [Cooldown](#cfn-autoscaling-scalingpolicy-cooldown): String
  [EstimatedInstanceWarmup](#cfn-autoscaling-scalingpolicy-estimatedinstancewarmup): Integer
  [MetricAggregationType](#cfn-autoscaling-scalingpolicy-metricaggregationtype): String
  [MinAdjustmentMagnitude](#cfn-autoscaling-scalingpolicy-minadjustmentmagnitude): Integer
  [PolicyType](#cfn-autoscaling-scalingpolicy-policytype): String
  [PredictiveScalingConfiguration](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration): 
    PredictiveScalingConfiguration
  [ScalingAdjustment](#cfn-autoscaling-scalingpolicy-scalingadjustment): Integer
  [StepAdjustments](#cfn-autoscaling-scalingpolicy-stepadjustments): 
    - StepAdjustment
  [TargetTrackingConfiguration](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration): 
    TargetTrackingConfiguration
```

## Properties
<a name="aws-resource-autoscaling-scalingpolicy-properties"></a>

`AdjustmentType`  <a name="cfn-autoscaling-scalingpolicy-adjustmenttype"></a>
Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are `ChangeInCapacity`, `ExactCapacity`, and `PercentChangeInCapacity`.  
Required if the policy type is `StepScaling` or `SimpleScaling`. For more information, see [Scaling adjustment types](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) in the *Amazon EC2 Auto Scaling User Guide*.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AutoScalingGroupName`  <a name="cfn-autoscaling-scalingpolicy-autoscalinggroupname"></a>
The name of the Auto Scaling group.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Cooldown`  <a name="cfn-autoscaling-scalingpolicy-cooldown"></a>
A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.  
Valid only if the policy type is `SimpleScaling`. For more information, see [Scaling cooldowns for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scaling-cooldowns.html) in the *Amazon EC2 Auto Scaling User Guide*.  
Default: None  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EstimatedInstanceWarmup`  <a name="cfn-autoscaling-scalingpolicy-estimatedinstancewarmup"></a>
 *Not needed if the default instance warmup is defined for the group.*   
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.  
Valid only if the policy type is `TargetTrackingScaling` or `StepScaling`.  
The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then `EstimatedInstanceWarmup` falls back to the value of default cooldown.
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricAggregationType`  <a name="cfn-autoscaling-scalingpolicy-metricaggregationtype"></a>
The aggregation type for the CloudWatch metrics. The valid values are `Minimum`, `Maximum`, and `Average`. If the aggregation type is null, the value is treated as `Average`.  
Valid only if the policy type is `StepScaling`.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinAdjustmentMagnitude`  <a name="cfn-autoscaling-scalingpolicy-minadjustmentmagnitude"></a>
The minimum value to scale by when the adjustment type is `PercentChangeInCapacity`. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a `MinAdjustmentMagnitude` of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a `MinAdjustmentMagnitude` of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.  
Valid only if the policy type is `StepScaling` or `SimpleScaling`. For more information, see [Scaling adjustment types](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) in the *Amazon EC2 Auto Scaling User Guide*.  
Some Auto Scaling groups use instance weights. In this case, set the `MinAdjustmentMagnitude` to a value that is at least as large as your largest instance weight.
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PolicyType`  <a name="cfn-autoscaling-scalingpolicy-policytype"></a>
One of the following policy types:   
+  `TargetTrackingScaling` 
+  `StepScaling` 
+ `SimpleScaling` (default)
+  `PredictiveScaling` 
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PredictiveScalingConfiguration`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration"></a>
A predictive scaling policy. Provides support for predefined and custom metrics.  
Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.  
Required if the policy type is `PredictiveScaling`.  
*Required*: Conditional  
*Type*: [PredictiveScalingConfiguration](aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ScalingAdjustment`  <a name="cfn-autoscaling-scalingpolicy-scalingadjustment"></a>
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.  
Required if the policy type is `SimpleScaling`. (Not used with any other policy type.)   
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StepAdjustments`  <a name="cfn-autoscaling-scalingpolicy-stepadjustments"></a>
A set of adjustments that enable you to scale based on the size of the alarm breach.  
Required if the policy type is `StepScaling`. (Not used with any other policy type.)   
*Required*: Conditional  
*Type*: Array of [StepAdjustment](aws-properties-autoscaling-scalingpolicy-stepadjustment.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TargetTrackingConfiguration`  <a name="cfn-autoscaling-scalingpolicy-targettrackingconfiguration"></a>
A target tracking scaling policy. Provides support for predefined or custom metrics.  
The following predefined metrics are available:  
+  `ASGAverageCPUUtilization` 
+  `ASGAverageNetworkIn` 
+  `ASGAverageNetworkOut` 
+  `ALBRequestCountPerTarget` 
If you specify `ALBRequestCountPerTarget` for the metric, you must specify the `ResourceLabel` property with the `PredefinedMetricSpecification`.  
Required if the policy type is `TargetTrackingScaling`.  
*Required*: Conditional  
*Type*: [TargetTrackingConfiguration](aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-autoscaling-scalingpolicy-return-values"></a>

### Ref
<a name="aws-resource-autoscaling-scalingpolicy-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the policy Amazon Resource Name (ARN). For example: `arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:ab12c4d5-a1b2-a1b2-a1b2-ab12c4d56789:autoScalingGroupName/myStack-AutoScalingGroup-AB12C4D5E6:policyName/myStack-myScalingPolicy-AB12C4D5E6`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-autoscaling-scalingpolicy-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-autoscaling-scalingpolicy-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the ARN of a scaling policy.

`PolicyName`  <a name="PolicyName-fn::getatt"></a>
Returns the name of a scaling policy.

## Remarks
<a name="aws-resource-autoscaling-scalingpolicy--remarks"></a>

When you create the [AWS::CloudWatch::Alarm](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html) resource for a step or simple scaling policy, specify the name of the scaling policy in the `AlarmActions` property. For an example snippet, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).

## Examples
<a name="aws-resource-autoscaling-scalingpolicy--examples"></a>

The following examples specify scaling policies for an Auto Scaling group.

**Topics**
+ [Predictive scaling policy](#aws-resource-autoscaling-scalingpolicy--examples--Predictive_scaling_policy)
+ [Target tracking scaling policy](#aws-resource-autoscaling-scalingpolicy--examples--Target_tracking_scaling_policy)
+ [Step scaling policy](#aws-resource-autoscaling-scalingpolicy--examples--Step_scaling_policy)
+ [Simple scaling policy](#aws-resource-autoscaling-scalingpolicy--examples--Simple_scaling_policy)

### Predictive scaling policy
<a name="aws-resource-autoscaling-scalingpolicy--examples--Predictive_scaling_policy"></a>

The following template snippet shows a predictive scaling policy configuration that uses CPU utilization metrics with a target utilization of 70. Because `ForecastOnly` mode is specified, Amazon EC2 Auto Scaling generates forecasts with traffic predictions for the two days ahead, but does not actively scale the group. 

#### JSON
<a name="aws-resource-autoscaling-scalingpolicy--examples--Predictive_scaling_policy--json"></a>

```
{
  "AWSTemplateFormatVersion":"2010-09-09",
  "Resources":{
    "myPredictiveScalingPolicy":{
      "Type":"AWS::AutoScaling::ScalingPolicy",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "PolicyType":"PredictiveScaling",
        "PredictiveScalingConfiguration":{
          "MetricSpecifications":[
            {
              "TargetValue":70,
              "PredefinedMetricPairSpecification":{
                "PredefinedMetricType":"ASGCPUUtilization"
              }
            }
          ],
          "Mode":"ForecastOnly"
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scalingpolicy--examples--Predictive_scaling_policy--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  myPredictiveScalingPolicy:
    Type: 'AWS::AutoScaling::ScalingPolicy'
    Properties:
      AutoScalingGroupName: !Ref myASG
      PolicyType: PredictiveScaling
      PredictiveScalingConfiguration:
        MetricSpecifications:
          - TargetValue: '70'
            PredefinedMetricPairSpecification:
              PredefinedMetricType: ASGCPUUtilization
        Mode: ForecastOnly
```

### Target tracking scaling policy
<a name="aws-resource-autoscaling-scalingpolicy--examples--Target_tracking_scaling_policy"></a>

The following example creates an Auto Scaling group with two target tracking scaling policies based on the `ASGAverageCPUUtilization` and `ALBRequestCountPerTarget` metrics. The properties of each of these policies include a `TargetValue` property that references a [parameter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html) value from the same template.

Because `Monitoring` is enabled in the launch template, EC2 metric data will be available at 1-minute intervals (known as detailed monitoring) through CloudWatch.

The `DefaultInstanceWarmup` property is set to 30 seconds, to represent the amount of time that it takes for resource consumption to become stable after an instance reaches the `InService` state. For more information, see [Set the default instance warmup for an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) in the *Amazon EC2 Auto Scaling User Guide*.

To create a scaling policy for the `ALBRequestCountPerTarget` metric and the load balancer in the same stack template, you must use the [DependsOn attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to declare a dependency on the `AWS::ElasticLoadBalancingV2::Listener` resource. 

#### JSON
<a name="aws-resource-autoscaling-scalingpolicy--examples--Target_tracking_scaling_policy--json"></a>

```
{
  "AWSTemplateFormatVersion":"2010-09-09",
  "Parameters":{
    "AmiId":{
      "Type":"String"
    },
    "Subnets":{
      "Type": "List<AWS::EC2::Subnet::Id>",
      "Description": "At least two public subnets in different Availability Zones in the selected VPC"
    },
    "VPC":{
      "Type": "AWS::EC2::VPC::Id",
      "Description": "A VPC that allows the load balancer access to the Internet"
    },
    "InstanceSecurityGroup":{
      "Type": "List<AWS::EC2::SecurityGroup::Id>",
      "Description": "A security group in the selected VPC that allows HTTP access on the inbound port"
    },
    "CPUPolicyTargetValue":{
      "Type":"String",
      "Description": "The target utilization for the CPU metric"
    },
    "ALBRequestCountTargetValue":{
      "Type":"String",
      "Description": "The optimal average request count per instance during any one-minute interval"
    }
  },
  "Resources":{
    "myLoadBalancer":{
      "Type":"AWS::ElasticLoadBalancingV2::LoadBalancer",
      "Properties":{
        "Subnets":{
          "Ref":"Subnets"
        }
      }
    },
    "myLoadBalancerListener":{
      "Type":"AWS::ElasticLoadBalancingV2::Listener",
      "Properties":{
        "DefaultActions":[
          {
            "TargetGroupArn":{
              "Ref":"myTargetGroup"
            },
            "Type":"forward"
          }
        ],
        "LoadBalancerArn":{
          "Ref":"myLoadBalancer"
        },
        "Port":80,
        "Protocol":"HTTP"
      }
    },
    "myTargetGroup":{
      "Type":"AWS::ElasticLoadBalancingV2::TargetGroup",
      "Properties":{
        "Name":"myTargetGroup",
        "Port":80,
        "Protocol":"HTTP",
        "VpcId":{
          "Ref":"VPC"
        }
      }
    },
    "myLaunchTemplate": {
      "Type": "AWS::EC2::LaunchTemplate",
      "Properties": {
        "LaunchTemplateName": { "Fn::Sub": "${AWS::StackName}-launch-template" },
        "LaunchTemplateData": {
          "ImageId": { "Ref": "AmiId" },
          "InstanceType": "t3.micro",
          "SecurityGroupIds": [ { "Ref":"InstanceSecurityGroup" } ],
          "Monitoring": { "Enabled": true }
        }
      }
    },
    "myASG":{
      "Type":"AWS::AutoScaling::AutoScalingGroup",
      "Properties":{
        "LaunchTemplate": {
          "LaunchTemplateId": { "Ref": "myLaunchTemplate" },
          "Version": { "Fn::GetAtt": [ "myLaunchTemplate", "LatestVersionNumber" ] }
        },      
        "MaxSize":"2",
        "MinSize":"1",
        "DefaultInstanceWarmup": 30,
        "VPCZoneIdentifier": { "Ref":"Subnets" },
        "TargetGroupARNs":[ { "Ref":"myTargetGroup" } ]
      }
    },
    "myCPUPolicy":{
      "Type":"AWS::AutoScaling::ScalingPolicy",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "PolicyType":"TargetTrackingScaling",
        "TargetTrackingConfiguration":{
          "PredefinedMetricSpecification":{
            "PredefinedMetricType":"ASGAverageCPUUtilization"
          },
          "TargetValue":{
            "Ref":"CPUPolicyTargetValue"
          }
        }
      }
    },
    "myALBRequestCountPolicy":{
      "Type":"AWS::AutoScaling::ScalingPolicy",
      "DependsOn" : "myLoadBalancerListener",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "PolicyType":"TargetTrackingScaling",
        "TargetTrackingConfiguration":{
          "PredefinedMetricSpecification":{
            "PredefinedMetricType":"ALBRequestCountPerTarget",
            "ResourceLabel":{
              "Fn::Join":[
                "/",
                [
                  {
                    "Fn::GetAtt":[
                      "myLoadBalancer",
                      "LoadBalancerFullName"
                    ]
                  },
                  {
                    "Fn::GetAtt":[
                      "myTargetGroup",
                      "TargetGroupFullName"
                    ]
                  }
                ]
              ]
            }
          },
          "TargetValue":{
            "Ref":"ALBRequestCountTargetValue"
          }
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scalingpolicy--examples--Target_tracking_scaling_policy--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Parameters:
  AmiId:
    Type: String
  Subnets:
    Type: 'List<AWS::EC2::Subnet::Id>'
    Description: At least two public subnets in different Availability Zones in the selected VPC
  VPC:
    Type: 'AWS::EC2::VPC::Id'
    Description: A VPC that allows the load balancer access to the Internet
  InstanceSecurityGroup:
    Type: 'List<AWS::EC2::SecurityGroup::Id>'
    Description: A security group in the selected VPC that allows HTTP access on the inbound port
  CPUPolicyTargetValue:
    Type: String
    Description: The target utilization for the CPU metric
  ALBRequestCountTargetValue:
    Type: String
    Description: The optimal average request count per instance during any one-minute interval
Resources:
  myLoadBalancer:
    Type: AWS::ElasticLoadBalancingV2::LoadBalancer
    Properties:
      Subnets: !Ref Subnets
  myLoadBalancerListener:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties:
      DefaultActions:
        - TargetGroupArn: !Ref myTargetGroup
          Type: forward
      LoadBalancerArn: !Ref myLoadBalancer
      Port: 80
      Protocol: HTTP
  myTargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      Name: myTargetGroup
      Port: 80
      Protocol: HTTP
      VpcId: !Ref VPC
  myLaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties: 
      LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
      LaunchTemplateData:
        ImageId: !Ref AmiId
        InstanceType: t3.micro
        SecurityGroupIds: 
          - !Ref InstanceSecurityGroup
        Monitoring: 
          Enabled: true
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      LaunchTemplate:
        LaunchTemplateId: !Ref myLaunchTemplate
        Version: !GetAtt myLaunchTemplate.LatestVersionNumber
      MaxSize: '2'
      MinSize: '1'
      DefaultInstanceWarmup: 30
      VPCZoneIdentifier: !Ref Subnets
      TargetGroupARNs:
        - !Ref myTargetGroup
  myCPUPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    Properties:
      AutoScalingGroupName: !Ref myASG
      PolicyType: TargetTrackingScaling
      TargetTrackingConfiguration:
        PredefinedMetricSpecification:
          PredefinedMetricType: ASGAverageCPUUtilization
        TargetValue: !Ref CPUPolicyTargetValue
  myALBRequestCountPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    DependsOn: myLoadBalancerListener
    Properties:
      AutoScalingGroupName: !Ref myASG
      PolicyType: TargetTrackingScaling
      TargetTrackingConfiguration:
        PredefinedMetricSpecification:
          PredefinedMetricType: ALBRequestCountPerTarget
          ResourceLabel: !Join 
            - '/' 
            - - !GetAtt myLoadBalancer.LoadBalancerFullName
              - !GetAtt myTargetGroup.TargetGroupFullName
        TargetValue: !Ref ALBRequestCountTargetValue
```

### Step scaling policy
<a name="aws-resource-autoscaling-scalingpolicy--examples--Step_scaling_policy"></a>

The following example creates a scaling policy with the `StepScaling` policy type and the `ChangeInCapacity` adjustment type. You must also create a CloudWatch alarm that monitors a CloudWatch metric for your Auto Scaling group. You can associate a CloudWatch alarm with only one scaling policy. 

When the associated alarm is triggered, the policy increases the capacity of the Auto Scaling group based on the following step adjustments (assuming a CloudWatch alarm threshold of 70 percent): 
+ Increase capacity by 1 when the value of the metric is greater than or equal to 70 percent but less than 85 percent 
+ Increase capacity by 2 when the value of the metric is greater than or equal to 85 percent but less than 95 percent 
+ Increase capacity by 3 when the value of the metric is greater than or equal to 95 percent 

#### JSON
<a name="aws-resource-autoscaling-scalingpolicy--examples--Step_scaling_policy--json"></a>

```
{
  "Resources":{
    "ASGScalingPolicyHigh":{
      "Type":"AWS::AutoScaling::ScalingPolicy",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "PolicyType":"StepScaling",
        "AdjustmentType":"ChangeInCapacity",
        "MetricAggregationType":"Average",
        "EstimatedInstanceWarmup":60,
        "StepAdjustments":[
          {
            "MetricIntervalLowerBound":0,
            "MetricIntervalUpperBound":15,
            "ScalingAdjustment":1
          },
          {
            "MetricIntervalLowerBound":15,
            "MetricIntervalUpperBound":25,
            "ScalingAdjustment":2
          },
          {
            "MetricIntervalLowerBound":25,
            "ScalingAdjustment":3
          }
        ]
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scalingpolicy--examples--Step_scaling_policy--yaml"></a>

```
---
Resources:
  ASGScalingPolicyHigh: 
    Type: AWS::AutoScaling::ScalingPolicy
    Properties: 
      AutoScalingGroupName: !Ref myASG
      PolicyType: StepScaling
      AdjustmentType: ChangeInCapacity
      MetricAggregationType: Average
      EstimatedInstanceWarmup: '60'
      StepAdjustments: 
        - MetricIntervalLowerBound: '0'
          MetricIntervalUpperBound: '15'
          ScalingAdjustment: '1'
        - MetricIntervalLowerBound: '15'
          MetricIntervalUpperBound: '25'
          ScalingAdjustment: '2'
        - MetricIntervalLowerBound: '25'
          ScalingAdjustment: '3'
```

### Simple scaling policy
<a name="aws-resource-autoscaling-scalingpolicy--examples--Simple_scaling_policy"></a>

The following example creates a scaling policy with the `SimpleScaling` policy type and the `ChangeInCapacity` adjustment type. The policy increases capacity by one when it is triggered. You must also create a CloudWatch alarm that monitors a CloudWatch metric for your Auto Scaling group. You can associate a CloudWatch alarm with only one scaling policy. 

#### JSON
<a name="aws-resource-autoscaling-scalingpolicy--examples--Simple_scaling_policy--json"></a>

```
{
  "Resources":{
    "ASGScalingPolicyHigh":{
      "Type":"AWS::AutoScaling::ScalingPolicy",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "PolicyType":"SimpleScaling",
        "AdjustmentType":"ChangeInCapacity",
        "ScalingAdjustment":1
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scalingpolicy--examples--Simple_scaling_policy--yaml"></a>

```
---
Resources:
  ASGScalingPolicyHigh: 
    Type: AWS::AutoScaling::ScalingPolicy
    Properties: 
      AutoScalingGroupName: !Ref myASG
      PolicyType: SimpleScaling
      AdjustmentType: ChangeInCapacity
      ScalingAdjustment: '1'
```

## See also
<a name="aws-resource-autoscaling-scalingpolicy--seealso"></a>
+ You can find additional useful snippets in the following sections of the *AWS CloudFormation User Guide*:
  + For examples of Auto Scaling groups, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).
  + For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).
+ [PutScalingPolicy](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PutScalingPolicy.html) in the *Amazon EC2 Auto Scaling API Reference*



# AWS::AutoScaling::ScalingPolicy CustomizedMetricSpecification
<a name="aws-properties-autoscaling-scalingpolicy-customizedmetricspecification"></a>

Contains customized metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

To create your customized metric specification:
+ Add values for each required property from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see [Publish Custom Metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) in the *Amazon CloudWatch User Guide*.
+ Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases.

For more information about CloudWatch, see [Amazon CloudWatch Concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html).

`CustomizedMetricSpecification` is a property of the [AWS::AutoScaling::ScalingPolicy TargetTrackingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-customizedmetricspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-customizedmetricspecification-syntax.json"></a>

```
{
  "[Dimensions](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-dimensions)" : [ MetricDimension, ... ],
  "[MetricName](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-metricname)" : String,
  "[Metrics](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-metrics)" : [ TargetTrackingMetricDataQuery, ... ],
  "[Namespace](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-namespace)" : String,
  "[Period](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-period)" : Integer,
  "[Statistic](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-statistic)" : String,
  "[Unit](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-unit)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-customizedmetricspecification-syntax.yaml"></a>

```
  [Dimensions](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-dimensions): 
    - MetricDimension
  [MetricName](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-metricname): String
  [Metrics](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-metrics): 
    - TargetTrackingMetricDataQuery
  [Namespace](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-namespace): String
  [Period](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-period): Integer
  [Statistic](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-statistic): String
  [Unit](#cfn-autoscaling-scalingpolicy-customizedmetricspecification-unit): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-customizedmetricspecification-properties"></a>

`Dimensions`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-dimensions"></a>
The dimensions of the metric.  
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.  
*Required*: No  
*Type*: Array of [MetricDimension](aws-properties-autoscaling-scalingpolicy-metricdimension.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricName`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-metricname"></a>
The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the [Metric](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html) object that is returned by a call to [ListMetrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html).  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Metrics`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-metrics"></a>
The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.  
*Required*: No  
*Type*: Array of [TargetTrackingMetricDataQuery](aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-namespace"></a>
The namespace of the metric.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-period"></a>
 The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see [Create a target tracking policy using high-resolution metrics for faster response](https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html).   
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Statistic`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-statistic"></a>
The statistic of the metric.  
*Required*: No  
*Type*: String  
*Allowed values*: `Average | Minimum | Maximum | SampleCount | Sum`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-autoscaling-scalingpolicy-customizedmetricspecification-unit"></a>
The unit of the metric. For a complete list of the units that CloudWatch supports, see the [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) data type in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy Metric
<a name="aws-properties-autoscaling-scalingpolicy-metric"></a>

Represents a specific metric. 

`Metric` is a property of the [AWS::AutoScaling::ScalingPolicy MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metricstat.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-metric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-metric-syntax.json"></a>

```
{
  "[Dimensions](#cfn-autoscaling-scalingpolicy-metric-dimensions)" : [ MetricDimension, ... ],
  "[MetricName](#cfn-autoscaling-scalingpolicy-metric-metricname)" : String,
  "[Namespace](#cfn-autoscaling-scalingpolicy-metric-namespace)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-metric-syntax.yaml"></a>

```
  [Dimensions](#cfn-autoscaling-scalingpolicy-metric-dimensions): 
    - MetricDimension
  [MetricName](#cfn-autoscaling-scalingpolicy-metric-metricname): String
  [Namespace](#cfn-autoscaling-scalingpolicy-metric-namespace): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-metric-properties"></a>

`Dimensions`  <a name="cfn-autoscaling-scalingpolicy-metric-dimensions"></a>
The dimensions for the metric. For the list of available dimensions, see the AWS documentation available from the table in [AWS services that publish CloudWatch metrics ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html) in the *Amazon CloudWatch User Guide*.   
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.  
*Required*: No  
*Type*: Array of [MetricDimension](aws-properties-autoscaling-scalingpolicy-metricdimension.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricName`  <a name="cfn-autoscaling-scalingpolicy-metric-metricname"></a>
The name of the metric.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-autoscaling-scalingpolicy-metric-namespace"></a>
The namespace of the metric. For more information, see the table in [AWS services that publish CloudWatch metrics ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html) in the *Amazon CloudWatch User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy MetricDataQuery
<a name="aws-properties-autoscaling-scalingpolicy-metricdataquery"></a>

The metric data to return. Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.

`MetricDataQuery` is a property of the following property types:
+  [AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedScalingMetric](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric.html) 
+  [AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedLoadMetric](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric.html) 
+  [AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedCapacityMetric](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric.html) 

Predictive scaling uses the time series data received from CloudWatch to understand how to schedule capacity based on your historical workload patterns. 

You can call for a single metric or perform math expressions on multiple metrics. Any expressions used in a metric specification must eventually return a single time series.

For more information and examples, see [Advanced predictive scaling policy configurations using custom metrics](https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-metricdataquery-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-metricdataquery-syntax.json"></a>

```
{
  "[Expression](#cfn-autoscaling-scalingpolicy-metricdataquery-expression)" : String,
  "[Id](#cfn-autoscaling-scalingpolicy-metricdataquery-id)" : String,
  "[Label](#cfn-autoscaling-scalingpolicy-metricdataquery-label)" : String,
  "[MetricStat](#cfn-autoscaling-scalingpolicy-metricdataquery-metricstat)" : MetricStat,
  "[ReturnData](#cfn-autoscaling-scalingpolicy-metricdataquery-returndata)" : Boolean
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-metricdataquery-syntax.yaml"></a>

```
  [Expression](#cfn-autoscaling-scalingpolicy-metricdataquery-expression): String
  [Id](#cfn-autoscaling-scalingpolicy-metricdataquery-id): String
  [Label](#cfn-autoscaling-scalingpolicy-metricdataquery-label): String
  [MetricStat](#cfn-autoscaling-scalingpolicy-metricdataquery-metricstat): 
    MetricStat
  [ReturnData](#cfn-autoscaling-scalingpolicy-metricdataquery-returndata): Boolean
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-metricdataquery-properties"></a>

`Expression`  <a name="cfn-autoscaling-scalingpolicy-metricdataquery-expression"></a>
The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the `Id` of the other metrics to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions.   
Conditional: Within each `MetricDataQuery` object, you must specify either `Expression` or `MetricStat`, but not both.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `1023`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-autoscaling-scalingpolicy-metricdataquery-id"></a>
A short name that identifies the object's results in the response. This name must be unique among all `MetricDataQuery` objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.   
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Label`  <a name="cfn-autoscaling-scalingpolicy-metricdataquery-label"></a>
A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Maximum*: `2047`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricStat`  <a name="cfn-autoscaling-scalingpolicy-metricdataquery-metricstat"></a>
Information about the metric data to return.  
Conditional: Within each `MetricDataQuery` object, you must specify either `Expression` or `MetricStat`, but not both.  
*Required*: No  
*Type*: [MetricStat](aws-properties-autoscaling-scalingpolicy-metricstat.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReturnData`  <a name="cfn-autoscaling-scalingpolicy-metricdataquery-returndata"></a>
Indicates whether to return the timestamps and raw data values of this metric.   
If you use any math expressions, specify `true` for this value for only the final math expression that the metric specification is based on. You must specify `false` for `ReturnData` for all the other metrics and expressions used in the metric specification.  
If you are only retrieving metrics and not performing any math expressions, do not specify anything for `ReturnData`. This sets it to its default (`true`).  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy MetricDimension
<a name="aws-properties-autoscaling-scalingpolicy-metricdimension"></a>

`MetricDimension` specifies a name/value pair that is part of the identity of a CloudWatch metric for the `Dimensions` property of the [AWS::AutoScaling::ScalingPolicy CustomizedMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-customizedmetricspecification.html) property type. Duplicate dimensions are not allowed. 

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-metricdimension-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-metricdimension-syntax.json"></a>

```
{
  "[Name](#cfn-autoscaling-scalingpolicy-metricdimension-name)" : String,
  "[Value](#cfn-autoscaling-scalingpolicy-metricdimension-value)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-metricdimension-syntax.yaml"></a>

```
  [Name](#cfn-autoscaling-scalingpolicy-metricdimension-name): String
  [Value](#cfn-autoscaling-scalingpolicy-metricdimension-value): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-metricdimension-properties"></a>

`Name`  <a name="cfn-autoscaling-scalingpolicy-metricdimension-name"></a>
The name of the dimension.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-autoscaling-scalingpolicy-metricdimension-value"></a>
The value of the dimension.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy MetricStat
<a name="aws-properties-autoscaling-scalingpolicy-metricstat"></a>

`MetricStat` is a property of the [AWS::AutoScaling::ScalingPolicy MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metricdataquery.html) property type.

This structure defines the CloudWatch metric to return, along with the statistic and unit.

For more information about the CloudWatch terminology below, see [Amazon CloudWatch concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html) in the *Amazon CloudWatch User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-metricstat-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-metricstat-syntax.json"></a>

```
{
  "[Metric](#cfn-autoscaling-scalingpolicy-metricstat-metric)" : Metric,
  "[Stat](#cfn-autoscaling-scalingpolicy-metricstat-stat)" : String,
  "[Unit](#cfn-autoscaling-scalingpolicy-metricstat-unit)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-metricstat-syntax.yaml"></a>

```
  [Metric](#cfn-autoscaling-scalingpolicy-metricstat-metric): 
    Metric
  [Stat](#cfn-autoscaling-scalingpolicy-metricstat-stat): String
  [Unit](#cfn-autoscaling-scalingpolicy-metricstat-unit): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-metricstat-properties"></a>

`Metric`  <a name="cfn-autoscaling-scalingpolicy-metricstat-metric"></a>
The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the [Metric](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html) object that is returned by a call to [ListMetrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html).  
*Required*: Yes  
*Type*: [Metric](aws-properties-autoscaling-scalingpolicy-metric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Stat`  <a name="cfn-autoscaling-scalingpolicy-metricstat-stat"></a>
The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) in the *Amazon CloudWatch User Guide*.  
The most commonly used metrics for predictive scaling are `Average` and `Sum`.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-autoscaling-scalingpolicy-metricstat-unit"></a>
The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) data type in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredefinedMetricSpecification
<a name="aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification"></a>

Contains predefined metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

`PredefinedMetricSpecification` is a property of the [AWS::AutoScaling::ScalingPolicy TargetTrackingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification-syntax.json"></a>

```
{
  "[PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predefinedmetricspecification-predefinedmetrictype)" : String,
  "[ResourceLabel](#cfn-autoscaling-scalingpolicy-predefinedmetricspecification-resourcelabel)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification-syntax.yaml"></a>

```
  [PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predefinedmetricspecification-predefinedmetrictype): String
  [ResourceLabel](#cfn-autoscaling-scalingpolicy-predefinedmetricspecification-resourcelabel): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification-properties"></a>

`PredefinedMetricType`  <a name="cfn-autoscaling-scalingpolicy-predefinedmetricspecification-predefinedmetrictype"></a>
The metric type. The following predefined metrics are available:  
+ `ASGAverageCPUUtilization` - Average CPU utilization of the Auto Scaling group.
+ `ASGAverageNetworkIn` - Average number of bytes received on all network interfaces by the Auto Scaling group.
+ `ASGAverageNetworkOut` - Average number of bytes sent out on all network interfaces by the Auto Scaling group.
+ `ALBRequestCountPerTarget` - Average Application Load Balancer request count per target for your Auto Scaling group.
*Required*: Yes  
*Type*: String  
*Allowed values*: `ASGAverageCPUUtilization | ASGAverageNetworkIn | ASGAverageNetworkOut | ALBRequestCountPerTarget`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceLabel`  <a name="cfn-autoscaling-scalingpolicy-predefinedmetricspecification-resourcelabel"></a>
A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.  
You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:  
`app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff`.  
Where:  
+ app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
+ targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.  
*Required*: Conditional  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `1023`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration"></a>

`PredictiveScalingConfiguration` is a property of the [AWS::AutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html) resource that specifies a predictive scaling policy for Amazon EC2 Auto Scaling. 

For more information, see [Predictive scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) in the *Amazon EC2 Auto Scaling User Guide*. 

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration-syntax.json"></a>

```
{
  "[MaxCapacityBreachBehavior](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybreachbehavior)" : String,
  "[MaxCapacityBuffer](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybuffer)" : Integer,
  "[MetricSpecifications](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-metricspecifications)" : [ PredictiveScalingMetricSpecification, ... ],
  "[Mode](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-mode)" : String,
  "[SchedulingBufferTime](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-schedulingbuffertime)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration-syntax.yaml"></a>

```
  [MaxCapacityBreachBehavior](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybreachbehavior): String
  [MaxCapacityBuffer](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybuffer): Integer
  [MetricSpecifications](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-metricspecifications): 
    - PredictiveScalingMetricSpecification
  [Mode](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-mode): String
  [SchedulingBufferTime](#cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-schedulingbuffertime): Integer
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration-properties"></a>

`MaxCapacityBreachBehavior`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybreachbehavior"></a>
Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity of the Auto Scaling group. Defaults to `HonorMaxCapacity` if not specified.  
The following are possible values:  
+ `HonorMaxCapacity` - Amazon EC2 Auto Scaling can't increase the maximum capacity of the group when the forecast capacity is close to or exceeds the maximum capacity.
+ `IncreaseMaxCapacity` - Amazon EC2 Auto Scaling can increase the maximum capacity of the group when the forecast capacity is close to or exceeds the maximum capacity. The upper limit is determined by the forecasted capacity and the value for `MaxCapacityBuffer`.
Use caution when allowing the maximum capacity to be automatically increased. This can lead to more instances being launched than intended if the increased maximum capacity is not monitored and managed. The increased maximum capacity then becomes the new normal maximum capacity for the Auto Scaling group until you manually update it. The maximum capacity does not automatically decrease back to the original maximum.
*Required*: No  
*Type*: String  
*Allowed values*: `HonorMaxCapacity | IncreaseMaxCapacity`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxCapacityBuffer`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-maxcapacitybuffer"></a>
The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity. The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.  
If set to 0, Amazon EC2 Auto Scaling may scale capacity higher than the maximum capacity to equal but not exceed forecast capacity.   
Required if the `MaxCapacityBreachBehavior` property is set to `IncreaseMaxCapacity`, and cannot be used otherwise.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricSpecifications`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-metricspecifications"></a>
This structure includes the metrics and target utilization to use for predictive scaling.   
This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric.  
*Required*: Yes  
*Type*: Array of [PredictiveScalingMetricSpecification](aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Mode`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-mode"></a>
The predictive scaling mode. Defaults to `ForecastOnly` if not specified.  
*Required*: No  
*Type*: String  
*Allowed values*: `ForecastAndScale | ForecastOnly`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SchedulingBufferTime`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingconfiguration-schedulingbuffertime"></a>
The amount of time, in seconds, by which the instance launch time can be advanced. For example, the forecast says to add capacity at 10:00 AM, and you choose to pre-launch instances by 5 minutes. In that case, the instances will be launched at 9:55 AM. The intention is to give resources time to be provisioned. It can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete.   
The value must be less than the forecast interval duration of 3600 seconds (60 minutes). Defaults to 300 seconds if not specified.   
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedCapacityMetric
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric"></a>

Contains capacity metric information for the `CustomizedCapacityMetricSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-syntax.json"></a>

```
{
  "[MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-metricdataqueries)" : [ MetricDataQuery, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-syntax.yaml"></a>

```
  [MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-metricdataqueries): 
    - MetricDataQuery
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-properties"></a>

`MetricDataQueries`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-metricdataqueries"></a>
One or more metric data queries to provide the data points for a capacity metric. Use multiple metric data queries only if you are performing a math expression on returned data.   
*Required*: Yes  
*Type*: Array of [MetricDataQuery](aws-properties-autoscaling-scalingpolicy-metricdataquery.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedLoadMetric
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric"></a>

Contains load metric information for the `CustomizedLoadMetricSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-syntax.json"></a>

```
{
  "[MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-metricdataqueries)" : [ MetricDataQuery, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-syntax.yaml"></a>

```
  [MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-metricdataqueries): 
    - MetricDataQuery
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-properties"></a>

`MetricDataQueries`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-metricdataqueries"></a>
One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries only if you are performing a math expression on returned data.   
*Required*: Yes  
*Type*: Array of [MetricDataQuery](aws-properties-autoscaling-scalingpolicy-metricdataquery.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingCustomizedScalingMetric
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric"></a>

Contains scaling metric information for the `CustomizedScalingMetricSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-syntax.json"></a>

```
{
  "[MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-metricdataqueries)" : [ MetricDataQuery, ... ]
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-syntax.yaml"></a>

```
  [MetricDataQueries](#cfn-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-metricdataqueries): 
    - MetricDataQuery
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-properties"></a>

`MetricDataQueries`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-metricdataqueries"></a>
One or more metric data queries to provide the data points for a scaling metric. Use multiple metric data queries only if you are performing a math expression on returned data.   
*Required*: Yes  
*Type*: Array of [MetricDataQuery](aws-properties-autoscaling-scalingpolicy-metricdataquery.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification"></a>

A structure that specifies a metric specification for the `MetricSpecifications` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingconfiguration.html) property type.

You must specify either a metric pair, or a load metric and a scaling metric individually. Specifying a metric pair instead of individual metrics provides a simpler way to configure metrics for a scaling policy. You choose the metric pair, and the policy automatically knows the correct sum and average statistics to use for the load metric and the scaling metric.

Example
+ You create a predictive scaling policy and specify `ALBRequestCount` as the value for the metric pair and `1000.0` as the target value. For this type of metric, you must provide the metric dimension for the corresponding target group, so you also provide a resource label for the Application Load Balancer target group that is attached to your Auto Scaling group.
+ The number of requests the target group receives per minute provides the load metric, and the request count averaged between the members of the target group provides the scaling metric. In CloudWatch, this refers to the `RequestCount` and `RequestCountPerTarget` metrics, respectively.
+ For optimal use of predictive scaling, you adhere to the best practice of using a dynamic scaling policy to automatically scale between the minimum capacity and maximum capacity in response to real-time changes in resource utilization.
+ Amazon EC2 Auto Scaling consumes data points for the load metric over the last 14 days and creates an hourly load forecast for predictive scaling. (A minimum of 24 hours of data is required.)
+ After creating the load forecast, Amazon EC2 Auto Scaling determines when to reduce or increase the capacity of your Auto Scaling group in each hour of the forecast period so that the average number of requests received by each instance is as close to 1000 requests per minute as possible at all times.

For information about using custom metrics with predictive scaling, see [Advanced predictive scaling policy configurations using custom metrics](https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification-syntax.json"></a>

```
{
  "[CustomizedCapacityMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedcapacitymetricspecification)" : PredictiveScalingCustomizedCapacityMetric,
  "[CustomizedLoadMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedloadmetricspecification)" : PredictiveScalingCustomizedLoadMetric,
  "[CustomizedScalingMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedscalingmetricspecification)" : PredictiveScalingCustomizedScalingMetric,
  "[PredefinedLoadMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedloadmetricspecification)" : PredictiveScalingPredefinedLoadMetric,
  "[PredefinedMetricPairSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedmetricpairspecification)" : PredictiveScalingPredefinedMetricPair,
  "[PredefinedScalingMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedscalingmetricspecification)" : PredictiveScalingPredefinedScalingMetric,
  "[TargetValue](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-targetvalue)" : Number
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification-syntax.yaml"></a>

```
  [CustomizedCapacityMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedcapacitymetricspecification): 
    PredictiveScalingCustomizedCapacityMetric
  [CustomizedLoadMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedloadmetricspecification): 
    PredictiveScalingCustomizedLoadMetric
  [CustomizedScalingMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedscalingmetricspecification): 
    PredictiveScalingCustomizedScalingMetric
  [PredefinedLoadMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedloadmetricspecification): 
    PredictiveScalingPredefinedLoadMetric
  [PredefinedMetricPairSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedmetricpairspecification): 
    PredictiveScalingPredefinedMetricPair
  [PredefinedScalingMetricSpecification](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedscalingmetricspecification): 
    PredictiveScalingPredefinedScalingMetric
  [TargetValue](#cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-targetvalue): Number
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification-properties"></a>

`CustomizedCapacityMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedcapacitymetricspecification"></a>
The customized capacity metric specification.  
*Required*: No  
*Type*: [PredictiveScalingCustomizedCapacityMetric](aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CustomizedLoadMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedloadmetricspecification"></a>
The customized load metric specification.  
*Required*: No  
*Type*: [PredictiveScalingCustomizedLoadMetric](aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedloadmetric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CustomizedScalingMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-customizedscalingmetricspecification"></a>
The customized scaling metric specification.  
*Required*: No  
*Type*: [PredictiveScalingCustomizedScalingMetric](aws-properties-autoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PredefinedLoadMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedloadmetricspecification"></a>
The predefined load metric specification.  
*Required*: No  
*Type*: [PredictiveScalingPredefinedLoadMetric](aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PredefinedMetricPairSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedmetricpairspecification"></a>
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.  
*Required*: No  
*Type*: [PredictiveScalingPredefinedMetricPair](aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PredefinedScalingMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedscalingmetricspecification"></a>
The predefined scaling metric specification.  
*Required*: No  
*Type*: [PredictiveScalingPredefinedScalingMetric](aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TargetValue`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingmetricspecification-targetvalue"></a>
Specifies the target utilization.  
Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval. 
*Required*: Yes  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingPredefinedLoadMetric
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric"></a>

Contains load metric information for the `PredefinedLoadMetricSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

**Important**  
Does not apply to policies that use a *metric pair* for the metric specification.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-syntax.json"></a>

```
{
  "[PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-predefinedmetrictype)" : String,
  "[ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-resourcelabel)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-syntax.yaml"></a>

```
  [PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-predefinedmetrictype): String
  [ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-resourcelabel): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-properties"></a>

`PredefinedMetricType`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-predefinedmetrictype"></a>
The metric type.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `ASGTotalCPUUtilization | ASGTotalNetworkIn | ASGTotalNetworkOut | ALBTargetGroupRequestCount`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceLabel`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-resourcelabel"></a>
A label that uniquely identifies a specific Application Load Balancer target group from which to determine the request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.  
You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:  
`app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff`.  
Where:  
+ app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
+ targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingPredefinedMetricPair
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair"></a>

Contains metric pair information for the `PredefinedMetricPairSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

For more information, see [Predictive scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-syntax.json"></a>

```
{
  "[PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-predefinedmetrictype)" : String,
  "[ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-resourcelabel)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-syntax.yaml"></a>

```
  [PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-predefinedmetrictype): String
  [ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-resourcelabel): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-properties"></a>

`PredefinedMetricType`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-predefinedmetrictype"></a>
Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric. For example, if the metric type is `ASGCPUUtilization`, the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling metric.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `ASGCPUUtilization | ASGNetworkIn | ASGNetworkOut | ALBRequestCount`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceLabel`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-resourcelabel"></a>
A label that uniquely identifies a specific Application Load Balancer target group from which to determine the total and average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.  
You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:  
`app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff`.  
Where:  
+ app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
+ targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `1023`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy PredictiveScalingPredefinedScalingMetric
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric"></a>

Contains scaling metric information for the `PredefinedScalingMetricSpecification` property of the [AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-predictivescalingmetricspecification.html) property type.

**Important**  
Does not apply to policies that use a *metric pair* for the metric specification.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-syntax.json"></a>

```
{
  "[PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-predefinedmetrictype)" : String,
  "[ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-resourcelabel)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-syntax.yaml"></a>

```
  [PredefinedMetricType](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-predefinedmetrictype): String
  [ResourceLabel](#cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-resourcelabel): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-properties"></a>

`PredefinedMetricType`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-predefinedmetrictype"></a>
The metric type.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `ASGAverageCPUUtilization | ASGAverageNetworkIn | ASGAverageNetworkOut | ALBRequestCountPerTarget`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceLabel`  <a name="cfn-autoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-resourcelabel"></a>
A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.  
You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:  
`app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff`.  
Where:  
+ app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
+ targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.  
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy StepAdjustment
<a name="aws-properties-autoscaling-scalingpolicy-stepadjustment"></a>

`StepAdjustment` specifies a step adjustment for the `StepAdjustments` property of the [AWS::AutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html) resource.

For the following examples, suppose that you have an alarm with a breach threshold of 50: 
+ To trigger a step adjustment when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10. 
+ To trigger a step adjustment when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0. 

There are a few rules for the step adjustments for your step policy: 
+ The ranges of your step adjustments can't overlap or have a gap. 
+ At most one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound. 
+ At most one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound. 
+ The upper and lower bound can't be null in the same step adjustment.

For more information, see [Step adjustments](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-steps) in the *Amazon EC2 Auto Scaling User Guide*. 

You can find a sample template snippet in the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html#aws-resource-autoscaling-scalingpolicy--examples) section of the `AWS::AutoScaling::ScalingPolicy` resource.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-stepadjustment-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-stepadjustment-syntax.json"></a>

```
{
  "[MetricIntervalLowerBound](#cfn-autoscaling-scalingpolicy-stepadjustment-metricintervallowerbound)" : Number,
  "[MetricIntervalUpperBound](#cfn-autoscaling-scalingpolicy-stepadjustment-metricintervalupperbound)" : Number,
  "[ScalingAdjustment](#cfn-autoscaling-scalingpolicy-stepadjustment-scalingadjustment)" : Integer
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-stepadjustment-syntax.yaml"></a>

```
  [MetricIntervalLowerBound](#cfn-autoscaling-scalingpolicy-stepadjustment-metricintervallowerbound): Number
  [MetricIntervalUpperBound](#cfn-autoscaling-scalingpolicy-stepadjustment-metricintervalupperbound): Number
  [ScalingAdjustment](#cfn-autoscaling-scalingpolicy-stepadjustment-scalingadjustment): Integer
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-stepadjustment-properties"></a>

`MetricIntervalLowerBound`  <a name="cfn-autoscaling-scalingpolicy-stepadjustment-metricintervallowerbound"></a>
The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.  
*Required*: Conditional  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricIntervalUpperBound`  <a name="cfn-autoscaling-scalingpolicy-stepadjustment-metricintervalupperbound"></a>
The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.  
The upper bound must be greater than the lower bound.  
*Required*: Conditional  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ScalingAdjustment`  <a name="cfn-autoscaling-scalingpolicy-stepadjustment-scalingadjustment"></a>
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy TargetTrackingConfiguration
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration"></a>

`TargetTrackingConfiguration` is a property of the [AWS::AutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html) resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling. 

For more information about scaling policies, see [Dynamic scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) in the *Amazon EC2 Auto Scaling User Guide*. 

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration-syntax.json"></a>

```
{
  "[CustomizedMetricSpecification](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-customizedmetricspecification)" : CustomizedMetricSpecification,
  "[DisableScaleIn](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-disablescalein)" : Boolean,
  "[PredefinedMetricSpecification](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-predefinedmetricspecification)" : PredefinedMetricSpecification,
  "[TargetValue](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-targetvalue)" : Number
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration-syntax.yaml"></a>

```
  [CustomizedMetricSpecification](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-customizedmetricspecification): 
    CustomizedMetricSpecification
  [DisableScaleIn](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-disablescalein): Boolean
  [PredefinedMetricSpecification](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-predefinedmetricspecification): 
    PredefinedMetricSpecification
  [TargetValue](#cfn-autoscaling-scalingpolicy-targettrackingconfiguration-targetvalue): Number
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingconfiguration-properties"></a>

`CustomizedMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-targettrackingconfiguration-customizedmetricspecification"></a>
A customized metric. You must specify either a predefined metric or a customized metric.  
*Required*: Conditional  
*Type*: [CustomizedMetricSpecification](aws-properties-autoscaling-scalingpolicy-customizedmetricspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DisableScaleIn`  <a name="cfn-autoscaling-scalingpolicy-targettrackingconfiguration-disablescalein"></a>
Indicates whether scaling in by the target tracking scaling policy is disabled. If scaling in is disabled, the target tracking scaling policy doesn't remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is `false`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PredefinedMetricSpecification`  <a name="cfn-autoscaling-scalingpolicy-targettrackingconfiguration-predefinedmetricspecification"></a>
A predefined metric. You must specify either a predefined metric or a customized metric.  
*Required*: Conditional  
*Type*: [PredefinedMetricSpecification](aws-properties-autoscaling-scalingpolicy-predefinedmetricspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TargetValue`  <a name="cfn-autoscaling-scalingpolicy-targettrackingconfiguration-targetvalue"></a>
The target value for the metric.  
Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval. 
*Required*: Yes  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy TargetTrackingMetricDataQuery
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery"></a>

The metric data to return. Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.

You can use `TargetTrackingMetricDataQuery` structures with a [PutScalingPolicy](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PutScalingPolicy.html) operation when you specify a [TargetTrackingConfiguration](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html) in the request.

You can call for a single metric or perform math expressions on multiple metrics. Any expressions used in a metric specification must eventually return a single time series.

For more information, see the [Create a target tracking scaling policy for Amazon EC2 Auto Scaling using metric math](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-target-tracking-metric-math.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery-syntax.json"></a>

```
{
  "[Expression](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-expression)" : String,
  "[Id](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-id)" : String,
  "[Label](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-label)" : String,
  "[MetricStat](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-metricstat)" : TargetTrackingMetricStat,
  "[Period](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-period)" : Integer,
  "[ReturnData](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-returndata)" : Boolean
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery-syntax.yaml"></a>

```
  [Expression](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-expression): String
  [Id](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-id): String
  [Label](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-label): String
  [MetricStat](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-metricstat): 
    TargetTrackingMetricStat
  [Period](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-period): Integer
  [ReturnData](#cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-returndata): Boolean
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricdataquery-properties"></a>

`Expression`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-expression"></a>
The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the `Id` of the other metrics to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions.   
Conditional: Within each `TargetTrackingMetricDataQuery` object, you must specify either `Expression` or `MetricStat`, but not both.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `2047`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-id"></a>
A short name that identifies the object's results in the response. This name must be unique among all `TargetTrackingMetricDataQuery` objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.   
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Label`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-label"></a>
A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.  
*Required*: No  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Maximum*: `2047`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricStat`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-metricstat"></a>
Information about the metric data to return.  
Conditional: Within each `TargetTrackingMetricDataQuery` object, you must specify either `Expression` or `MetricStat`, but not both.  
*Required*: No  
*Type*: [TargetTrackingMetricStat](aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-period"></a>
 The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see [Create a target tracking policy using high-resolution metrics for faster response](https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html).   
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReturnData`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricdataquery-returndata"></a>
Indicates whether to return the timestamps and raw data values of this metric.   
If you use any math expressions, specify `true` for this value for only the final math expression that the metric specification is based on. You must specify `false` for `ReturnData` for all the other metrics and expressions used in the metric specification.  
If you are only retrieving metrics and not performing any math expressions, do not specify anything for `ReturnData`. This sets it to its default (`true`).  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScalingPolicy TargetTrackingMetricStat
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat"></a>

This structure defines the CloudWatch metric to return, along with the statistic and unit.

`TargetTrackingMetricStat` is a property of the [TargetTrackingMetricDataQuery](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingMetricDataQuery.html) object.

For more information about the CloudWatch terminology below, see [Amazon CloudWatch concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html) in the *Amazon CloudWatch User Guide*.

## Syntax
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat-syntax.json"></a>

```
{
  "[Metric](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-metric)" : Metric,
  "[Period](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-period)" : Integer,
  "[Stat](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-stat)" : String,
  "[Unit](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-unit)" : String
}
```

### YAML
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat-syntax.yaml"></a>

```
  [Metric](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-metric): 
    Metric
  [Period](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-period): Integer
  [Stat](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-stat): String
  [Unit](#cfn-autoscaling-scalingpolicy-targettrackingmetricstat-unit): String
```

## Properties
<a name="aws-properties-autoscaling-scalingpolicy-targettrackingmetricstat-properties"></a>

`Metric`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricstat-metric"></a>
The metric to use.  
*Required*: Yes  
*Type*: [Metric](aws-properties-autoscaling-scalingpolicy-metric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricstat-period"></a>
 The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see [Create a target tracking policy using high-resolution metrics for faster response](https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html).   
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Stat`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricstat-stat"></a>
The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) in the *Amazon CloudWatch User Guide*.  
The most commonly used metric for scaling is `Average`.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-autoscaling-scalingpolicy-targettrackingmetricstat-unit"></a>
The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) data type in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::AutoScaling::ScheduledAction
<a name="aws-resource-autoscaling-scheduledaction"></a>

The `AWS::AutoScaling::ScheduledAction` resource specifies an Amazon EC2 Auto Scaling scheduled action so that the Auto Scaling group can change the number of instances available for your application in response to predictable load changes. 

When you update a stack with an Auto Scaling group and scheduled action, CloudFormation always sets the min size, max size, and desired capacity properties of your group to the values that are defined in the `AWS::AutoScaling::AutoScalingGroup` section of your template. However, you might not want CloudFormation to do that when you have a scheduled action in effect. You can use an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) to prevent CloudFormation from changing the min size, max size, or desired capacity property values during a stack update unless you modified the individual values in your template. If you have rolling updates enabled, before you can update the Auto Scaling group, you must suspend scheduled actions by specifying an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) for the Auto Scaling group. You can find a sample update policy for rolling updates in [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).

For more information, see [Scheduled scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) and [Suspending and resuming scaling processes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-resource-autoscaling-scheduledaction-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-scheduledaction-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::ScheduledAction",
  "Properties" : {
      "[AutoScalingGroupName](#cfn-autoscaling-scheduledaction-autoscalinggroupname)" : String,
      "[DesiredCapacity](#cfn-autoscaling-scheduledaction-desiredcapacity)" : Integer,
      "[EndTime](#cfn-autoscaling-scheduledaction-endtime)" : String,
      "[MaxSize](#cfn-autoscaling-scheduledaction-maxsize)" : Integer,
      "[MinSize](#cfn-autoscaling-scheduledaction-minsize)" : Integer,
      "[Recurrence](#cfn-autoscaling-scheduledaction-recurrence)" : String,
      "[StartTime](#cfn-autoscaling-scheduledaction-starttime)" : String,
      "[TimeZone](#cfn-autoscaling-scheduledaction-timezone)" : String
    }
}
```

### YAML
<a name="aws-resource-autoscaling-scheduledaction-syntax.yaml"></a>

```
Type: AWS::AutoScaling::ScheduledAction
Properties:
  [AutoScalingGroupName](#cfn-autoscaling-scheduledaction-autoscalinggroupname): String
  [DesiredCapacity](#cfn-autoscaling-scheduledaction-desiredcapacity): Integer
  [EndTime](#cfn-autoscaling-scheduledaction-endtime): String
  [MaxSize](#cfn-autoscaling-scheduledaction-maxsize): Integer
  [MinSize](#cfn-autoscaling-scheduledaction-minsize): Integer
  [Recurrence](#cfn-autoscaling-scheduledaction-recurrence): String
  [StartTime](#cfn-autoscaling-scheduledaction-starttime): String
  [TimeZone](#cfn-autoscaling-scheduledaction-timezone): String
```

## Properties
<a name="aws-resource-autoscaling-scheduledaction-properties"></a>

`AutoScalingGroupName`  <a name="cfn-autoscaling-scheduledaction-autoscalinggroupname"></a>
The name of the Auto Scaling group.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`DesiredCapacity`  <a name="cfn-autoscaling-scheduledaction-desiredcapacity"></a>
The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions.   
You must specify at least one of the following properties: `MaxSize`, `MinSize`, or `DesiredCapacity`. 
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EndTime`  <a name="cfn-autoscaling-scheduledaction-endtime"></a>
The date and time for the recurring schedule to end, in UTC. For example, `"2021-06-01T00:00:00Z"`.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxSize`  <a name="cfn-autoscaling-scheduledaction-maxsize"></a>
The maximum size of the Auto Scaling group.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinSize`  <a name="cfn-autoscaling-scheduledaction-minsize"></a>
The minimum size of the Auto Scaling group.  
*Required*: Conditional  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Recurrence`  <a name="cfn-autoscaling-scheduledaction-recurrence"></a>
The recurring schedule for this action. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day\$1of\$1Month] [Month\$1of\$1Year] [Day\$1of\$1Week]. The value must be in quotes (for example, `"30 0 1 1,6,12 *"`). For more information about this format, see [Crontab](http://crontab.org).  
When `StartTime` and `EndTime` are specified with `Recurrence`, they form the boundaries of when the recurring action starts and stops.  
Cron expressions use Universal Coordinated Time (UTC) by default.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StartTime`  <a name="cfn-autoscaling-scheduledaction-starttime"></a>
The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, `"2021-06-01T00:00:00Z"`).  
If you specify `Recurrence` and `StartTime`, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TimeZone`  <a name="cfn-autoscaling-scheduledaction-timezone"></a>
Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default.   
Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as `Etc/GMT+9` or `Pacific/Tahiti`). For more information, see [https://en.wikipedia.org/wiki/List\$1of\$1tz\$1database\$1time\$1zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-autoscaling-scheduledaction-return-values"></a>

### Ref
<a name="aws-resource-autoscaling-scheduledaction-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name. For example: `mystack-myscheduledaction-NT5EUXTNTXXD`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-autoscaling-scheduledaction-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-autoscaling-scheduledaction-return-values-fn--getatt-fn--getatt"></a>

`ScheduledActionName`  <a name="ScheduledActionName-fn::getatt"></a>
Returns the name of a scheduled action.

## Examples
<a name="aws-resource-autoscaling-scheduledaction--examples"></a>

The following examples schedule scaling actions for an Auto Scaling group.

**Topics**
+ [Scheduled actions that run on a recurring schedule](#aws-resource-autoscaling-scheduledaction--examples--Scheduled_actions_that_run_on_a_recurring_schedule)
+ [Scheduled scaling action that occurs only once](#aws-resource-autoscaling-scheduledaction--examples--Scheduled_scaling_action_that_occurs_only_once)

### Scheduled actions that run on a recurring schedule
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_actions_that_run_on_a_recurring_schedule"></a>

The following template snippet includes two scheduled actions that scale the number of instances in an Auto Scaling group. The `ScheduledActionOut` action starts at 7 AM every day and sets the Auto Scaling group to a minimum of five Amazon EC2 instances with a maximum of 10. The `ScheduledActionIn` action starts at 7 PM every day and sets the Auto Scaling group to a minimum and maximum of one Amazon EC2 instance. The time zone is not provided. As a result, these scheduled actions will recur in UTC time. 

#### JSON
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_actions_that_run_on_a_recurring_schedule--json"></a>

```
{
  "Resources":{
    "ScheduledActionOut":{
      "Type":"AWS::AutoScaling::ScheduledAction",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "MaxSize":"10",
        "MinSize":"5",
        "Recurrence":"0 7 * * *"
      }
    },
    "ScheduledActionIn":{
      "Type":"AWS::AutoScaling::ScheduledAction",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "MaxSize":"1",
        "MinSize":"1",
        "Recurrence":"0 19 * * *"
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_actions_that_run_on_a_recurring_schedule--yaml"></a>

```
---
Resources:
  ScheduledActionOut: 
    Type: AWS::AutoScaling::ScheduledAction
    Properties:
      AutoScalingGroupName: !Ref myASG
      MaxSize: '10'
      MinSize: '5'
      Recurrence: "0 7 * * *"
  ScheduledActionIn: 
    Type: AWS::AutoScaling::ScheduledAction
    Properties:
      AutoScalingGroupName: !Ref myASG
      MaxSize: '1'
      MinSize: '1'
      Recurrence: "0 19 * * *"
```

### Scheduled scaling action that occurs only once
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_scaling_action_that_occurs_only_once"></a>

The following template snippet includes a one-time scheduled action. At the date and time specified for `StartTime` (4:00 PM UTC on March 31, 2021), if the group currently has more than 1 instance, it scales in to 1 instance. If the group currently has no instances, it scales out to 1 instance. 

#### JSON
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_scaling_action_that_occurs_only_once--json"></a>

```
{
  "Resources":{
    "OneTimeScheduledAction":{
      "Type":"AWS::AutoScaling::ScheduledAction",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "DesiredCapacity":"1",
        "StartTime":"2021-03-31T16:00:00Z"
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-scheduledaction--examples--Scheduled_scaling_action_that_occurs_only_once--yaml"></a>

```
---
Resources:
  OneTimeScheduledAction:
    Type: AWS::AutoScaling::ScheduledAction
    Properties:
      AutoScalingGroupName: !Ref myASG
      DesiredCapacity: '1'
      StartTime: '2021-03-31T16:00:00Z'
```

## See also
<a name="aws-resource-autoscaling-scheduledaction--seealso"></a>
+ You can find additional useful snippets in the following sections of the *AWS CloudFormation User Guide*:
  + For examples of Auto Scaling groups, see [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html).
  + For examples of launch templates, see [Create launch templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-launch-templates.html).
+ [PutScheduledUpdateGroupAction](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PutScheduledUpdateGroupAction.html) in the *Amazon EC2 Auto Scaling API Reference*

# AWS::AutoScaling::WarmPool
<a name="aws-resource-autoscaling-warmpool"></a>

The `AWS::AutoScaling::WarmPool` resource creates a pool of pre-initialized EC2 instances that sits alongside the Auto Scaling group. Whenever your application needs to scale out, the Auto Scaling group can draw on the warm pool to meet its new desired capacity. 

When you create a warm pool, you can define a minimum size. When your Auto Scaling group scales out and the size of the warm pool shrinks, Amazon EC2 Auto Scaling launches new instances into the warm pool to maintain its minimum size. 

For more information, see [Warm pools for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) in the *Amazon EC2 Auto Scaling User Guide*.

**Note**  
CloudFormation supports the `UpdatePolicy` attribute for Auto Scaling groups. During an update, if `UpdatePolicy` is set to `AutoScalingRollingUpdate`, CloudFormation replaces `InService` instances only. Instances in the warm pool are not replaced. The difference in which instances are replaced can potentially result in different instance configurations after the stack update completes. If `UpdatePolicy` is set to `AutoScalingReplacingUpdate`, you do not encounter this issue because CloudFormation replaces both the Auto Scaling group and the warm pool.

## Syntax
<a name="aws-resource-autoscaling-warmpool-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-autoscaling-warmpool-syntax.json"></a>

```
{
  "Type" : "AWS::AutoScaling::WarmPool",
  "Properties" : {
      "[AutoScalingGroupName](#cfn-autoscaling-warmpool-autoscalinggroupname)" : String,
      "[InstanceReusePolicy](#cfn-autoscaling-warmpool-instancereusepolicy)" : InstanceReusePolicy,
      "[MaxGroupPreparedCapacity](#cfn-autoscaling-warmpool-maxgrouppreparedcapacity)" : Integer,
      "[MinSize](#cfn-autoscaling-warmpool-minsize)" : Integer,
      "[PoolState](#cfn-autoscaling-warmpool-poolstate)" : String
    }
}
```

### YAML
<a name="aws-resource-autoscaling-warmpool-syntax.yaml"></a>

```
Type: AWS::AutoScaling::WarmPool
Properties:
  [AutoScalingGroupName](#cfn-autoscaling-warmpool-autoscalinggroupname): String
  [InstanceReusePolicy](#cfn-autoscaling-warmpool-instancereusepolicy): 
    InstanceReusePolicy
  [MaxGroupPreparedCapacity](#cfn-autoscaling-warmpool-maxgrouppreparedcapacity): Integer
  [MinSize](#cfn-autoscaling-warmpool-minsize): Integer
  [PoolState](#cfn-autoscaling-warmpool-poolstate): String
```

## Properties
<a name="aws-resource-autoscaling-warmpool-properties"></a>

`AutoScalingGroupName`  <a name="cfn-autoscaling-warmpool-autoscalinggroupname"></a>
The name of the Auto Scaling group.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceReusePolicy`  <a name="cfn-autoscaling-warmpool-instancereusepolicy"></a>
Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.  
*Required*: No  
*Type*: [InstanceReusePolicy](aws-properties-autoscaling-warmpool-instancereusepolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxGroupPreparedCapacity`  <a name="cfn-autoscaling-warmpool-maxgrouppreparedcapacity"></a>
Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group's maximum capacity and its desired capacity.   
If a value for `MaxGroupPreparedCapacity` is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group's maximum capacity and its desired capacity. If you specify a value for `MaxGroupPreparedCapacity`, Amazon EC2 Auto Scaling uses the difference between the `MaxGroupPreparedCapacity` and the desired capacity instead.   
The size of the warm pool is dynamic. Only when `MaxGroupPreparedCapacity` and `MinSize` are set to the same value does the warm pool have an absolute size.
If the desired capacity of the Auto Scaling group is higher than the `MaxGroupPreparedCapacity`, the capacity of the warm pool is 0, unless you specify a value for `MinSize`. To remove a value that you previously set, include the property but specify -1 for the value.   
*Required*: No  
*Type*: Integer  
*Minimum*: `-1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinSize`  <a name="cfn-autoscaling-warmpool-minsize"></a>
Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PoolState`  <a name="cfn-autoscaling-warmpool-poolstate"></a>
Sets the instance state to transition to after the lifecycle actions are complete. Default is `Stopped`.  
*Required*: No  
*Type*: String  
*Allowed values*: `Stopped | Running | Hibernated`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Remarks
<a name="aws-resource-autoscaling-warmpool--remarks"></a>

CloudFormation won't mark the warm pool as successful (by setting its status to CREATE\$1COMPLETE) if there are lifecycle hooks that haven't been completed. If the state of an instance is `Warmed:Pending:Wait`, the lifeycle hook is not considered complete. For more information, see [Use lifecycle hooks with a warm pool](https://docs.aws.amazon.com/autoscaling/ec2/userguide/warm-pool-instance-lifecycle.html) in the *Amazon EC2 Auto Scaling User Guide*.

If you want to hibernate instances on scale in and there are existing instances in the Auto Scaling group, they must meet the requirements for instance hibernation. If they don't, when instances return to the warm pool, they will fallback to being stopped instead of being hibernated.

## Examples
<a name="aws-resource-autoscaling-warmpool--examples"></a>

The following example defines a warm pool for an Auto Scaling group.

For more examples, see our [GitHub repository](https://github.com/aws-samples/amazon-ec2-auto-scaling-group-examples). Included are examples of lifecycle hooks that work with warm pools. 

### Auto Scaling group with warm pool
<a name="aws-resource-autoscaling-warmpool--examples--Auto_Scaling_group_with_warm_pool"></a>

The following template snippet shows an `AWS::AutoScaling::WarmPool` resource for an Auto Scaling group where you specify values for the `MinSize` and `PoolState` properties. 

#### JSON
<a name="aws-resource-autoscaling-warmpool--examples--Auto_Scaling_group_with_warm_pool--json"></a>

```
{
  "Resources":{
    "myWarmPool":{
      "Type":"AWS::AutoScaling::WarmPool",
      "Properties":{
        "AutoScalingGroupName":{
          "Ref":"myASG"
        },
        "MinSize":30,
        "PoolState":"Stopped"
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-autoscaling-warmpool--examples--Auto_Scaling_group_with_warm_pool--yaml"></a>

```
---
Resources:
  myWarmPool: 
    Type: AWS::AutoScaling::WarmPool
    Properties:
      AutoScalingGroupName: !Ref myASG
      MinSize: '30'
      PoolState: Stopped
```

## See also
<a name="aws-resource-autoscaling-warmpool--seealso"></a>
+ [PutWarmPool](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PutWarmPool.html) in the *Amazon EC2 Auto Scaling API Reference*



# AWS::AutoScaling::WarmPool InstanceReusePolicy
<a name="aws-properties-autoscaling-warmpool-instancereusepolicy"></a>

A structure that specifies an instance reuse policy for the `InstanceReusePolicy` property of the [AWS::AutoScaling::WarmPool](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-warmpool.html) resource.

For more information, see [Warm pools for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Syntax
<a name="aws-properties-autoscaling-warmpool-instancereusepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-autoscaling-warmpool-instancereusepolicy-syntax.json"></a>

```
{
  "[ReuseOnScaleIn](#cfn-autoscaling-warmpool-instancereusepolicy-reuseonscalein)" : Boolean
}
```

### YAML
<a name="aws-properties-autoscaling-warmpool-instancereusepolicy-syntax.yaml"></a>

```
  [ReuseOnScaleIn](#cfn-autoscaling-warmpool-instancereusepolicy-reuseonscalein): Boolean
```

## Properties
<a name="aws-properties-autoscaling-warmpool-instancereusepolicy-properties"></a>

`ReuseOnScaleIn`  <a name="cfn-autoscaling-warmpool-instancereusepolicy-reuseonscalein"></a>
Specifies whether instances in the Auto Scaling group can be returned to the warm pool on scale in.   
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)