A modified version of https://github.com/cloudposse/terraform-aws-ecs-alb-service-task
module "ecs-alb-service-task" {
source = "github.com/globeandmail/aws-ecs-alb-service-task?ref=1.0"
namespace = var.app_name
stage = var.stage_name
name = var.app_name
alb_target_group_arn = var.target_group_arn
container_definition_json = module.container-defs.json
container_name = var.app_name
ecs_cluster_arn = module.ecs-cluster.ecs_cluster_arn
launch_type = "EC2"
vpc_id = var.vpc_id
alb_security_group = module.alb_sg.this_security_group_id
security_group_ids = []
container_port = 8080
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
alb_security_group | Security group of the ALB | string | n/a | yes |
alb_target_group_arn | The ALB target group ARN for the ECS service | string | n/a | yes |
container_definition_json | The JSON of the task container definition | string | n/a | yes |
container_name | The name of the container in task definition to associate with the load balancer | string | n/a | yes |
ecs_cluster_arn | The ARN of the ECS cluster where service will be provisioned | string | n/a | yes |
name | Solution name, e.g. 'app' or 'cluster' | string | n/a | yes |
namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | string | n/a | yes |
security_group_ids | Security group IDs to allow in Service network\_configuration |
list | n/a | yes |
stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | n/a | yes |
vpc_id | The VPC ID where resources are created | string | n/a | yes |
assign_public_ip | Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false. | string | "false" |
no |
attributes | Additional attributes (e.g. 1 ) |
list | [] |
no |
container_port | The port on the container to associate with the load balancer | string | "80" |
no |
delimiter | Delimiter to be used between name , namespace , stage , etc. |
string | "-" |
no |
deployment_controller_type | Type of deployment controller. Valid values: CODE\_DEPLOY , ECS . |
string | "ECS" |
no |
deployment_maximum_percent | The upper limit of the number of tasks (as a percentage of desired\_count ) that can be running in a service during a deployment |
string | "200" |
no |
deployment_minimum_healthy_percent | The lower limit (as a percentage of desired\_count ) of the number of tasks that must remain running and healthy in a service during a deployment |
string | "100" |
no |
desired_count | The number of instances of the task definition to place and keep running | string | "1" |
no |
health_check_grace_period_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers | string | "0" |
no |
ignore_changes_task_definition | Whether to ignore changes in container definition and task definition in the ECS service | string | "true" |
no |
launch_type | The launch type on which to run your service. Valid values are EC2 and FARGATE |
string | "FARGATE" |
no |
network_mode | The network mode to use for the task. This is required to be awsvpc for FARGATE launch\_type |
string | "awsvpc" |
no |
tags | Additional tags (e.g. map\('BusinessUnit ,XYZ ) |
map | {} |
no |
task_cpu | The number of CPU units used by the task. If using FARGATE launch type task\_cpu must match supported memory values (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task\_definition\_parameters.html#task\_size\) |
string | "256" |
no |
task_memory | The amount of memory (in MiB) used by the task. If using Fargate launch type task\_memory must match supported cpu value (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task\_definition\_parameters.html#task\_size\) |
string | "512" |
no |
Name | Description |
---|---|
ecs_exec_role_policy_id | The ECS service role policy ID, in the form of role_name:role_policy_name |
ecs_exec_role_policy_name | ECS service role name |
service_name | ECS Service name |
service_role_arn | ECS Service role ARN |
service_security_group_id | Security Group ID of the ECS task |
task_definition_family | ECS task definition family |
task_definition_revision | ECS task definition revision |
task_exec_role_arn | ECS Task exec role ARN |
task_exec_role_name | ECS Task role name |
task_role_arn | ECS Task role ARN |
task_role_id | ECS Task role id |
task_role_name | ECS Task role name |