From 6eb8edc17257f45d61825f18f975de158fea1980 Mon Sep 17 00:00:00 2001 From: jameslaneovermind <122231433+jameslaneovermind@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:27:12 +0000 Subject: [PATCH] create new bucket notification to same bucket --- modules/scenarios/s3_bucket_notification.tf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/scenarios/s3_bucket_notification.tf b/modules/scenarios/s3_bucket_notification.tf index d5b71f4..943bf96 100644 --- a/modules/scenarios/s3_bucket_notification.tf +++ b/modules/scenarios/s3_bucket_notification.tf @@ -16,6 +16,19 @@ resource "aws_s3_bucket_notification" "bucket_notification" { # filter_suffix = ".log" } } + +resource "aws_s3_bucket_notification" "new_bucket_notification" { + bucket = aws_s3_bucket.my_bucket.id + + queue { + queue_arn = aws_sqs_queue.my_queue.arn + events = ["s3:ObjectCreated:*"] + # Optionally specify a filter + # filter_prefix = "logs/" + # filter_suffix = ".log" + } +} + resource "aws_sqs_queue_policy" "my_queue_policy" { queue_url = aws_sqs_queue.my_queue.id