Skip to content

shamimice03/terraform-aws-ecs-capacity-provider

Terraform module for ecs capacity provider

Requirements

Name Version
terraform >= 1.0.0
aws >= 4.0.0

Providers

Name Version
aws 5.17.0

Modules

No modules.

Resources

Name Type
aws_autoscaling_group.ecs_asg resource
aws_ecs_capacity_provider.this resource
aws_launch_template.ecs_lt resource
aws_ami.ecs_optimized data source

Inputs

Name Description Type Default Required
asg_health_check_grace_period Time in seconds after instance comes into service before checking health number 300 no
asg_health_check_type Type of health check for the Auto Scaling Group string "EC2" no
cp_managed_termination_protection Whether to enable managed termination protection for the ECS Capacity Provider string "ENABLED" no
custom_ami_id Custom AMI ID to use instead of the latest ECS-optimized AMI string null no
desired_capacity Desired number of instances in the Auto Scaling Group number 1 no
ecs_cluster_name ECS cluster name string n/a yes
ecs_cp_naming_prefix Prefix used for naming all resources string n/a yes
ecs_instance_warmup_period Time in seconds after instance comes into service before checking health number 300 no
enable_default_tags Enable default tags for EC2 instances and related resources bool true no
enable_monitoring Enable detailed monitoring for instances and ASG metrics bool true no
iam_instance_profile_name Name of the IAM instance profile for ECS instances string n/a yes
instance_key Name of the key pair to use for SSH access string "" no
instance_types List of instance types to use in the mixed instances policy list(string)
[
"t3.micro",
"t3.small"
]
no
launch_template_id ID of the Launch Template string null no
launch_template_version Version of the Launch Template number null no
managed_scaling_enabled Whether to enable managed scaling for the ECS Capacity Provider string "ENABLED" no
max_scaling_step_size Maximum number of instances to scale out at once number 10 no
max_size Maximum number of instances in the Auto Scaling Group number 1 no
min_scaling_step_size Minimum number of instances to scale out at once number 1 no
min_size Minimum number of instances in the Auto Scaling Group number 1 no
protect_from_scale_in Prevents Auto Scaling from terminating instances on scale-in bool false no
root_volume_deletion_on_termination Whether to delete root volume on instance termination bool true no
root_volume_encrypted Whether to encrypt the root volume bool true no
root_volume_size Size of the root volume in GB number 30 no
root_volume_type Type of the root volume (gp3, gp2, io1, io2) string "gp3" no
security_group_ids List of security group IDs for EC2 instances list(string) n/a yes
spot_allocation_strategy Spot instance allocation strategy: lowest-price, capacity-optimized, price-capacity-optimized string "price-capacity-optimized" no
tags Tags to apply to all resources map(string) {} no
target_capacity Target capacity percentage for the ECS cluster number 80 no
use_spot_instances Whether to use spot instances instead of on-demand bool false no
vpc_subnets List of VPC subnet IDs for the Auto Scaling Group list(string) n/a yes

Outputs

Name Description
ami_id AMI ID being used
autoscaling_group_name Name of the created Auto Scaling Group
capacity_provider_id ID of the created capacity provider
capacity_provider_name Name of the created capacity provider
launch_template_id ID of the created Launch Template
launch_template_latest_version Latest version of the created Launch Template

About

Terraform module for ECS capacity provider

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages