From 493004690b0ff4e4207ca05f7eedeb6e3da198ea Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 12 Dec 2023 19:29:55 +0000 Subject: [PATCH 1/4] Add empty tags map to task definition --- terraform/ecs_redwood_console.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terraform/ecs_redwood_console.tf b/terraform/ecs_redwood_console.tf index d89d3543..d6752779 100644 --- a/terraform/ecs_redwood_console.tf +++ b/terraform/ecs_redwood_console.tf @@ -187,6 +187,9 @@ resource "aws_ecs_task_definition" "console" { lifecycle { create_before_destroy = true } + + // Empty map prevents `{} -> null` perma-diff in plans + tags = {} } module "ecs_console_security_group" { From 6e39fc5a0272c45988622f62b09237556b4627cb Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 12 Dec 2023 19:41:53 +0000 Subject: [PATCH 2/4] Set null tags on resource --- terraform/ecs_redwood_console.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/ecs_redwood_console.tf b/terraform/ecs_redwood_console.tf index d6752779..49f64efb 100644 --- a/terraform/ecs_redwood_console.tf +++ b/terraform/ecs_redwood_console.tf @@ -189,7 +189,7 @@ resource "aws_ecs_task_definition" "console" { } // Empty map prevents `{} -> null` perma-diff in plans - tags = {} + tags = null } module "ecs_console_security_group" { From 2acb1b431b8af8667ef2e3946688810ea30ae7b2 Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 12 Dec 2023 19:47:51 +0000 Subject: [PATCH 3/4] Propagate task definition tags from service --- terraform/ecs_redwood_console.tf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/terraform/ecs_redwood_console.tf b/terraform/ecs_redwood_console.tf index 49f64efb..7cb07f28 100644 --- a/terraform/ecs_redwood_console.tf +++ b/terraform/ecs_redwood_console.tf @@ -187,9 +187,6 @@ resource "aws_ecs_task_definition" "console" { lifecycle { create_before_destroy = true } - - // Empty map prevents `{} -> null` perma-diff in plans - tags = null } module "ecs_console_security_group" { @@ -211,6 +208,7 @@ resource "aws_ecs_service" "console" { desired_count = 1 launch_type = "FARGATE" enable_execute_command = true + propagate_tags = "SERVICE" network_configuration { assign_public_ip = false From 6c69abc7ea9182a952056ec3ce055f1466c8617d Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 12 Dec 2023 20:05:09 +0000 Subject: [PATCH 4/4] Re-add empty tag map --- terraform/ecs_redwood_console.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/ecs_redwood_console.tf b/terraform/ecs_redwood_console.tf index 7cb07f28..70cf88d0 100644 --- a/terraform/ecs_redwood_console.tf +++ b/terraform/ecs_redwood_console.tf @@ -175,6 +175,7 @@ resource "aws_ecs_task_definition" "console" { network_mode = "awsvpc" requires_compatibilities = ["FARGATE"] container_definitions = jsonencode([module.ecs_console_container_definition.json_map_object]) + tags = {} cpu = 512 memory = 1024