Created
February 18, 2022 20:23
-
-
Save sairamkrish/7c2e6a2e30cc6cae6c853d04f7bd0fa3 to your computer and use it in GitHub Desktop.
terraform for_each reference example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iam_policy" "my_node_policy" { | |
name = format("node_policy_%s", var.environment) | |
policy = jsonencode({ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:CreateNetworkInterface", | |
"ec2:DeleteNetworkInterface", | |
], | |
"Resource": "*" | |
}, | |
{ | |
"Action":"secretsmanager:GetSecretValue", | |
"Effect":"Allow", | |
"Resource": [ | |
"${aws_secretsmanager_secret.powerapp_secrets["app_1"].arn}", | |
"${aws_secretsmanager_secret.powerapp_secrets["app_2"].arn}" | |
] | |
} | |
] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment