From 43edadd75d3b5ea4c371e13770a900a140a57580 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 17 Nov 2026 08:52:05 -0300 Subject: [PATCH] boot log: each role's policy names its document by key for_each over the policy documents themselves handed each.value - the whole data source, its deprecated source_json and override_json among it - to the policy, and every plan warned of it. The documents are named by key instead; the policies are the same. Co-Authored-By: Claude Opus 5.5 --- modules/controlplane/boot_log.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/controlplane/boot_log.tf b/modules/controlplane/boot_log.tf index bb3bc9a..f862cb2 100644 --- a/modules/controlplane/boot_log.tf +++ b/modules/controlplane/boot_log.tf @@ -28,11 +28,11 @@ data "aws_iam_policy_document" "boot_log" { } resource "aws_iam_policy" "boot_log" { - for_each = data.aws_iam_policy_document.boot_log + for_each = toset(keys(data.aws_iam_policy_document.boot_log)) name = "${local.iam_name}-${each.key}-boot-log" description = "Write a ${each.key} machine's boot to ${aws_cloudwatch_log_group.boot.name}, under ${each.key}/, and nothing else" - policy = each.value.json + policy = data.aws_iam_policy_document.boot_log[each.key].json tags = local.tags }