Skip to content

Commit 28a785f

Browse files
authored
bugfix(log ingestion/S3) - SNS provider change revert (#67)
* Update main.tf * Update README.md
1 parent ac27e32 commit 28a785f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

modules/integrations/cloud-logs/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ Additional features include:
2525
- Support for AWS GovCloud deployments
2626
- Support for cross-region deployments where the S3 bucket and SNS topic are in different regions
2727

28+
## Important Note - AWS provider
29+
30+
This module relies on a secondary AWS provider, with alias `sns`. We require this additional provider to support cross-region deployments where the SNS topic is defined or to be created in a different region. If you don't intend to use a different region you can define if before including the module in your setup as:
31+
```
32+
provider aws {
33+
alias = "sns"
34+
region = data.aws_region.current.name
35+
}
36+
```
37+
2838
## Important Notes for Cross-Account Access
2939

3040
When using this module with organizational cross-account access (where CloudTrail bucket is in a different AWS account), the module automatically deploys a StackSet to configure the role in the bucket account.

modules/integrations/cloud-logs/main.tf

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,16 @@ data "aws_iam_policy_document" "cloudlogs_s3_access" {
170170
#-----------------------------------------------------------------------------------------------------------------------
171171
# SNS Topic and Subscription for CloudTrail notifications
172172
#-----------------------------------------------------------------------------------------------------------------------
173-
provider aws {
174-
alias = "sns_default"
175-
region = local.topic_region
176-
}
177-
178173
resource "aws_sns_topic" "cloudtrail_notifications" {
179174
count = var.create_topic ? 1 : 0
180-
provider = try(aws.sns, aws.sns_default)
175+
provider = aws.sns
181176
name = local.topic_name
182177
tags = var.tags
183178
}
184179

185180
resource "aws_sns_topic_policy" "cloudtrail_notifications" {
186181
count = var.create_topic ? 1 : 0
187-
provider = try(aws.sns, aws.sns_default)
182+
provider = aws.sns
188183
arn = aws_sns_topic.cloudtrail_notifications[0].arn
189184
policy = jsonencode({
190185
Version = "2012-10-17"
@@ -205,7 +200,7 @@ resource "aws_sns_topic_policy" "cloudtrail_notifications" {
205200
resource "aws_sns_topic_subscription" "cloudtrail_notifications" {
206201
count = !local.is_cross_account_topic ? 1 : 0
207202
topic_arn = var.topic_arn
208-
provider = try(aws.sns, aws.sns_default)
203+
provider = aws.sns
209204
protocol = "https"
210205
endpoint = local.ingestion_url
211206

0 commit comments

Comments
 (0)