ec2-asg

cn-terraform/ec2-asg/aws

Terraform Module HCL AWS

AWS EC2 Auto Scaling Terraform Module

Install
module "ec2-asg" {
source = "cn-terraform/ec2-asg/aws"
version = "1.0.8"
}
plain text: /constructs/tfmod-cn-terraform-ec2-asg-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

AWS EC2 Auto Scaling Terraform Module # This Terraform module deploys an AWS EC2 Auto Scaling Group. ![](https://github.com/cn-terraform/terraform-aws-ec2-asg/actions?query=workflow%3Aterraform) ![](https://github.com/cn-terraform/terraform-aws-ec2-asg) ![](https://github.com/cn-terraform/terraform-aws-ec2-asg) ![](https://github.com/cn-terraform/terraform-aws-ec2-asg) ![](https://github.com/cn-terraform/terraform-aws-ec2-asg) ![](https://github.com/cn-terraform/terraform-aws-ec2-asg) Usage Check valid versions on: Github Releases: Terraform Module Registry: Install pre commit hooks. Pleas run this command right after cloning the repository. pre-commit install For that you may need to install the folowwing tools: Pre-commit Terraform Docs In order to run all checks at any point run the fol

Inputs (39)
NameTypeDescriptionDefault
associate_public_ip_addressbool(Optional) Associate a public ip address with an instance in a VPC. required
image_idstringThe EC2 image ID to launch. required
min_sizenumberThe minimum size of the auto scale group. (See also Waiting for Capacity.) required
name_prefixstringName prefix for resources on AWS required
instance_typestringThe size of instance to launch. required
max_sizenumberThe maximum size of the auto scale group. required
load_balancerslist(any)(Optional) A list of elastic load balancer names to add to the autoscaling group[]
target_group_arnslist(any)(Optional) A list of aws_alb_target_group ARNs, for use with Application or Netw[]
termination_policieslist(any)(Optional) A list of policies to decide how the instances in the auto scale grou[ "Default" ]
min_elb_capacitynumber(Optional) Setting this causes Terraform to wait for this number of instances fr0
vpc_classic_link_idstring(Optional) The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic inst""
ebs_optimizedbool(Optional) If true, the launched EC2 instance will be EBS-optimized.false
placement_tenancystring(Optional) The tenancy of the instance. Valid values are "default" or "dedicated"default"
protect_from_scale_inbool(Optional) Allows setting instance protection. The autoscaling group will not sefalse
iam_instance_profilestring(Optional) The name attribute of the IAM instance profile to associate with laun""
force_deletebool(Optional) Allows deleting the autoscaling group without waiting for all instancfalse
wait_for_capacity_timeoutstring(Optional) A maximum duration that Terraform should wait for ASG instances to be"10m"
spot_pricestring(Optional) The maximum price to use for reserving spot instances. (Default: On-d""
desired_capacitynumber(Optional) The number of Amazon EC2 instances that should be running in the grou1
enabled_metricslist(any)(Optional) A list of metrics to collect. The allowed values are GroupMinSize, Gr[ "GroupMinSize", "GroupMaxSize",
service_linked_role_arnstring(Optional) The ARN of the service-linked role that the ASG will use to call othe""
vpc_zone_identifierlist(any)(Optional) A list of subnet IDs to launch resources in.null
metrics_granularitystring(Optional) The granularity to associate with the metrics to collect. The only va"1Minute"
enable_monitoringbool(Optional) Enables/disables detailed monitoring. This is enabled by default.true
ebs_block_devicelist(any)(Optional) Additional EBS block devices to attach to the instance. This is a lis[]
user_data_base64string(Optional) Can be used instead of user_data to pass base64-encoded binary data dnull
Outputs (30)
cpu_low_autoscaling_group_name — The scaling policy's assigned autoscaling group.
lc_name — The name of the launch configuration.
asg_desired_capacity — The number of Amazon EC2 instances that should be running in the group.
asg_vpc_zone_identifier — (Optional) The VPC zone identifier.
asg_load_balancers — (Optional) The load balancer names associated with the autoscaling group.
cpu_high_adjustment_type — The scaling policy's adjustment type.
lc_id — The ID of the launch configuration.
asg_id — The autoscaling group id.
asg_name — The name of the autoscale group.
asg_health_check_grace_period — Time after instance comes into service before checking health.
cpu_low_name — The scaling policy's name.
asg_arn — The ARN for this AutoScaling Group.
asg_launch_configuration — The launch configuration of the autoscale group.
cpu_high_policy_type — The scaling policy's type.
cpu_low_alarm_id — The ID of the health check.
asg_availability_zones — The availability zones of the autoscale group.
asg_target_group_arns — (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
cpu_high_alarm_id — The ID of the health check.
asg_default_cooldown — Time between a scaling activity and the succeeding scaling activity.
cpu_high_name — The scaling policy's name.
cpu_high_autoscaling_group_name — The scaling policy's assigned autoscaling group.
cpu_low_alarm_arn — (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
asg_min_size — The minimum size of the autoscale group.
cpu_high_arn — The ARN assigned by AWS to the scaling policy.
cpu_low_arn — The ARN assigned by AWS to the scaling policy.
asg_max_size — The maximum size of the autoscale group.
asg_health_check_type — "EC2" or "ELB". Controls how health checking is done.
cpu_low_adjustment_type — The scaling policy's adjustment type.
cpu_low_policy_type — The scaling policy's type.
cpu_high_alarm_arn — (Optional) list of Target Group ARNs that apply to this AutoScaling Group.
Resources (4)
aws_autoscaling_groupaws_autoscaling_policyaws_cloudwatch_metric_alarmaws_launch_configuration
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.8
Cloud AWS
★ Stars6
Forks12
Total downloads6.6k
Inputs39
Outputs30
Resources4
Examples1
LicenseApache-2.0
Namespacecn-terraform
Updated