<commit_before>/* Configures an SNS trigger for a Lambda */
resource "random_id" "statement_id" {
  keepers = {
    # Generate a new id each time we switch to a new AMI id
    aws_sns_topic_subscription = "${aws_sns_topic_subscription.topic_lambda.id}"
  }

  byte_length = 8
}

resource "aws_lambda_permission" "allow_sns_trigger" {
  statement_id  = "${random_id.statement_id.hex}"
  action        = "lambda:InvokeFunction"
  function_name = "${var.lambda_function_arn}"
  principal     = "sns.amazonaws.com"
  source_arn    = "${var.sns_trigger_arn}"
  depends_on    = ["aws_sns_topic_subscription.topic_lambda"]
}

resource "aws_sns_topic_subscription" "topic_lambda" {
  topic_arn = "${var.sns_trigger_arn}"
  protocol  = "lambda"
  endpoint  = "${var.lambda_function_arn}"
}
<commit_msg>Correct comment<commit_after>/* Configures an SNS trigger for a Lambda */
resource "random_id" "statement_id" {
  keepers = {
    # Generate a new id each time we switch to a new topic subscription
    aws_sns_topic_subscription = "${aws_sns_topic_subscription.topic_lambda.id}"
  }

  byte_length = 8
}

resource "aws_lambda_permission" "allow_sns_trigger" {
  statement_id  = "${random_id.statement_id.hex}"
  action        = "lambda:InvokeFunction"
  function_name = "${var.lambda_function_arn}"
  principal     = "sns.amazonaws.com"
  source_arn    = "${var.sns_trigger_arn}"
  depends_on    = ["aws_sns_topic_subscription.topic_lambda"]
}

resource "aws_sns_topic_subscription" "topic_lambda" {
  topic_arn = "${var.sns_trigger_arn}"
  protocol  = "lambda"
  endpoint  = "${var.lambda_function_arn}"
}

{'fraction_non_alphanumeric': 0.115, 'fraction_numerical': 0.00125, 'mean_word_length': 4.559027777777778, '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': '3850966', 'n_tokens_mistral': 548, 'n_tokens_neox': 554, 'n_words': 107}