Skip to content

Commit

Permalink
Merge pull request #40 from Flaconi/OPS-3940-cleanup-iam-user-policy
Browse files Browse the repository at this point in the history
OPS-3940 remove iam user inline policies for sqs*
  • Loading branch information
ronny-panknin-flaconi authored Oct 13, 2020
2 parents dc6ba16 + cf35ff3 commit 11e7562
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,6 @@ resource "aws_iam_role_policy" "sqs1_role_policy" {
policy = data.aws_iam_policy_document.sqs1_full_access[0].json
}


resource "aws_iam_user_policy" "sqs1_role_policy" {
count = var.sqs1_enabled && var.iam_user_enabled ? 1 : 0

user = concat(aws_iam_user.this.*.name, [""])[0]
name = "sqs1-policy"

# This defines what permissions our role will be given
policy = data.aws_iam_policy_document.sqs1_full_access[0].json
}

##
## SQS 2
##
Expand Down Expand Up @@ -448,17 +437,6 @@ resource "aws_iam_role_policy" "sqs2_role_policy" {
policy = data.aws_iam_policy_document.sqs2_full_access[0].json
}


resource "aws_iam_user_policy" "sqs2_role_policy" {
count = var.sqs2_enabled && var.iam_user_enabled ? 1 : 0

user = concat(aws_iam_user.this.*.name, [""])[0]
name = "sqs2-policy"

# This defines what permissions our role will be given
policy = data.aws_iam_policy_document.sqs2_full_access[0].json
}

##
## SQS 3
##
Expand Down Expand Up @@ -509,17 +487,6 @@ resource "aws_iam_role_policy" "sqs3_role_policy" {
policy = data.aws_iam_policy_document.sqs3_full_access[0].json
}


resource "aws_iam_user_policy" "sqs3_role_policy" {
count = var.sqs3_enabled && var.iam_user_enabled ? 1 : 0

user = concat(aws_iam_user.this.*.name, [""])[0]
name = "sqs3-policy"

# This defines what permissions our role will be given
policy = data.aws_iam_policy_document.sqs3_full_access[0].json
}

##
## SQS 4
##
Expand Down Expand Up @@ -570,17 +537,6 @@ resource "aws_iam_role_policy" "sqs4_role_policy" {
policy = data.aws_iam_policy_document.sqs4_full_access[0].json
}


resource "aws_iam_user_policy" "sqs4_role_policy" {
count = var.sqs4_enabled && var.iam_user_enabled ? 1 : 0

user = concat(aws_iam_user.this.*.name, [""])[0]
name = "sqs4-policy"

# This defines what permissions our role will be given
policy = data.aws_iam_policy_document.sqs4_full_access[0].json
}

##
## SQS 5
##
Expand Down Expand Up @@ -631,17 +587,6 @@ resource "aws_iam_role_policy" "sqs5_role_policy" {
policy = data.aws_iam_policy_document.sqs5_full_access[0].json
}


resource "aws_iam_user_policy" "sqs5_role_policy" {
count = var.sqs5_enabled && var.iam_user_enabled ? 1 : 0

user = concat(aws_iam_user.this.*.name, [""])[0]
name = "sqs5-policy"

# This defines what permissions our role will be given
policy = data.aws_iam_policy_document.sqs5_full_access[0].json
}

##
## IAM Extra inline policies
##
Expand Down

0 comments on commit 11e7562

Please sign in to comment.