<commit_before>resource "aws_iam_policy" "topic_policy" {
    name = "${var.environment}-${var.deployment}-${var.service}-sender"
    path = "/"
    description = "Sender policy"
    policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "sns:Publish"
      ],
      "Effect": "Allow",
      "Resource": "${aws_sns_topic.edx-pipeline-provision.arn}"
    },
    {
      "Action": [
        "sns:Publish"
      ],
      "Effect": "Allow",
      "Resource": "${aws_sns_topic.edx-pipeline-sitespeed.arn}"
    }
  ]
}
EOF
}

# Configure the AWS Provider
provider "aws" {
    access_key = "${var.aws_access_key}"
    secret_key = "${var.aws_secret_key}"
    region = "us-east-1"
}



# pipeline-provision infrastructure
resource "aws_sqs_queue" "edx-pipeline-provision" {
	name = "${var.queue_name_pipeline}"
	delay_seconds = "${var.queue_delay_seconds}"
	max_message_size = "${var.queue_max_message_size}"
	message_retention_seconds = "${var.queue_message_retention_seconds}"
	receive_wait_time_seconds = "${var.queue_receive_wait_time_seconds}"
}

resource "aws_sns_topic" "edx-pipeline-provision" {
  name = "edx-pipeline-provision-topic"
  policy = "topic_policy"
}

resource "aws_sns_topic_subscription" "edx-pipeline-provision_sqs_target" {
  topic_arn = "${aws_sns_topic.edx-pipeline-provision.arn}"
  protocol  = "sqs"
  endpoint  = "${aws_sqs_queue.edx-pipeline-provision.arn}"
}



# pipeline-sitespeed infrastructure
resource "aws_sqs_queue" "edx-pipeline-sitespeed" {
  name = "${var.queue_name_sitespeed}"
  delay_seconds = "${var.queue_delay_seconds}"
  max_message_size = "${var.queue_max_message_size}"
  message_retention_seconds = "${var.queue_message_retention_seconds}"
  receive_wait_time_seconds = "${var.queue_receive_wait_time_seconds}"
}

resource "aws_sns_topic" "edx-pipeline-sitespeed" {
  name = "edx-pipeline-sitespeed-topic"
  policy = "topic_policy"
}

resource "aws_sns_topic_subscription" "edx-pipeline-sitespeed_sqs_target" {
  topic_arn = "${aws_sns_topic.edx-pipeline-sitespeed.arn}"
  protocol  = "sqs"
  endpoint  = "${aws_sqs_queue.edx-pipeline-sitespeed.arn}"
}<commit_msg>No need for custom policy on sns.<commit_after>
# Configure the AWS Provider
provider "aws" {
    access_key = "${var.aws_access_key}"
    secret_key = "${var.aws_secret_key}"
    region = "us-east-1"
}

# pipeline-provision infrastructure
resource "aws_sqs_queue" "edx-pipeline-provision" {
	name = "${var.queue_name_pipeline}"
	delay_seconds = "${var.queue_delay_seconds}"
	max_message_size = "${var.queue_max_message_size}"
	message_retention_seconds = "${var.queue_message_retention_seconds}"
	receive_wait_time_seconds = "${var.queue_receive_wait_time_seconds}"
}

resource "aws_sns_topic" "edx-pipeline-provision" {
  name = "edx-pipeline-provision-topic"
}

resource "aws_sns_topic_subscription" "edx-pipeline-provision_sqs_target" {
  topic_arn = "${aws_sns_topic.edx-pipeline-provision.arn}"
  protocol  = "sqs"
  endpoint  = "${aws_sqs_queue.edx-pipeline-provision.arn}"
}



# pipeline-sitespeed infrastructure
resource "aws_sqs_queue" "edx-pipeline-sitespeed" {
  name = "${var.queue_name_sitespeed}"
  delay_seconds = "${var.queue_delay_seconds}"
  max_message_size = "${var.queue_max_message_size}"
  message_retention_seconds = "${var.queue_message_retention_seconds}"
  receive_wait_time_seconds = "${var.queue_receive_wait_time_seconds}"
}

resource "aws_sns_topic" "edx-pipeline-sitespeed" {
  name = "edx-pipeline-sitespeed-topic"
}

resource "aws_sns_topic_subscription" "edx-pipeline-sitespeed_sqs_target" {
  topic_arn = "${aws_sns_topic.edx-pipeline-sitespeed.arn}"
  protocol  = "sqs"
  endpoint  = "${aws_sqs_queue.edx-pipeline-sitespeed.arn}"
}
{'fraction_non_alphanumeric': 0.1423573735199139, 'fraction_numerical': 0.002691065662002153, 'mean_word_length': 5.083469721767594, 'pattern_counts': {'":': 8, '<': 5, '<?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': '6064085', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1379, 'n_words': 178}