Skip to content

Commit

Permalink
change function to attach policy
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jun 15, 2020
1 parent 5899719 commit 928d8d2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ resource "aws_iam_user_policy" "default" {
policy = var.policy
}

resource "aws_iam_policy_attachment" "default" {
resource "aws_iam_user_policy_attachment" "default" {
count = var.enabled && var.policy_enabled && var.policy_arn != "" ? 1 : 0
name = format("%s-policy", module.labels.id)
users = [aws_iam_user.default.*.name[0]]
user = aws_iam_user.default.*.name[0]

policy_arn = var.policy_arn
}

0 comments on commit 928d8d2

Please sign in to comment.