Last active
February 27, 2020 15:20
-
-
Save ezalejski/a8f8698b9925591ccb4da54c267e67e7 to your computer and use it in GitHub Desktop.
Terraform groups example
This file contains hidden or 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
#--- administrator_access_prod start--- | |
resource "aws_iam_group" "administrator_access_prod" { | |
name = "administrator-access-prod" | |
path = "/users/" | |
} | |
resource "aws_iam_group_policy" "administrator_access_prod" { | |
name = "administrator-access-prod" | |
group = aws_iam_group.administrator_access_prod.id | |
policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"sts:DecodeAuthorizationMessage", | |
"sts:GetCallerIdentity" | |
], | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": "sts:*", | |
"Resource": "arn:aws:iam::<PROD_ACCOUNT_ID>:role/administrator-access" | |
} | |
] | |
} | |
EOF | |
} | |
#--- administrator_access_prod end--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment