EC2 Auto Scaling
Terraform module to create AWS Auto Scaling resources
Inputs
40 / 96
namerequiredstringName used across the resources created
autoscaling_group_tagsoptionalmap(string)A map of additional tags to add to the autoscaling group
{}autoscaling_group_tags_not_propagate_at_launchoptionallist(string)A list of tag keys that should NOT be propagated to launched EC2 instances
[]availability_zone_distributionoptionalobject({ capacity_distribution_strategy = optional(string) })A map of configuration for capacity distribution across availability zones
nullavailability_zonesoptionallist(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 `vpc_zone_identifier` attribute, or for attaching a network interface when an existing network interface ID is specified …
nullblock_device_mappingsoptionallist(object({ device_name = optional(string) ebs = optional(object({ delete_on_t…Specify volumes to attach to the instance besides the volumes specified by the AMI
nullcapacity_rebalanceoptionalboolIndicates whether capacity rebalance is enabled
nullcapacity_reservation_specificationoptionalobject({ capacity_reservation_preference = optional(string) capacity_reservation…Targeting for EC2 capacity reservations
nullcontextoptionalstringReserved
nullcpu_optionsoptionalobject({ amd_sev_snp = optional(string) core_count = optional(number) nested_vir…The CPU options for the instance
nullcreateoptionalboolDetermines whether to create autoscaling group or not
truecreate_iam_instance_profileoptionalboolDetermines whether an IAM instance profile is created or to use an existing IAM instance profile
falsecreate_launch_templateoptionalboolDetermines whether to create launch template or not
truecredit_specificationoptionalobject({ cpu_credits = optional(string) })Customize the credit specification of the instance
nulldefault_cooldownoptionalnumberThe amount of time, in seconds, after a scaling activity completes before another scaling activity can start
nulldefault_instance_warmupoptionalnumberAmount 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 t…
nulldefault_versionoptionalstringDefault Version of the launch template
nulldesired_capacityoptionalnumberThe number of Amazon EC2 instances that should be running in the autoscaling group
nulldesired_capacity_typeoptionalstringThe unit of measurement for the value specified for desired_capacity. Supported for attribute-based instance type selection only. Valid values: `units`, `vcpu`, `memory-mib`.
nulldisable_api_stopoptionalboolIf true, enables EC2 instance stop protection
nulldisable_api_terminationoptionalboolIf true, enables EC2 instance termination protection
nullebs_optimizedoptionalboolIf true, the launched EC2 instance will be EBS-optimized
nullenable_monitoringoptionalboolEnables/disables detailed monitoring
trueenabled_metricsoptionallist(string)A list of metrics to collect. The allowed values are `GroupDesiredCapacity`, `GroupInServiceCapacity`, `GroupPendingCapacity`, `GroupMinSize`, `GroupMaxSize`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupStandbyCapacity`, `GroupTerminatingCapacity`, `GroupTermin…
[]enclave_optionsoptionalobject({ enabled = optional(bool) })Enable Nitro Enclaves on launched instances
nullforce_deleteoptionalboolAllows 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 …
nullforce_delete_warm_pooloptionalboolAllows deleting the Auto Scaling Group without waiting for all instances in the warm pool to terminate
nullhealth_check_grace_periodoptionalnumberTime (in seconds) after instance comes into service before checking health
nullhealth_check_typeoptionalstring`EC2` or `ELB`. Controls how health checking is done
nullhibernation_optionsoptionalobject({ configured = optional(bool) })The hibernation options for the instance
nulliam_instance_profile_arnoptionalstringAmazon Resource Name (ARN) of an existing IAM instance profile. Used when `create_iam_instance_profile` = `false`
nulliam_instance_profile_nameoptionalstringThe name of the IAM instance profile to be created (`create_iam_instance_profile` = `true`) or existing (`create_iam_instance_profile` = `false`)
nulliam_role_descriptionoptionalstringDescription of the role
nulliam_role_nameoptionalstringName to use on IAM role created
nulliam_role_pathoptionalstringIAM role path
nulliam_role_permissions_boundaryoptionalstringARN of the policy that is used to set the permissions boundary for the IAM role
nulliam_role_policiesoptionalmap(string)IAM policies to attach to the IAM role
{}iam_role_tagsoptionalmap(string)A map of additional tags to add to the IAM role created
{}iam_role_use_name_prefixoptionalboolDetermines whether the IAM role name (`iam_role_name`) is used as a prefix
trueignore_desired_capacity_changesoptionalboolDetermines whether the `desired_capacity` value is ignored after initial apply. See README note for more details
false1 of 96 must be supplied; the rest have defaults. Showing 40, so the site stays a static download — the remaining 56 are in the source.
Outputs
27
autoscaling_group_arnThe ARN for this AutoScaling Group
autoscaling_group_availability_zonesThe availability zones of the autoscale group
autoscaling_group_default_cooldownTime between a scaling activity and the succeeding scaling activity
autoscaling_group_desired_capacityThe number of Amazon EC2 instances that should be running in the group
autoscaling_group_enabled_metricsList of metrics enabled for collection
autoscaling_group_health_check_grace_periodTime after instance comes into service before checking health
autoscaling_group_health_check_typeEC2 or ELB. Controls how health checking is done
autoscaling_group_idThe autoscaling group id
autoscaling_group_load_balancersThe load balancer names associated with the autoscaling group
autoscaling_group_max_sizeThe maximum size of the autoscale group
autoscaling_group_min_sizeThe minimum size of the autoscale group
autoscaling_group_nameThe autoscaling group name
autoscaling_group_target_group_arnsList of Target Group ARNs that apply to this AutoScaling Group
autoscaling_group_vpc_zone_identifierThe VPC zone identifier
autoscaling_policy_arnsARNs of autoscaling policies
autoscaling_schedule_arnsARNs of autoscaling group schedules
iam_instance_profile_arnARN assigned by AWS to the instance profile
iam_instance_profile_idInstance profile's ID
iam_instance_profile_uniqueStable and unique string identifying the IAM instance profile
iam_role_arnThe Amazon Resource Name (ARN) specifying the IAM role
iam_role_nameThe name of the IAM role
iam_role_unique_idStable and unique string identifying the IAM role
launch_template_arnThe ARN of the launch template
launch_template_default_versionThe default version of the launch template
launch_template_idThe ID of the launch template
launch_template_latest_versionThe latest version of the launch template
launch_template_nameThe name of the launch template
What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.