File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11resource "aws_chatbot_slack_channel_configuration" "batch_processor_errors" {
2- count = var. batch_error_notifications_enabled ? 1 : 0
3-
4- configuration_name = " ${ local . resource_scope } -batch-processor-errors-slack-channel-config"
5- iam_role_arn = aws_iam_role. batch_processor_errors_chatbot [0 ]. arn
2+ configuration_name = " ${ var . environment } -batch-processor-errors-slack-channel-config"
3+ iam_role_arn = aws_iam_role. batch_processor_errors_chatbot . arn
64 slack_channel_id = var. environment == " prod" ? " C09EA0HE202" : " C09E48NDP18"
75 slack_team_id = " TJ00QR03U"
8- sns_topic_arns = [aws_sns_topic . batch_processor_errors [ 0 ] . arn ]
6+ sns_topic_arns = [aws_sns_topic . batch_processor_errors . arn ]
97}
108
119resource "aws_iam_role" "batch_processor_errors_chatbot" {
12- count = var. batch_error_notifications_enabled ? 1 : 0
13-
14- name = " ${ local . resource_scope } -batch-processor-errors-chatbot-channel-role"
10+ name = " ${ var . environment } -batch-processor-errors-chatbot-channel-role"
1511 assume_role_policy = jsonencode ({
1612 Version = " 2012-10-17"
1713 Statement = [
@@ -25,5 +21,6 @@ resource "aws_iam_role" "batch_processor_errors_chatbot" {
2521 },
2622 ]
2723 })
24+ # To try: could test without this?
2825 managed_policy_arns = [" arn:aws:iam::aws:policy/AWSResourceExplorerReadOnlyAccess" ]
2926}
Original file line number Diff line number Diff line change 11resource "aws_sns_topic" "batch_processor_errors" {
2- count = var. batch_error_notifications_enabled ? 1 : 0
3- name = " ${ local . resource_scope } -batch-processor-errors"
2+ name = " ${ var . environment } -batch-processor-errors"
43}
54
65resource "aws_sns_topic_policy" "batch_processor_errors_topic_policy" {
7- count = var. batch_error_notifications_enabled ? 1 : 0
8- arn = aws_sns_topic. batch_processor_errors [0 ]. arn
6+ arn = aws_sns_topic. batch_processor_errors . arn
97 policy = jsonencode ({
108 Version = " 2012-10-17" ,
119 Statement = [
@@ -16,7 +14,7 @@ resource "aws_sns_topic_policy" "batch_processor_errors_topic_policy" {
1614 Service = " cloudwatch.amazonaws.com"
1715 },
1816 Action = " SNS:Publish" ,
19- Resource = aws_sns_topic.batch_processor_errors[ 0 ] .arn
17+ Resource = aws_sns_topic.batch_processor_errors.arn
2018 }
2119 ]
2220 })
Original file line number Diff line number Diff line change @@ -328,6 +328,6 @@ resource "aws_cloudwatch_metric_alarm" "batch_processor_filter_error_alarm" {
328328 statistic = " Sum"
329329 threshold = 1
330330 alarm_description = " This sets off an alarm for any error logs found in the batch processor filter Lambda function"
331- alarm_actions = [aws_sns_topic . batch_processor_errors [ 0 ] . arn ]
331+ alarm_actions = [aws_sns_topic . batch_processor_errors . arn ]
332332 treat_missing_data = " notBreaching"
333333}
Original file line number Diff line number Diff line change @@ -345,6 +345,6 @@ resource "aws_cloudwatch_metric_alarm" "file_name_processor_error_alarm" {
345345 statistic = " Sum"
346346 threshold = 1
347347 alarm_description = " This sets off an alarm for any error logs found in the file name processor Lambda function"
348- alarm_actions = [aws_sns_topic . batch_processor_errors [ 0 ] . arn ]
348+ alarm_actions = [aws_sns_topic . batch_processor_errors . arn ]
349349 treat_missing_data = " notBreaching"
350350}
You can’t perform that action at this time.
0 commit comments