AWS Auto Scaling Group (ASG) Terraform module
Upstream version 9.2.1
0 controls from Registry requirements
Terraform Module Source
registry.compliance.tf/terraform-aws-modules/autoscaling/aws95 unique
| Name | Type | Default | Description |
|---|---|---|---|
| Required · needed to use this module | |||
name | string | — | Name used across the resources created |
| Optional | |||
autoscaling_group_tags | map(string) | {} | A map of additional tags to add to the autoscaling group |
autoscaling_group_tags_not_propagate_at_launch | list(string) | [] | A list of tag keys that should NOT be propagated to launched EC2 instances |
availability_zone_distribution | object({...}) | null | A map of configuration for capacity distribution across availability zones |
availability_zones | list(string) | null | 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 `vpc_zone_identifier` attribute, or for attaching a network interface when an existing network interface ID is specified in a launch template. Conflicts with `vpc_zone_identifier` |
block_device_mappings | list({...}) | null | Specify volumes to attach to the instance besides the volumes specified by the AMI |
capacity_rebalance | bool | null | Indicates whether capacity rebalance is enabled |
capacity_reservation_specification | object({...}) | null | Targeting for EC2 capacity reservations |
context | string | null | Reserved |
cpu_options | object({...}) | null | The CPU options for the instance |
create | bool | true | Determines whether to create autoscaling group or not |
create_iam_instance_profile | bool | false | Determines whether an IAM instance profile is created or to use an existing IAM instance profile |
create_launch_template | bool | true | Determines whether to create launch template or not |
credit_specification | object({...}) | null | Customize the credit specification of the instance |
default_cooldown | number | null | The amount of time, in seconds, after a scaling activity completes before another scaling activity can start |
default_instance_warmup | number | null | Amount of time, in seconds, until a newly launched instance can contribute to the Amazon CloudWatch metrics. This delay lets an instance finish initializing before Amazon EC2 Auto Scaling aggregates instance metrics, resulting in more reliable usage data. Set this value equal to the amount of time that it takes for resource consumption to become stable after an instance reaches the InService state. |
default_version | string | null | Default Version of the launch template |
desired_capacity | number | null | The number of Amazon EC2 instances that should be running in the autoscaling group |
desired_capacity_type | string | null | The unit of measurement for the value specified for desired_capacity. Supported for attribute-based instance type selection only. Valid values: `units`, `vcpu`, `memory-mib`. |
disable_api_stop | bool | null | If true, enables EC2 instance stop protection |
disable_api_termination | bool | null | If true, enables EC2 instance termination protection |
ebs_optimized | bool | null | If true, the launched EC2 instance will be EBS-optimized |
enable_monitoring | bool | true | Enables/disables detailed monitoring |
enabled_metrics | list(string) | [] | A list of metrics to collect. The allowed values are `GroupDesiredCapacity`, `GroupInServiceCapacity`, `GroupPendingCapacity`, `GroupMinSize`, `GroupMaxSize`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupStandbyCapacity`, `GroupTerminatingCapacity`, `GroupTerminatingInstances`, `GroupTotalCapacity`, `GroupTotalInstances` |
enclave_options | object({...}) | null | Enable Nitro Enclaves on launched instances |
force_delete | bool | null | Allows deleting the Auto Scaling Group without waiting for all instances in the pool to terminate. You can force an Auto Scaling Group to delete even if it's in the process of scaling a resource. Normally, Terraform drains all the instances before deleting the group. This bypasses that behavior and potentially leaves resources dangling |
force_delete_warm_pool | bool | null | Allows deleting the Auto Scaling Group without waiting for all instances in the warm pool to terminate |
health_check_grace_period | number | null | Time (in seconds) after instance comes into service before checking health |
health_check_type | string | null | `EC2` or `ELB`. Controls how health checking is done |
hibernation_options | object({...}) | null | The hibernation options for the instance |
iam_instance_profile_arn | string | null | Amazon Resource Name (ARN) of an existing IAM instance profile. Used when `create_iam_instance_profile` = `false` |
iam_instance_profile_name | string | null | The name of the IAM instance profile to be created (`create_iam_instance_profile` = `true`) or existing (`create_iam_instance_profile` = `false`) |
iam_role_description | string | null | Description of the role |
iam_role_name | string | null | Name to use on IAM role created |
iam_role_path | string | null | IAM role path |
iam_role_permissions_boundary | string | null | ARN of the policy that is used to set the permissions boundary for the IAM role |
iam_role_policies | map(string) | {} | IAM policies to attach to the IAM role |
iam_role_tags | map(string) | {} | A map of additional tags to add to the IAM role created |
iam_role_use_name_prefix | bool | true | Determines whether the IAM role name (`iam_role_name`) is used as a prefix |
ignore_desired_capacity_changes | bool | false | Determines whether the `desired_capacity` value is ignored after initial apply. See README note for more details |
ignore_failed_scaling_activities | bool | false | Whether to ignore failed Auto Scaling scaling activities while waiting for capacity. The default is false -- failed scaling activities cause errors to be returned. |
image_id | string | null | The AMI from which to launch the instance |
initial_lifecycle_hooks | list({...}) | null | One or more Lifecycle Hooks to attach to the Auto Scaling Group before instances are launched. The syntax is exactly the same as the separate `aws_autoscaling_lifecycle_hook` resource, without the `autoscaling_group_name` attribute. Please note that this will only work when creating a new Auto Scaling Group. For all other use-cases, please use `aws_autoscaling_lifecycle_hook` resource |
instance_initiated_shutdown_behavior | string | null | Shutdown behavior for the instance. Can be `stop` or `terminate`. (Default: `stop`) |
instance_maintenance_policy | object({...}) | null | If this block is configured, add a instance maintenance policy to the specified Auto Scaling group |
instance_market_options | object({...}) | null | The market (purchasing) option for the instance |
instance_name | string | "" | Name that is propogated to launched EC2 instances via a tag - if not provided, defaults to `var.name` |
instance_refresh | object({...}) | null | If this block is configured, start an Instance Refresh when this Auto Scaling Group is updated |
instance_requirements | object({...}) | null | The attribute requirements for the type of instance. If present then `instance_type` cannot be present |
instance_type | string | null | The type of the instance. If present then `instance_requirements` cannot be present |
kernel_id | string | null | The kernel ID |
key_name | string | null | The key name that should be used for the instance |
launch_template_description | string | null | Description of the launch template |
launch_template_id | string | null | ID of an existing launch template to be used (created outside of this module) |
launch_template_name | string | "" | Name of launch template to be created |
launch_template_tags | map(string) | {} | A map of additional tags to add to the launch template |
launch_template_use_name_prefix | bool | true | Determines whether to use `launch_template_name` as is or create a unique name beginning with the `launch_template_name` as the prefix |
launch_template_version | string | null | Launch template version. Can be version number, `$Latest`, or `$Default` |
license_specifications | list({...}) | null | A list of license specifications to associate with |
maintenance_options | object({...}) | null | The maintenance options for the instance |
max_instance_lifetime | number | null | The maximum amount of time, in seconds, that an instance can be in service, values must be either equal to 0 or between 86400 and 31536000 seconds |
max_size | number | null | The maximum size of the autoscaling group |
metadata_options | object({...}) | {...} | Customize the metadata options for the instance |
metrics_granularity | string | null | The granularity to associate with the metrics to collect. The only valid value is `1Minute` |
min_elb_capacity | number | null | Setting this causes Terraform to wait for this number of instances to show up healthy in the ELB only on creation. Updates will not wait on ELB instance number changes |
min_size | number | null | The minimum size of the autoscaling group |
mixed_instances_policy | object({...}) | null | Configuration block containing settings to define launch targets for Auto Scaling groups |
network_interfaces | list({...}) | null | Customize network interfaces to be attached at instance boot time |
network_performance_options | object({...}) | null | The network performance options for the launch template |
placement | object({...}) | null | The placement of the instance |
placement_group | string | null | The name of the placement group into which you'll launch your instances, if any |
private_dns_name_options | object({...}) | null | The options for the instance hostname. The default values are inherited from the subnet |
protect_from_scale_in | bool | false | Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events. |
putin_khuylo | bool | true | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! |
ram_disk_id | string | null | The ID of the ram disk |
region | string | null | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration |
scaling_policies | map({...}) | null | Map of target scaling policy schedule to create |
schedules | map({...}) | null | Map of autoscaling group schedule to create |
secondary_interfaces | list({...}) | null | Secondary interfaces to associate with instances launched from the template |
security_groups | list(string) | [] | A list of security group IDs to associate |
service_linked_role_arn | string | null | The ARN of the service-linked role that the ASG will use to call other AWS services |
suspended_processes | list(string) | [] | A list of processes to suspend for the Auto Scaling Group. The allowed values are `Launch`, `Terminate`, `HealthCheck`, `ReplaceUnhealthy`, `AZRebalance`, `AlarmNotification`, `ScheduledActions`, `AddToLoadBalancer`, `InstanceRefresh`. Note that if you suspend either the `Launch` or `Terminate` process types, it can prevent your Auto Scaling Group from functioning properly |
tag_specifications | list({...}) | null | The tags to apply to the resources during launch |
tags | map(string) | {} | A map of tags to assign to resources |
termination_policies | list(string) | [] | A list of policies to decide how the instances in the Auto Scaling Group should be terminated. The allowed values are `OldestInstance`, `NewestInstance`, `OldestLaunchConfiguration`, `ClosestToNextInstanceHour`, `OldestLaunchTemplate`, `AllocationStrategy`, `Default` |
timeouts | object({...}) | null | Timeout configurations for the autoscaling group |
traffic_source_attachments | map({...}) | null | Map of traffic source attachment definitions to create |
update_default_version | bool | null | Whether to update Default Version each update. Conflicts with `default_version` |
use_mixed_instances_policy | bool | false | Determines whether to use a mixed instances policy in the autoscaling group or not |
use_name_prefix | bool | true | Determines whether to use `name` as is or create a unique name beginning with the `name` as the prefix |
user_data | string | null | The Base64-encoded user data to provide when launching the instance |
vpc_zone_identifier | list(string) | null | A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availability_zones` |
wait_for_capacity_timeout | string | null | A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to '0' causes Terraform to skip all Capacity Waiting behavior. |
wait_for_elb_capacity | number | null | Setting this will cause Terraform to wait for exactly this number of healthy instances in all attached load balancers on both create and update operations. Takes precedence over `min_elb_capacity` behavior. |
warm_pool | object({...}) | null | If this block is configured, add a Warm Pool to the specified Auto Scaling group |