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.
Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For more information, see Launch configurations and Migrate CloudFormation stacks from launch configurations to launch templates in the Amazon EC2 Auto Scaling User Guide.
An Auto Scaling group and a launch template.
resource "awscc_autoscaling_auto_scaling_group" "example" {
max_size = "1"
min_size = "0"
launch_template = {
version = awscc_ec2_launch_template.example.latest_version_number
launch_template_id = awscc_ec2_launch_template.example.id
}
desired_capacity = "1"
vpc_zone_identifier = [
"subnetIdAz1",
"subnetIdAz2",
"subnetIdAz3"
]
depends_on = [
awscc_ec2_launch_template.example
]
}
resource "awscc_ec2_launch_template" "example" {
launch_template_data = {
image_id = data.aws_ami.amazon_linux.id
instance_type = "t2.micro"
}
launch_template_name = "${data.aws_caller_identity.current.account_id}-launch-template"
}
data "aws_caller_identity" "current" {}
data "aws_ami" "amazon_linux" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-hvm-*-gp2"]
}
filter {
name = "root-device-type"
values = ["ebs"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
filter {
name = "architecture"
values = ["x86_64"]
}
}
Auto Scaling group with CloudWatch monitoring enabled
resource "awscc_autoscaling_auto_scaling_group" "example" {
max_size = "1"
min_size = "0"
launch_template = {
version = awscc_ec2_launch_template.example.latest_version_number
launch_template_id = awscc_ec2_launch_template.example.id
}
desired_capacity = "1"
vpc_zone_identifier = [
"subnetIdAz1",
"subnetIdAz2",
"subnetIdAz3"
]
metrics_collection = [{
granularity = "1Minute"
metrics = [
"GroupMinSize",
"GroupMaxSize"
]
}]
}
resource "awscc_ec2_launch_template" "example" {
launch_template_data = {
image_id = data.aws_ami.amazon_linux.id
instance_type = "t2.micro"
}
launch_template_name = "${data.aws_caller_identity.current.account_id}-launch-template"
}
data "aws_caller_identity" "current" {}
data "aws_ami" "amazon_linux" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-hvm-*-gp2"]
}
filter {
name = "root-device-type"
values = ["ebs"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
filter {
name = "architecture"
values = ["x86_64"]
}
}
max_size
(String) 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).min_size
(String) The minimum size of the group.auto_scaling_group_name
(String) 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.availability_zones
(List of String) 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.capacity_rebalance
(Boolean) 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 in the in the Amazon EC2 Auto Scaling User Guide.context
(String) Reserved.cooldown
(String) 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 in the Amazon EC2 Auto Scaling User Guide.
Default: 300
secondsdefault_instance_warmup
(Number) 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 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: Nonedesired_capacity
(String) 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_COMPLETE) 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.desired_capacity_type
(String) 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 Creating an Auto Scaling group using attribute-based instance type selection 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
| vcpu
| memory-mib
health_check_grace_period
(Number) 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 in the Amazon EC2 Auto Scaling User Guide.
Default: 0
secondshealth_check_type
(String) A comma-separated value string of one or more health check types.
The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is the default health check and cannot be disabled. For more information, see Health checks for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide.
Only specify EC2
if you must clear a value that was previously set.instance_id
(String) 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 in the Amazon EC2 Auto Scaling User Guide.
If you specify LaunchTemplate
, MixedInstancesPolicy
, or LaunchConfigurationName
, don't specify InstanceId
.instance_maintenance_policy
(Attributes) An instance maintenance policy. For more information, see Set instance maintenance policy in the Amazon EC2 Auto Scaling User Guide. (see below for nested schema)launch_configuration_name
(String) The name of the launch configuration to use to launch instances.
Required only if you don't specify LaunchTemplate
, MixedInstancesPolicy
, or InstanceId
.launch_template
(Attributes) 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 in the Amazon EC2 Auto Scaling User Guide.
If you omit this property, you must specify MixedInstancesPolicy
, LaunchConfigurationName
, or InstanceId
. (see below for nested schema)lifecycle_hook_specification_list
(Attributes List) One or more lifecycle hooks to add to the Auto Scaling group before instances are launched. (see below for nested schema)load_balancer_names
(List of String) 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.max_instance_lifetime
(Number) 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 Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.metrics_collection
(Attributes List) Enables the monitoring of group metrics of an Auto Scaling group. By default, these metrics are disabled. (see below for nested schema)mixed_instances_policy
(Attributes) 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 in the Amazon EC2 Auto Scaling User Guide. (see below for nested schema)new_instances_protected_from_scale_in
(Boolean) 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 Using instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.notification_configuration
(Attributes) A structure that specifies an Amazon SNS notification configuration for the NotificationConfigurations
property of the AWS::AutoScaling::AutoScalingGroup resource.
For an example template snippet, see Auto scaling template snippets.
For more information, see Get Amazon SNS notifications when your Auto Scaling group scales in the Amazon EC2 Auto Scaling User Guide. (see below for nested schema)notification_configurations
(Attributes List) Configures an Auto Scaling group to send notifications when specified events take place. (see below for nested schema)placement_group
(String) The name of the placement group into which to launch your instances. For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances.
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.service_linked_role_arn
(String) 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 in the Amazon EC2 Auto Scaling User Guide.tags
(Attributes List) 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 in the Amazon EC2 Auto Scaling User Guide. (see below for nested schema)target_group_ar_ns
(List of String) 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 in the Amazon EC2 Auto Scaling User Guide.termination_policies
(List of String) 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 Work with Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide.
Valid values: Default
| AllocationStrategy
| ClosestToNextInstanceHour
| NewestInstance
| OldestInstance
| OldestLaunchConfiguration
| OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
vpc_zone_identifier
(List of String) 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 to declare a dependency on the VPC-gateway attachment.
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.
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.id
(String) Uniquely identifies the resource.instance_maintenance_policy
Optional:
max_healthy_percentage
(Number) 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.min_healthy_percentage
(Number) 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
.launch_template
Required:
version
(String) 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.
For an example of using the Fn::GetAtt
function, see the Examples section of the AWS::AutoScaling::AutoScalingGroup
resource.Optional:
launch_template_id
(String) The ID of the launch template.
You must specify the LaunchTemplateID
or the LaunchTemplateName
, but not both.launch_template_name
(String) The name of the launch template.
You must specify the LaunchTemplateName
or the LaunchTemplateID
, but not both.lifecycle_hook_specification_list
Required:
lifecycle_hook_name
(String) The name of the lifecycle hook.lifecycle_transition
(String) The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.
autoscaling:EC2_INSTANCE_LAUNCHING
.autoscaling:EC2_INSTANCE_TERMINATING
.Optional:
default_result
(String) 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
| ABANDON
heartbeat_timeout
(Number) 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).notification_metadata
(String) Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.notification_target_arn
(String) 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.role_arn
(String) 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 Configure a notification target for a lifecycle hook in the Amazon EC2 Auto Scaling User Guide.
Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.metrics_collection
Required:
granularity
(String) The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is 1Minute
.Optional:
metrics
(List of String) 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 Auto Scaling group metrics in the Amazon EC2 Auto Scaling User Guide.
mixed_instances_policy
mixed_instances_policy.launch_template
mixed_instances_policy.launch_template.launch_template_specification
mixed_instances_policy.launch_template.overrides
mixed_instances_policy.launch_template.overrides.instance_requirements
Default: Any manufacturer
accelerator_names
(Set of String) Lists the accelerators that must be on an instance type.
a100
.v100
.k80
.t4
.m60
.radeon-pro-v520
.vu9p
.Default: Any accelerator
accelerator_total_memory_mi_b
(Attributes) The minimum and maximum total memory size for the accelerators on an instance type, in MiB.
Default: No minimum or maximum limits (see below for nested schema)accelerator_types
(Set of String) Lists the accelerator types that must be on an instance type.
gpu
.fpga
.inference
.Default: Any accelerator type
allowed_instance_types
(List of String) 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 typesbare_metal
(String) Indicates whether bare metal instance types are included, excluded, or required.
Default: excluded
baseline_ebs_bandwidth_mbps
(Attributes) The minimum and maximum baseline bandwidth performance for an instance type, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide for Linux Instances.
Default: No minimum or maximum limits (see below for nested schema)burstable_performance
(String) Indicates whether burstable performance instance types are included, excluded, or required. For more information, see Burstable performance instances in the Amazon EC2 User Guide for Linux Instances.
Default: excluded
cpu_manufacturers
(Set of String) Lists which specific CPU manufacturers to include.
intel
.amd
.amazon-web-services
.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
excluded_instance_types
(List of String) 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 typesinstance_generations
(Set of String) Indicates whether current or previous generation instance types are included.
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 in the Amazon EC2 User Guide for Linux Instances.previous
.Default: Any current or previous generation
local_storage
(String) Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, see Amazon EC2 instance store in the Amazon EC2 User Guide for Linux Instances.
Default: included
local_storage_types
(Set of String) Indicates the type of local storage that is required.
hdd
.ssd
.Default: Any local storage type
max_spot_price_as_percentage_of_optimal_on_demand_price
(Number) [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.
To indicate no price protection threshold, specify a high value, such as 999999
.
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, then SpotMaxPricePercentageOverLowestPrice
is used and the value for that parameter defaults to 100
.memory_gi_b_per_v_cpu
(Attributes) The minimum and maximum amount of memory per vCPU for an instance type, in GiB.
Default: No minimum or maximum limits (see below for nested schema)network_bandwidth_gbps
(Attributes) The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).
Default: No minimum or maximum limits (see below for nested schema)network_interface_count
(Attributes) The minimum and maximum number of network interfaces for an instance type.
Default: No minimum or maximum limits (see below for nested schema)on_demand_max_price_percentage_over_lowest_price
(Number) [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
require_hibernate_support
(Boolean) Indicates whether instance types must provide On-Demand Instance hibernation support.
Default: false
spot_max_price_percentage_over_lowest_price
(Number) [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.
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 based on the per-vCPU or per-memory price instead of the per instance price.
Only one of SpotMaxPricePercentageOverLowestPrice
or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice
can be specified.
Default: 100
total_local_storage_gb
(Attributes) The minimum and maximum total local storage size for an instance type, in GB.
Default: No minimum or maximum limits (see below for nested schema)mixed_instances_policy.launch_template.overrides.weighted_capacity.memory_mi_b
Optional:
max
(Number) The memory maximum in MiB.min
(Number) The memory minimum in MiB.mixed_instances_policy.launch_template.overrides.weighted_capacity.v_cpu_count
Optional:
max
(Number) The maximum number of vCPUs.min
(Number) The minimum number of vCPUs.mixed_instances_policy.launch_template.overrides.weighted_capacity.accelerator_count
Optional:
max
(Number) The maximum value.min
(Number) The minimum value.mixed_instances_policy.launch_template.overrides.weighted_capacity.accelerator_total_memory_mi_b
Optional:
max
(Number) The memory maximum in MiB.min
(Number) The memory minimum in MiB.mixed_instances_policy.launch_template.overrides.weighted_capacity.baseline_ebs_bandwidth_mbps
Optional:
max
(Number) The maximum value in Mbps.min
(Number) The minimum value in Mbps.mixed_instances_policy.launch_template.overrides.weighted_capacity.memory_gi_b_per_v_cpu
Optional:
max
(Number) The memory maximum in GiB.min
(Number) The memory minimum in GiB.mixed_instances_policy.launch_template.overrides.weighted_capacity.network_bandwidth_gbps
Optional:
max
(Number) The maximum amount of network bandwidth, in gigabits per second (Gbps).min
(Number) The minimum amount of network bandwidth, in gigabits per second (Gbps).mixed_instances_policy.launch_template.overrides.weighted_capacity.network_interface_count
Optional:
max
(Number) The maximum number of network interfaces.min
(Number) The minimum number of network interfaces.mixed_instances_policy.launch_template.overrides.weighted_capacity.total_local_storage_gb
Optional:
max
(Number) The storage maximum in GB.min
(Number) The storage minimum in GB.mixed_instances_policy.launch_template.overrides.launch_template_specification
Required:
version
(String) 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.
For an example of using the Fn::GetAtt
function, see the Examples section of the AWS::AutoScaling::AutoScalingGroup
resource.Optional:
launch_template_id
(String) The ID of the launch template.
You must specify the LaunchTemplateID
or the LaunchTemplateName
, but not both.launch_template_name
(String) The name of the launch template.
You must specify the LaunchTemplateName
or the LaunchTemplateID
, but not both.mixed_instances_policy.instances_distribution
Optional:
on_demand_allocation_strategy
(String) 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:
on_demand_base_capacity
(Number) 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.on_demand_percentage_above_base_capacity
(Number) 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.spot_allocation_strategy
(String) 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:
spot_instance_pools
(Number) 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: 2spot_max_price
(String) 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.001notification_configuration
Required:
topic_arn
(String) The Amazon Resource Name (ARN) of the Amazon SNS topic.Optional:
notification_types
(List of String) 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
notification_configurations
Required:
topic_arn
(String) The Amazon Resource Name (ARN) of the Amazon SNS topic.Optional:
notification_types
(List of String) 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
tags
Required:
key
(String) The tag key.propagate_at_launch
(Boolean) 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.value
(String) The tag value.Import is supported using the following syntax:
$ terraform import awscc_autoscaling_auto_scaling_group.example <resource ID>