Skip to content

Commit f9067dc

Browse files
authored
feat: Allow setting id parameter in notification object (#236)
1 parent bf80a09 commit f9067dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/notification/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resource "aws_s3_bucket_notification" "this" {
1919
for_each = var.lambda_notifications
2020

2121
content {
22-
id = lambda_function.key
22+
id = try(lambda_function.value.id, lambda_function.key)
2323
lambda_function_arn = lambda_function.value.function_arn
2424
events = lambda_function.value.events
2525
filter_prefix = try(lambda_function.value.filter_prefix, null)
@@ -31,7 +31,7 @@ resource "aws_s3_bucket_notification" "this" {
3131
for_each = var.sqs_notifications
3232

3333
content {
34-
id = queue.key
34+
id = try(queue.value.id, queue.key)
3535
queue_arn = queue.value.queue_arn
3636
events = queue.value.events
3737
filter_prefix = try(queue.value.filter_prefix, null)
@@ -43,7 +43,7 @@ resource "aws_s3_bucket_notification" "this" {
4343
for_each = var.sns_notifications
4444

4545
content {
46-
id = topic.key
46+
id = try(topic.value.id, topic.key)
4747
topic_arn = topic.value.topic_arn
4848
events = topic.value.events
4949
filter_prefix = try(topic.value.filter_prefix, null)

0 commit comments

Comments
 (0)