<commit_before>data "aws_iam_policy_document" "cloudwatch_assume_role" {
  statement {
    actions = [
      "sts:AssumeRole"
    ]
    principals {
      identifiers = [
        "cloudtrail.amazonaws.com"
      ]
      type = "Service"
    }
  }
}

resource "aws_iam_role" "cloudwatch_logs" {
  assume_role_policy = "${data.aws_iam_policy_document.cloudwatch_assume_role.json}"
  name = "${var.account_name}-cloudtrail"
}

resource "aws_cloudwatch_log_group" "cloudtrail" {
  name              = "${var.account_name}-trail"
  retention_in_days = 7
}

data "aws_iam_policy_document" "cloudwatch_logs_role" {
  statement {
    actions = [
      "logs:CreateLogStream",
      "logs:PutLogEvents"
    ]
    resources = [
      "${aws_cloudwatch_log_group.cloudtrail.arn}"
    ]
    sid = "AWSCloudTrailLogging"
  }
}

resource "aws_iam_role_policy" "cloudwatch_logs" {
  policy  = "${data.aws_iam_policy_document.cloudwatch_logs_role.json}"
  role    = "${aws_iam_role.cloudwatch_logs.id}"
}
<commit_msg>added a name to the inline policy<commit_after>data "aws_iam_policy_document" "cloudwatch_assume_role" {
  statement {
    actions = [
      "sts:AssumeRole"
    ]
    principals {
      identifiers = [
        "cloudtrail.amazonaws.com"
      ]
      type = "Service"
    }
  }
}

resource "aws_iam_role" "cloudwatch_logs" {
  assume_role_policy = "${data.aws_iam_policy_document.cloudwatch_assume_role.json}"
  name = "${var.account_name}-cloudtrail"
}

resource "aws_cloudwatch_log_group" "cloudtrail" {
  name              = "${var.account_name}-trail"
  retention_in_days = 7
}

data "aws_iam_policy_document" "cloudwatch_logs_role" {
  statement {
    actions = [
      "logs:CreateLogStream",
      "logs:PutLogEvents"
    ]
    resources = [
      "${aws_cloudwatch_log_group.cloudtrail.arn}"
    ]
    sid = "AWSCloudTrailLogging"
  }
}

resource "aws_iam_role_policy" "cloudwatch_logs" {
  name    = "cloudwatch-logs"
  policy  = "${data.aws_iam_policy_document.cloudwatch_logs_role.json}"
  role    = "${aws_iam_role.cloudwatch_logs.id}"
}

{'fraction_non_alphanumeric': 0.11988304093567251, 'fraction_numerical': 0.0009746588693957114, 'mean_word_length': 3.4630434782608694, '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': '1333953', 'n_tokens_mistral': 738, 'n_tokens_neox': 741, 'n_words': 94}