Skip to content

Latest commit

 

History

History
 
 

ecs-service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

AWS ECS AutoScaling

Requirements

Name Version
terraform >= 1.0.0
aws >= 3.72.0

Providers

Name Version
aws >= 3.72.0

Modules

Name Source Version
container_definition ../ecs-container-definition n/a

Resources

Name Type
aws_appautoscaling_policy.cpu resource
aws_appautoscaling_policy.memory resource
aws_appautoscaling_scheduled_action.scale_down resource
aws_appautoscaling_scheduled_action.scale_up resource
aws_appautoscaling_target.this resource
aws_cloudwatch_metric_alarm.high_cpu_policy_alarm resource
aws_cloudwatch_metric_alarm.high_memory_policy_alarm resource
aws_ecs_service.this resource
aws_ecs_task_definition.this resource
aws_iam_role.task resource
aws_iam_role_policy.task resource
aws_iam_policy_document.task data source

Inputs

Name Description Type Default Required
attach_task_role_policy Attach the task role policy to the task role bool true no
autoscaling_cpu_threshold The desired threashold for CPU consumption number 75 no
autoscaling_max_capacity The maximum number of tasks to provision number 3 no
autoscaling_memory_threshold The desired threashold for memory consumption number 75 no
autoscaling_min_capacity The minimum number of tasks to provision number 1 no
container_definition_defaults Default values to use on all container definitions created if a specific value is not specified any {} no
container_definitions Map of maps that define container definitions to create any {} no
cp_strategy_base Base number of tasks to create on Fargate on-demand number 1 no
cp_strategy_fg_spot_weight Relative number of tasks to put in Fargate Spot number 0 no
cp_strategy_fg_weight Relative number of tasks to put in Fargate number 1 no
cpu The number of cpu units used by the task. number 256 no
deployment_controller Specifies which deployment controller to use for the service. string "ECS" no
deployment_maximum_percent Maximum percentage of task able to be deployed number 200 no
deployment_minimum_healthy_percent The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. number 100 no
desired_count The desired number of instantiations of the task definition to keep running on the service. number 1 no
ecs_cluster_id The ECS cluster ID in which the resources will be created string n/a yes
enable_autoscaling Determines whether autoscaling is enabled for the service bool false no
enable_ecs_managed_tags Specifies whether to enable Amazon ECS managed tags for the tasks within the service. bool true no
enable_execute_command Specifies whether to enable Amazon ECS Exec for the tasks within the service. bool false no
enable_scheduled_autoscaling Determines whether scheduled autoscaling is enabled for the service bool false no
execution_role_arn ecs-blueprint-infra ECS execution ARN string n/a yes
health_check_grace_period_seconds Number of seconds for the task health check number 30 no
lb_container_name The container name for the LB string null no
lb_container_port The port that the container will use to listen to requests number null no
load_balancers A list of load balancer config objects for the ECS service
list(object({
target_group_arn = string
}))
[] no
memory The number of cpu units used by the task. number 1024 no
name The name for the ecs service string n/a yes
operating_system_family The OS family for task string "LINUX" no
platform_version Platform version on which to run your service string null no
propagate_tags Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION. string "SERVICE" no
scheduled_autoscaling_down_max_capacity The maximum number of tasks to provision number 3 no
scheduled_autoscaling_down_min_capacity The minimum number of tasks to provision number 1 no
scheduled_autoscaling_down_time Timezone which scheduled scaling occurs string "cron(0 20 * * ? *)" no
scheduled_autoscaling_timezone Timezone which scheduled scaling occurs string "America/Los_Angeles" no
scheduled_autoscaling_up_max_capacity The maximum number of tasks to provision number 6 no
scheduled_autoscaling_up_min_capacity The minimum number of tasks to provision number 4 no
scheduled_autoscaling_up_time Timezone which scheduled scaling occurs string "cron(0 6 * * ? *)" no
security_groups Security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used. list(string) n/a yes
service_registry_list A list of service discovery registry names for the service
list(object({
registry_arn = string
}))
[] no
subnets Subnets associated with the task or service. list(string) n/a yes
tags tags map(string) {} no
task_cpu_architecture CPU architecture X86_64 or ARM64 string "X86_64" no
task_role_policy The task's role policy string null no

Outputs

Name Description
arn The ECS Service ARN
container_name The name of the container
id The ECS Service ID
name The ECS Service Name
task_definition_arn The ARN of the task definition
task_definition_family The family name of the task definition
task_role_arn The ARN of the task role