We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 263410b commit 506e3acCopy full SHA for 506e3ac
aws_cloudwatch_observability.tf
@@ -3,10 +3,10 @@
3
################################################################################
4
5
resource "aws_iam_role_policy_attachment" "aws_cloudwatch_observability" {
6
- for_each = { for k, v in {
+ for_each = var.create && var.attach_aws_cloudwatch_observability_policy ? {
7
CloudWatchAgentServerPolicy = "arn:${local.partition}:iam::aws:policy/CloudWatchAgentServerPolicy"
8
AWSXrayWriteOnlyAccess = "arn:${local.partition}:iam::aws:policy/AWSXrayWriteOnlyAccess"
9
- } : k => v if var.create && var.attach_aws_cloudwatch_observability_policy }
+ } : {}
10
11
role = aws_iam_role.this[0].name
12
policy_arn = each.value
0 commit comments