Skip to content

SPHTech-Platform/terraform-aws-ecs

Repository files navigation

Requirements

Name Version
terraform >= 1.3

Providers

No providers.

Modules

Name Source Version
autoscaling_group ./modules/autoscaling-group n/a
cluster ./modules/cluster n/a
service ./modules/service n/a
service_cpu_autoscaling_policy ./modules/autoscaling-policy n/a

Resources

No resources.

Inputs

Name Description Type Default Required
asg_create Specify whether to create ASG resource bool false no
asg_desired_capacity The number of Amazon EC2 instances that should be running in the autoscaling group number null no
asg_ebs_optimized If true, the launched EC2 instance will be EBS-optimized bool true no
asg_enable_monitoring Enables/disables detailed monitoring bool true no
asg_enabled_metrics A list of metrics to collect. The allowed values are GroupDesiredCapacity, GroupInServiceCapacity, GroupPendingCapacity, GroupMinSize, GroupMaxSize, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupStandbyCapacity, GroupTerminatingCapacity, GroupTerminatingInstances, GroupTotalCapacity, GroupTotalInstances list(string)
[
"GroupDesiredCapacity",
"GroupInServiceCapacity",
"GroupPendingCapacity",
"GroupMinSize",
"GroupMaxSize",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupStandbyInstances",
"GroupStandbyCapacity",
"GroupTerminatingCapacity",
"GroupTerminatingInstances",
"GroupTotalCapacity",
"GroupTotalInstances"
]
no
asg_health_check_type EC2 or ELB. Controls how health checking is done string "ELB" no
asg_iam_instance_profile_arn The IAM Instance Profile ARN to launch the instance with string null no
asg_ignore_desired_capacity_changes Determines whether the desired_capacity value is ignored after initial apply. See README note for more details bool true no
asg_image_id The AMI from which to launch the instance string "" no
asg_instance_market_options The market (purchasing) option for the instance any null no
asg_instance_name Name that is propogated to launched EC2 instances via a tag - if not provided, defaults to var.name string "" no
asg_instance_type The type of the instance to launch string "t2.micro" no
asg_launch_template_description Description of the launch template string null no
asg_max_size The maximum size of the autoscaling group number null no
asg_min_size The minimum size of the autoscaling group number null no
asg_name Name of ASG resource string "" no
asg_network_interface_security_groups A list of security group IDs to associate list(string) null no
asg_placement The placement of the instance map(string) null no
asg_protect_from_scale_in Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events. bool false no
asg_subnets A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with availability_zones list(string) null no
asg_user_data_base64 The Base64-encoded user data to provide when launching the instance string null no
asg_volume_size Specify the volume size for the root ebs string 30 no
asg_wait_for_capacity_timeout 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. string null no
assign_public_ip Enable a public IP address for the container bool false no
capacity_providers List of short names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT. list(string) [] no
cluster_tags tags to be added to ECS cluster map(any) {} no
create_launch_template Create a launch template bool true no
default_capacity_provider_strategy The capacity provider strategy to use by default for the cluster. Can be one or more. list(map(any)) [] no
enable_execute_command Specifies whether to enable Amazon ECS Exec for the tasks within the service bool false no
launch_type The launch type on which to run your task.(EC2|FARGATE) string "EC2" no
link_ecs_to_asg_capacity_provider Specify whether to link ECS to autoscaling group capacity provider bool false no
name Name of the product/project/application string "" no
platform_version Platform version (applicable for FARGATE launch type) string "LATEST" no
service_deployment_maximum_percent Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy. number 200 no
service_deployment_minimum_healthy_percent Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. number 100 no
service_map A map of services to deploy map(any) {} no
service_max_capacity Maximum capacity of ECS autoscaling target, cannot be less than min_capacity number 4 no
service_min_capacity Minimum capacity of ECS autoscaling target, cannot be more than max_capacity number 1 no
service_scale_in_cooldown Time between scale in action number 300 no
service_scale_out_cooldown Time between scale out action number 300 no
service_security_groups Security group IDs to attach to your ECS Service list(string) [] no
service_subnets Private subnets for ECS list(string) [] no
service_tags tags to be added to task definitions map(any) {} no
service_target_cpu_value Autoscale when CPU Usage value over the specified value. Must be specified if enable_cpu_based_autoscaling is true. number 70 no
service_task_execution_role_arn Default IAM role for ECS execution string "" no
service_task_role_arn Default IAM role for ECS task string "" no
task_placement_constraints The rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10
list(object({
type = string
expression = string
}))
[] no

Outputs

Name Description
aws_ecs_task_definition ARN of the ECS service
ecs_cloudwatch_log_group_arn The cloudwatch log group to be used by the cluster
ecs_cloudwatch_log_group_name The cloudwatch log group to be used by the cluster
ecs_cluster_arn ARN of the ECS Cluster
ecs_cluster_id ID of the ECS Cluster
ecs_cluster_kms_arn The AWS Key Management Service key ID to encrypt the data between the local client and the container
ecs_cluster_name The name of the ECS cluster
ecs_service_arn ARN of the ECS service
ecs_service_name The name of the ECS service