Last active
October 6, 2022 20:39
-
-
Save kitschysynq/1f27e24ab4ab12fe89f568e2ae4707c7 to your computer and use it in GitHub Desktop.
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
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~>4.33.0" | |
} | |
} | |
} | |
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_iam_group" "admin" { | |
group_name = "Admins" | |
} | |
locals { | |
cluster_map_users = [ | |
for user in data.aws_iam_group.admin.users : { | |
userarn = user.arn | |
username = user.user_name | |
groups = ["system:masters"] | |
} | |
] | |
} | |
output "cluster_map_users" { | |
value = local.cluster_map_users | |
} | |
output "admin_users" { | |
value = data.aws_iam_group.admin.users | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment