Ensure IAM groups include at least one IAM user

Error: IAM groups do not include at least one IAM user

Bridgecrew Policy ID: BC_AWS_IAM_61
Checkov Check ID: CKV2_AWS_14
Severity: LOW

IAM groups do not include at least one IAM user

Description

TBA

Fix - Buildtime

Terraform

  • Resource: aws_iam_group_membership, aws_iam_group, aws_iam_user
  • Argument: name and users of aws_iam_group_membership
resource "aws_iam_group_membership" "ok_group" {
  name = "tf-testing-group-membership"

  users = [
    aws_iam_user.user_one.name,
    aws_iam_user.user_two.name,
  ]

  group = aws_iam_group.group.name
}

resource "aws_iam_group" "group" {
  name = "test-group"
}

resource "aws_iam_user" "user_one" {
  name = "test-user"
}

resource "aws_iam_user" "user_two" {
  name = "test-user-two"
}

Did this page help you?