From 6a643b5e4691ea55f427e74a959a41301d611e73 Mon Sep 17 00:00:00 2001 From: Buckingham Date: Thu, 1 Feb 2024 11:21:45 +0000 Subject: [PATCH 1/2] Update_010224 --- terraform/environments/ppud/sns.tf | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/terraform/environments/ppud/sns.tf b/terraform/environments/ppud/sns.tf index 40d0266575e..e08a1f5fc95 100644 --- a/terraform/environments/ppud/sns.tf +++ b/terraform/environments/ppud/sns.tf @@ -1,4 +1,4 @@ -#### Cloud Watch #### +#### Cloud Watch PROD #### resource "aws_sns_topic" "cw_alerts" { count = local.is-production == true ? 1 : 0 name = "ppud-prod-cw-alerts" @@ -16,3 +16,23 @@ resource "aws_sns_topic_subscription" "cw_subscription" { endpoint = "PPUDAlerts@colt.net" # endpoint = aws_secretsmanager_secret_version.support_email_account[0].secret_string } + +##### Cloud Watch UAT ###### + +resource "aws_sns_topic" "cw_alerts" { + count = local.is-preproduction == true ? 1 : 0 + name = "ppud-uat-cw-alerts" +} + +resource "aws_sns_topic_policy" "sns_policy" { + count = local.is-preproduction == true ? 1 : 0 + arn = aws_sns_topic.cw_alerts[0].arn + policy = data.aws_iam_policy_document.sns_topic_policy_ec2cw[0].json +} + +resource "aws_sns_topic_subscription" "cw_subscription" { + count = local.is-preproduction == true ? 1 : 0 + topic_arn = aws_sns_topic.cw_alerts[0].arn + protocol = "email" + endpoint = "PPUDAlerts@colt.net" +} \ No newline at end of file From 9b3033225a15657bb97ebbea5c6732473fa47141 Mon Sep 17 00:00:00 2001 From: Buckingham Date: Thu, 1 Feb 2024 11:26:28 +0000 Subject: [PATCH 2/2] Update_010224_2 --- terraform/environments/ppud/sns.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/terraform/environments/ppud/sns.tf b/terraform/environments/ppud/sns.tf index e08a1f5fc95..8f9f80be94f 100644 --- a/terraform/environments/ppud/sns.tf +++ b/terraform/environments/ppud/sns.tf @@ -19,20 +19,20 @@ resource "aws_sns_topic_subscription" "cw_subscription" { ##### Cloud Watch UAT ###### -resource "aws_sns_topic" "cw_alerts" { +resource "aws_sns_topic" "cw_uat_alerts" { count = local.is-preproduction == true ? 1 : 0 name = "ppud-uat-cw-alerts" } -resource "aws_sns_topic_policy" "sns_policy" { +resource "aws_sns_topic_policy" "sns_uat_policy" { count = local.is-preproduction == true ? 1 : 0 - arn = aws_sns_topic.cw_alerts[0].arn + arn = aws_sns_topic.cw_uat_alerts[0].arn policy = data.aws_iam_policy_document.sns_topic_policy_ec2cw[0].json } -resource "aws_sns_topic_subscription" "cw_subscription" { +resource "aws_sns_topic_subscription" "cw_uat_subscription" { count = local.is-preproduction == true ? 1 : 0 - topic_arn = aws_sns_topic.cw_alerts[0].arn + topic_arn = aws_sns_topic.cw_uat_alerts[0].arn protocol = "email" endpoint = "PPUDAlerts@colt.net" } \ No newline at end of file