Skip to content

Commit 7153096

Browse files
authored
Merge branch 'master' into master
2 parents 7e55144 + 1f895f8 commit 7153096

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [5.5.0](https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/compare/v5.4.0...v5.5.0) (2025-08-20)
6+
7+
8+
### Features
9+
10+
* Add region parameter to notification module ([#354](https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/issues/354)) ([2dd4364](https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/commit/2dd4364b67d89cb9c881be465e5e4196ef8dea8f))
11+
512
## [5.4.0](https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/compare/v5.3.1...v5.4.0) (2025-08-11)
613

714

modules/notification/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ No modules.
4545
| <a name="input_create_sqs_policy"></a> [create\_sqs\_policy](#input\_create\_sqs\_policy) | Whether to create a policy for SQS permissions or not? | `bool` | `true` | no |
4646
| <a name="input_eventbridge"></a> [eventbridge](#input\_eventbridge) | Whether to enable Amazon EventBridge notifications | `bool` | `null` | no |
4747
| <a name="input_lambda_notifications"></a> [lambda\_notifications](#input\_lambda\_notifications) | Map of S3 bucket notifications to Lambda function | `any` | `{}` | no |
48+
| <a name="input_region"></a> [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the region set in the provider configuration | `string` | `null` | no |
4849
| <a name="input_sns_notifications"></a> [sns\_notifications](#input\_sns\_notifications) | Map of S3 bucket notifications to SNS topic | `any` | `{}` | no |
4950
| <a name="input_sqs_notifications"></a> [sqs\_notifications](#input\_sqs\_notifications) | Map of S3 bucket notifications to SQS queue | `any` | `{}` | no |
5051

modules/notification/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ resource "aws_s3_bucket_notification" "this" {
1313

1414
bucket = var.bucket
1515

16+
region = var.region
17+
1618
eventbridge = var.eventbridge
1719

1820
dynamic "lambda_function" {
@@ -62,6 +64,8 @@ resource "aws_s3_bucket_notification" "this" {
6264
resource "aws_lambda_permission" "allow" {
6365
for_each = { for k, v in var.lambda_notifications : k => v if var.create_lambda_permission }
6466

67+
region = var.region
68+
6569
statement_id_prefix = "AllowLambdaS3BucketNotification-"
6670
action = "lambda:InvokeFunction"
6771
function_name = each.value.function_name
@@ -110,6 +114,8 @@ data "aws_iam_policy_document" "sqs" {
110114
resource "aws_sqs_queue_policy" "allow" {
111115
for_each = { for k, v in var.sqs_notifications : k => v if var.create_sqs_policy }
112116

117+
region = var.region
118+
113119
queue_url = try(each.value.queue_id, local.queue_ids[each.key], null)
114120
policy = data.aws_iam_policy_document.sqs[each.key].json
115121
}
@@ -145,6 +151,8 @@ data "aws_iam_policy_document" "sns" {
145151
resource "aws_sns_topic_policy" "allow" {
146152
for_each = { for k, v in var.sns_notifications : k => v if var.create_sns_policy }
147153

154+
region = var.region
155+
148156
arn = each.value.topic_arn
149157
policy = data.aws_iam_policy_document.sns[each.key].json
150158
}

modules/notification/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ variable "create_lambda_permission" {
2222
default = true
2323
}
2424

25+
variable "region" {
26+
description = "Region where the resource(s) will be managed. Defaults to the region set in the provider configuration"
27+
type = string
28+
default = null
29+
}
30+
2531
variable "bucket" {
2632
description = "Name of S3 bucket to use"
2733
type = string

wrappers/notification/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module "wrapper" {
1111
create_sqs_policy = try(each.value.create_sqs_policy, var.defaults.create_sqs_policy, true)
1212
eventbridge = try(each.value.eventbridge, var.defaults.eventbridge, null)
1313
lambda_notifications = try(each.value.lambda_notifications, var.defaults.lambda_notifications, {})
14+
region = try(each.value.region, var.defaults.region, null)
1415
sns_notifications = try(each.value.sns_notifications, var.defaults.sns_notifications, {})
1516
sqs_notifications = try(each.value.sqs_notifications, var.defaults.sqs_notifications, {})
1617
}

0 commit comments

Comments
 (0)