Skip to content

Commit 50690a4

Browse files
committed
fix: define container_insights as an enum
1 parent 0a6aba0 commit 50690a4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

_variables.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,13 @@ variable "extra_task_policies_arn" {
368368
}
369369

370370
variable "container_insights" {
371-
type = bool
372-
default = false
371+
type = string
372+
default = "disabled"
373373
description = "Enables CloudWatch Container Insights for a cluster."
374+
validation {
375+
condition = contains(["enhanced", "enabled", "disabled"], var.container_insights)
376+
error_message = "Container Insights must be one of: enhanced, enabled, disabled."
377+
}
374378
}
375379

376380
variable "alb_test_listener" {

ecs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resource "aws_ecs_cluster" "ecs" {
33

44
setting {
55
name = "containerInsights"
6-
value = var.container_insights ? "enabled" : "disabled"
6+
value = var.container_insights
77
}
88

99
tags = merge(
@@ -13,7 +13,7 @@ resource "aws_ecs_cluster" "ecs" {
1313
},
1414
)
1515
lifecycle {
16-
ignore_changes = []
16+
ignore_changes = [service_connect_defaults]
1717

1818
}
1919
}

0 commit comments

Comments
 (0)