From acd1fcac76d04f65779fdf6640eea5bc84bcdbba Mon Sep 17 00:00:00 2001 From: badra001 Date: Wed, 12 May 2021 12:08:44 -0400 Subject: [PATCH] fix --- README.md | 2 +- main.tf | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fedc8b7..fe5f5b8 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ No requirements. | Name | Type | |------|------| -| [aws_iam_policy_attachment.user_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy_attachment) | resource | | [aws_iam_user.user](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource | | [aws_iam_user_group_membership.user_groups](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_group_membership) | resource | | [aws_iam_user_login_profile.user](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource | +| [aws_iam_user_policy_attachment.user_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource | | [aws_ses_email_identity.user_send_mail](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ses_email_identity) | resource | | [aws_arn.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source | | [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | diff --git a/main.tf b/main.tf index 239012d..f0e14eb 100644 --- a/main.tf +++ b/main.tf @@ -130,10 +130,9 @@ module "user_email" { attribute = "mail" } -resource "aws_iam_policy_attachment" "user_policy" { +resource "aws_iam_user_policy_attachment" "user_policy" { for_each = local.attached_policies - name = format("%v-attachment", each.key) - users = aws_iam_user.user.name + user = aws_iam_user.user.name policy_arn = each.value }