Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dmlayton
Last active May 28, 2020 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmlayton/e7eea84bc1a0ba57871f188b5aff82ee to your computer and use it in GitHub Desktop.
Save dmlayton/e7eea84bc1a0ba57871f188b5aff82ee to your computer and use it in GitHub Desktop.
resource "aws_iam_user" "client" {
count = length(var.users)
name = element(var.users, count.index)
}
resource "aws_iam_access_key" "client" {
count = length(var.users)
user = element(aws_iam_user.client, count.index).name
}
resource "aws_iam_group_membership" "client" {
name = "${var.client.name}-membership"
group = var.client.name
users = aws_iam_user.client[*].name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment