- An s3 bucket's ARN
Assume we want to set up notifications for the bucket with ARN arn:aws:s3:::somebucket
and only trigger notifications from the logs/
prefix that have the .txt
suffix.
Add this block to your terraform code:
resource "aws_sqs_queue" "my_notification_queue" {
name = "my-notifications-queue"
}
module "s3_sqs" {
source = "github.com/graymeta/terraform-aws-platform//modules/s3_sqs?ref=v0.2.6"
platform_instance_id = "${local.platform_instance_id}"
region = "${local.region}"
bucket_arn = "arn:aws:s3:::somebucket"
queue_name = "${aws_sqs_queue.my_notification_queue.id}"
filter_prefix = "logs/"
filter_suffix = ".txt"
}
platform_instance_id
- (string) - unique identifier for this instance of the platformregion
- (string) - AWS regionbucket_arn
- (string) - The ARN of the bucket to monitorqueue_name
- (string) - The name of the SQS queue to put the notifications intofilter_prefix
- (string) - Optional. The prefix that the s3 keys must match to trigger a notification. Leave blank if you want all items in the bucket to trigger notifications.filter_suffix
- (string) - Optional. The suffix that the s3 keys must match to trigger a notification. Leave blank if you want all items in the bucket to trigger notifications.