diff --git a/main.tf b/main.tf index c70b1ec..1a06373 100644 --- a/main.tf +++ b/main.tf @@ -71,6 +71,8 @@ resource "aws_ecs_service" "service_no_autoscaling" { task_definition = aws_ecs_task_definition.task.arn launch_type = "FARGATE" + enable_execute_command = var.enable_execute_command + network_configuration { security_groups = [local.security_group_id] subnets = var.subnet_ids @@ -126,6 +128,8 @@ resource "aws_ecs_service" "service_autoscaling" { task_definition = aws_ecs_task_definition.task.arn launch_type = "FARGATE" + enable_execute_command = var.enable_execute_command + network_configuration { security_groups = [local.security_group_id] subnets = var.subnet_ids diff --git a/variables.tf b/variables.tf index 76cfd12..924e7a5 100644 --- a/variables.tf +++ b/variables.tf @@ -184,4 +184,10 @@ variable "ephemeral_storage_gib" { description = "The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is 21 GiB and the maximum supported value is 200 GiB." type = number default = 21 -} \ No newline at end of file +} + +variable "enable_execute_command" { + description = "Specifies whether to enable Amazon ECS Exec for the tasks within the service." + type = bool + default = false +}