Skip to content

Commit 5cbb34d

Browse files
authored
fix(eks_standard): break terraform locals cycle in cluster addons (#348)
needs_cloudwatch_iam_policy was derived from enabled_cluster_addons, which depends on default_addons, which references aws_iam_role.cloudwatch_agent_irsa[0].arn. That role's count then referenced needs_cloudwatch_iam_policy, closing the cycle. Source needs_cloudwatch_iam_policy directly from container_insights_enabled (spec input), which already gates inclusion of the cloudwatch addon.
1 parent 3d5e040 commit 5cbb34d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • modules/kubernetes_cluster/eks_standard/1.0

modules/kubernetes_cluster/eks_standard/1.0/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ locals {
119119

120120
# Container Insights
121121
container_insights_enabled = lookup(var.instance.spec, "container_insights_enabled", false)
122-
needs_cloudwatch_iam_policy = contains(keys(local.enabled_cluster_addons), "amazon-cloudwatch-observability")
122+
needs_cloudwatch_iam_policy = local.container_insights_enabled
123123

124124
# KMS key for secrets encryption (only if enabled)
125125
enable_kms_key = lookup(var.instance.spec, "customer_managed_kms", true)

0 commit comments

Comments
 (0)