We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c14524e commit fa0bed2Copy full SHA for fa0bed2
main.tf
@@ -256,13 +256,17 @@ resource "aws_iam_role" "this" {
256
}
257
258
resource "aws_iam_role_policy_attachment" "this" {
259
- for_each = toset(module.this.enabled ? [
260
- "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
261
- resource.aws_iam_policy.this[0].arn
262
- ] : [])
+ count = module.this.enabled ? 1 : 0
+
+ role = resource.aws_iam_role.this[0].name
+ policy_arn = resource.aws_iam_policy.this[0].arn
263
+}
264
265
+resource "aws_iam_role_policy_attachment" "ssm_managed_instance_core" {
266
267
268
role = resource.aws_iam_role.this[0].name
- policy_arn = each.key
269
+ policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
270
271
272
resource "aws_iam_policy" "this" {
0 commit comments