Skip to content

Commit

Permalink
Merge pull request #8427 from ministryofjustice/Update_231024_9
Browse files Browse the repository at this point in the history
Update 231024 9
  • Loading branch information
nbuckingham72 authored Oct 23, 2024
2 parents 1f1fc13 + a697d1b commit 255d8eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion terraform/environments/ppud/sns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ resource "aws_sns_topic" "s3_bucket_notifications_uat" {
name = "s3_bucket_notifications_uat"
}

data "aws_sns_topic" "s3_bucket_notifications_uat" {
count = local.is-preproduction == true ? 1 : 0
name = "s3_bucket_notifications_uat"
}

resource "aws_sns_topic_subscription" "s3_bucket_notifications_uat_subscription" {
count = local.is-preproduction == true ? 1 : 0
topic_arn = aws_sns_topic.s3_bucket_notifications_uat[0].arn
Expand All @@ -104,7 +109,7 @@ resource "aws_sns_topic_policy" "s3_bucket_notifications_uat_policy" {
"Service" : "s3.amazonaws.com"
},
"Action" : "SNS:Publish",
"Resource" : "aws_sns_topic.s3_bucket_notifications_uat[0].arn",
"Resource" : "data.aws_sns_topic.s3_bucket_notifications_uat.arn",
"Condition" : {
"ArnLike" : {
"aws:SourceArn" : "arn:aws:s3:::moj-log-files-uat"
Expand Down

0 comments on commit 255d8eb

Please sign in to comment.