diff --git a/CHANGELOG.md b/CHANGELOG.md index 853e233..92eee25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.3.2] - 2020-09-18 +### Added +- eventType filter added to SQS queue message. + ## [1.3.1] - 2020-07-30 ### Added - SQS queue message filter. diff --git a/README.md b/README.md index 3ada520..1dc2101 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ For more information please refer to the main [Apiary](https://github.com/Expedi | subnets | ECS container subnets. | list | n/a | yes | | target\_metastore\_uri | Target Metastore URI for Shunting Yard. | string | n/a | yes | | vpc\_id | VPC ID. | string | n/a | yes | +|exclude\_event\_list | event to exclude from Shunting Yard Replication. Supported Format: [ "DROP_PARTITION"] Wildcards are not supported, i.e. you need to specify each event explicitly. | list | `` | no | ## Usage diff --git a/cloudwatch.tf b/cloudwatch.tf index 8662922..ae13bcf 100644 --- a/cloudwatch.tf +++ b/cloudwatch.tf @@ -118,22 +118,22 @@ ${join("", data.template_file.sqs_widgets.*.rendered)} locals { alerts = [ { - alarm_name = "${local.instance_alias}-cpu" - namespace = "AWS/ECS" + alarm_name = "${local.instance_alias}-cpu" + namespace = "AWS/ECS" metric_name = "CPUUtilization" - threshold = "90" + threshold = "90" }, { - alarm_name = "${local.instance_alias}-memory" - namespace = "AWS/ECS" + alarm_name = "${local.instance_alias}-memory" + namespace = "AWS/ECS" metric_name = "MemoryUtilization" - threshold = "80" + threshold = "80" }, { - alarm_name = "${local.instance_alias}-stale-messages" - namespace = "AWS/SQS" + alarm_name = "${local.instance_alias}-stale-messages" + namespace = "AWS/SQS" metric_name = "ApproximateAgeOfOldestMessage" - threshold = "${var.shuntingyard_sqs_queue_stale_messages_timeout}" + threshold = "${var.shuntingyard_sqs_queue_stale_messages_timeout}" }, ] @@ -153,17 +153,17 @@ locals { } resource "aws_cloudwatch_metric_alarm" "shuntingyard_alert" { - count = "${length(local.alerts)}" - alarm_name = "${lookup(local.alerts[count.index], "alarm_name")}" + count = "${length(local.alerts)}" + alarm_name = "${lookup(local.alerts[count.index], "alarm_name")}" comparison_operator = "${lookup(local.alerts[count.index], "comparison_operator", "GreaterThanOrEqualToThreshold")}" - metric_name = "${lookup(local.alerts[count.index], "metric_name")}" - namespace = "${lookup(local.alerts[count.index], "namespace")}" - period = "${lookup(local.alerts[count.index], "period", "120")}" - evaluation_periods = "${lookup(local.alerts[count.index], "evaluation_periods", "2")}" - statistic = "Average" - threshold = "${lookup(local.alerts[count.index], "threshold")}" + metric_name = "${lookup(local.alerts[count.index], "metric_name")}" + namespace = "${lookup(local.alerts[count.index], "namespace")}" + period = "${lookup(local.alerts[count.index], "period", "120")}" + evaluation_periods = "${lookup(local.alerts[count.index], "evaluation_periods", "2")}" + statistic = "Average" + threshold = "${lookup(local.alerts[count.index], "threshold")}" insufficient_data_actions = [] - dimensions = "${local.dimensions[count.index]}" - alarm_actions = ["${aws_sns_topic.shuntingyard_ops_sns.arn}"] + dimensions = "${local.dimensions[count.index]}" + alarm_actions = ["${aws_sns_topic.shuntingyard_ops_sns.arn}"] } diff --git a/common.tf b/common.tf index 0fdfc32..b192bf1 100644 --- a/common.tf +++ b/common.tf @@ -5,7 +5,7 @@ */ locals { - instance_alias = "${ var.instance_name == "" ? "shuntingyard" : format("shuntingyard-%s",var.instance_name) }" + instance_alias = "${var.instance_name == "" ? "shuntingyard" : format("shuntingyard-%s", var.instance_name)}" } data "aws_vpc" "shuntingyard_vpc" { diff --git a/iam-policy-s3-buckets.tf b/iam-policy-s3-buckets.tf index 4a1f2db..4f49e3a 100644 --- a/iam-policy-s3-buckets.tf +++ b/iam-policy-s3-buckets.tf @@ -29,8 +29,8 @@ resource "aws_iam_role_policy" "s3_for_shuntingyard" { "s3:PutObjectVersionTagging" ], "Resource": [ - "${join("\",\"", formatlist("arn:aws:s3:::%s",var.allowed_s3_buckets))}", - "${join("\",\"", formatlist("arn:aws:s3:::%s/*",var.allowed_s3_buckets))}" + "${join("\",\"", formatlist("arn:aws:s3:::%s", var.allowed_s3_buckets))}", + "${join("\",\"", formatlist("arn:aws:s3:::%s/*", var.allowed_s3_buckets))}" ] } ] diff --git a/iam.tf b/iam.tf index 1ab1f60..710a3e5 100644 --- a/iam.tf +++ b/iam.tf @@ -27,7 +27,7 @@ EOF } resource "aws_iam_role_policy_attachment" "task_exec_managed" { - role = "${aws_iam_role.shuntingyard_task_exec.id}" + role = "${aws_iam_role.shuntingyard_task_exec.id}" policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy" } diff --git a/sqs.tf b/sqs.tf index 0f82a7f..8a90f14 100644 --- a/sqs.tf +++ b/sqs.tf @@ -35,7 +35,9 @@ resource "aws_sqs_queue_policy" "shuntingyard_sqs_queue_policy" { POLICY } +# default filter data "template_file" "sqs_hive_metastore_sns_subscription_filter" { + count = "${length(var.exclude_event_list) == 0 ? 1 : 0}" template = <