<commit_before># Lambda for publishing out of date deployments to SNS

module "lambda_notify_old_deploys" {
  source      = "./lambda"
  name        = "notify_old_deploys"
  description = "For publishing out of date deployments to SNS"
  source_dir  = "../lambdas/notify_old_deploys"

  environment_variables = {
    TABLE_NAME        = "${aws_dynamodb_table.deployments.name}"
    TOPIC_ARN         = "${module.old_deployments.arn}"
    AGE_BOUNDARY_MINS = "5"
  }

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_notify_old_deploys" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_notify_old_deploys.function_name}"
  lambda_function_arn     = "${module.lambda_notify_old_deploys.arn}"
  cloudwatch_trigger_arn  = "${aws_cloudwatch_event_rule.every_5_minutes.arn}"
  cloudwatch_trigger_name = "${aws_cloudwatch_event_rule.every_5_minutes.name}"
}

# Lambda for tracking deployment status in dynamo db
module "lambda_service_deployment_status" {
  source      = "./lambda"
  name        = "service_deployment_status"
  description = "Lambda for tracking deployment status in dynamo db"
  source_dir  = "../lambdas/service_deployment_status"

  environment_variables = {
    TABLE_NAME = "${aws_dynamodb_table.deployments.name}"
  }

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_service_deployment_status" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_service_deployment_status.function_name}"
  lambda_function_arn     = "${module.lambda_service_deployment_status.arn}"
  cloudwatch_trigger_arn  = "${aws_cloudwatch_event_rule.ecs_container_instance_state_change.arn}"
  cloudwatch_trigger_name = "${aws_cloudwatch_event_rule.ecs_container_instance_state_change.name}"
}

# Lambda for tagging EC2 instances with ECS cluster/container instance id
module "lambda_ecs_ec2_instance_tagger" {
  source      = "./lambda"
  name        = "ecs_ec2_instance_tagger"
  description = "Tag an EC2 instance with ECS cluster/container instance id"
  source_dir  = "../lambdas/ecs_ec2_instance_tagger"

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_ecs_ec2_instance_tagger" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_ecs_ec2_instance_tagger.function_name}"<commit_msg>increase lambda_service_deployment_status timeout to avoid errors<commit_after># Lambda for publishing out of date deployments to SNS

module "lambda_notify_old_deploys" {
  source      = "./lambda"
  name        = "notify_old_deploys"
  description = "For publishing out of date deployments to SNS"
  source_dir  = "../lambdas/notify_old_deploys"

  environment_variables = {
    TABLE_NAME        = "${aws_dynamodb_table.deployments.name}"
    TOPIC_ARN         = "${module.old_deployments.arn}"
    AGE_BOUNDARY_MINS = "5"
  }

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_notify_old_deploys" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_notify_old_deploys.function_name}"
  lambda_function_arn     = "${module.lambda_notify_old_deploys.arn}"
  cloudwatch_trigger_arn  = "${aws_cloudwatch_event_rule.every_5_minutes.arn}"
  cloudwatch_trigger_name = "${aws_cloudwatch_event_rule.every_5_minutes.name}"
}

# Lambda for tracking deployment status in dynamo db
module "lambda_service_deployment_status" {
  source      = "./lambda"
  name        = "service_deployment_status"
  description = "Lambda for tracking deployment status in dynamo db"
  source_dir  = "../lambdas/service_deployment_status"
  timeout     = 10

  environment_variables = {
    TABLE_NAME = "${aws_dynamodb_table.deployments.name}"
  }

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_service_deployment_status" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_service_deployment_status.function_name}"
  lambda_function_arn     = "${module.lambda_service_deployment_status.arn}"
  cloudwatch_trigger_arn  = "${aws_cloudwatch_event_rule.ecs_container_instance_state_change.arn}"
  cloudwatch_trigger_name = "${aws_cloudwatch_event_rule.ecs_container_instance_state_change.name}"
}

# Lambda for tagging EC2 instances with ECS cluster/container instance id
module "lambda_ecs_ec2_instance_tagger" {
  source      = "./lambda"
  name        = "ecs_ec2_instance_tagger"
  description = "Tag an EC2 instance with ECS cluster/container instance id"
  source_dir  = "../lambdas/ecs_ec2_instance_tagger"

  alarm_topic_arn = "${module.lambda_error_alarm.arn}"
}

module "trigger_ecs_ec2_instance_tagger" {
  source                  = "./lambda/trigger_cloudwatch"
  lambda_function_name    = "${module.lambda_ecs_ec2_instance_tagger.function_name}"
{'fraction_non_alphanumeric': 0.09487859620485616, 'fraction_numerical': 0.004488879820444807, 'mean_word_length': 4.3927392739273925, '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': '2808669', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1571, 'n_words': 258}