<commit_before>data "aws_iam_policy_document" "ec2_assume_role" {
  statement {
    actions = ["sts:AssumeRole"]

    principals {
      type        = "Service"
      identifiers = ["ec2.amazonaws.com"]
    }

    effect = "Allow"
  }
}
<commit_msg>define admins iam group policy<commit_after>data "aws_iam_policy_document" "ec2_assume_role" {
  statement {
    actions = ["sts:AssumeRole"]

    principals {
      type        = "Service"
      identifiers = ["ec2.amazonaws.com"]
    }

    effect = "Allow"
  }
}

resource "aws_iam_group" "admins" {
  name = "admins"
}

resource "aws_iam_policy" "full_access_with_mfa" {
  name = "full_access_with_mfa"
  path = "/"
  description = "Allow all actions when using MFA."
  policy = data.aws_iam_policy_document.full_access_with_mfa.json
}

data "aws_iam_policy_document" "full_access_with_mfa" {
  statement {
    sid = "FullAccessWithMFA"
    effect = "Allow"
    actions = ["*"]
    resources = ["*"]
    condition {
      test     = "Bool"
      variable = "aws:MultiFactorAuthPresent"
      values   = ["true"]
    }
  }
}

resource "aws_iam_group_policy_attachment" "admins_full_access_with_mfa" {
  group      = aws_iam_group.admins.name
  policy_arn = aws_iam_policy.full_access_with_mfa.arn
}

{'fraction_non_alphanumeric': 0.11670663469224621, 'fraction_numerical': 0.0031974420463629096, 'mean_word_length': 3.258503401360544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '573430', 'n_tokens_mistral': 456, 'n_tokens_neox': 451, 'n_words': 74}