Created
November 5, 2018 10:35
-
-
Save MattBlack85/5bfe1c38ba4591f71f96b8d764eb5dbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iot_topic_rule" "shadow_rejection_errors" { | |
name = "shadow_rejected_error" | |
description = "Add a metric to cloudwatch if any shadow fails update" | |
enabled = true | |
sql = "SELECT *, topic(3) as device_id FROM '$aws/things/+/shadow/update/rejected'" | |
sql_version = "2016-03-23" | |
cloudwatch_metric { | |
metric_name = "Rejected" | |
metric_namespace = "Shadow" | |
metric_value = "1" | |
metric_unit = "Count" | |
metric_timestamp = "${join("", list("$", "{timestamp()}"))}" | |
role_arn = "${var.iot_metrics_to_cloudwatch_arn}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment