Skip to content

Commit ac27e32

Browse files
authored
feat(cloud-logs): allowing the user to specify the region where the SNS (#65)
topic is/needs to be
1 parent 6296df7 commit ac27e32

File tree

1 file changed

+4
-4
lines changed
  • modules/integrations/cloud-logs

1 file changed

+4
-4
lines changed

modules/integrations/cloud-logs/main.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,20 @@ data "aws_iam_policy_document" "cloudlogs_s3_access" {
171171
# SNS Topic and Subscription for CloudTrail notifications
172172
#-----------------------------------------------------------------------------------------------------------------------
173173
provider aws {
174-
alias = "sns"
174+
alias = "sns_default"
175175
region = local.topic_region
176176
}
177177

178178
resource "aws_sns_topic" "cloudtrail_notifications" {
179179
count = var.create_topic ? 1 : 0
180-
provider = aws.sns
180+
provider = try(aws.sns, aws.sns_default)
181181
name = local.topic_name
182182
tags = var.tags
183183
}
184184

185185
resource "aws_sns_topic_policy" "cloudtrail_notifications" {
186186
count = var.create_topic ? 1 : 0
187-
provider = aws.sns
187+
provider = try(aws.sns, aws.sns_default)
188188
arn = aws_sns_topic.cloudtrail_notifications[0].arn
189189
policy = jsonencode({
190190
Version = "2012-10-17"
@@ -205,7 +205,7 @@ resource "aws_sns_topic_policy" "cloudtrail_notifications" {
205205
resource "aws_sns_topic_subscription" "cloudtrail_notifications" {
206206
count = !local.is_cross_account_topic ? 1 : 0
207207
topic_arn = var.topic_arn
208-
provider = aws.sns
208+
provider = try(aws.sns, aws.sns_default)
209209
protocol = "https"
210210
endpoint = local.ingestion_url
211211

0 commit comments

Comments
 (0)