Created
May 21, 2021 20:27
-
-
Save jpfielding/5d3ce5e67840b34f3876caf2d24a14fd to your computer and use it in GitHub Desktop.
Generate a aws-auth iam for the mapUsers section
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
# https://github.com/kubernetes-sigs/aws-iam-authenticator/issues/176 | |
data "aws_caller_identity" "current" {} | |
data "aws_iam_group" "ops" { | |
group_name = "Ops" | |
} | |
provider "aws" { | |
profile = var.aws_profile | |
region = var.aws_region | |
} | |
output "users" { | |
value = [ | |
for user in data.aws_iam_group.ops.users : | |
{ | |
user_arn = join("", ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:user/", user.user_name]) | |
username = user.user_name | |
group = "system:masters" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment