Created
February 1, 2021 11:19
-
-
Save phisinees/66b117e78056c0efb9ff51013112953c to your computer and use it in GitHub Desktop.
create iam users group with role
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_group" "business_intelligence_group" { | |
name = "Business_Intelligence" | |
} | |
resource "aws_iam_group_membership" "business_intelligence_group_members" { | |
group = aws_iam_group.business_intelligence_group.name | |
name = "Business_Intelligence_Membership" | |
users = [] | |
} | |
resource "aws_iam_group_policy_attachment" "business_intelligence_group" { | |
group = aws_iam_group.business_intelligence_group.name | |
policy_arn = aws_iam_policy.business_intelligence_policy.arn | |
} | |
resource "aws_iam_policy" "business_intelligence_policy" { | |
name = "bi_group_policy" | |
policy = data.aws_iam_policy_document.business_intelligence_policy_document.json | |
} | |
data "aws_iam_policy_document" "business_intelligence_policy_document" { | |
statement { | |
effect = "Allow" | |
actions = ["sts:AssumeRole"] | |
resources = [ | |
"arn:aws:iam::${local.master_account_id}:role/Business_Intelligence", | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment