https://github.com/evalmee/s3_bucket_notification_lambda
Terraform module updating S3 notifications to AWS Lambda
https://github.com/evalmee/s3_bucket_notification_lambda
aws-lambda aws-s3 terraform-module
Last synced: 10 months ago
JSON representation
Terraform module updating S3 notifications to AWS Lambda
- Host: GitHub
- URL: https://github.com/evalmee/s3_bucket_notification_lambda
- Owner: evalmee
- Created: 2022-05-13T13:58:00.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T16:20:06.000Z (over 1 year ago)
- Last Synced: 2025-03-10T17:31:19.381Z (over 1 year ago)
- Topics: aws-lambda, aws-s3, terraform-module
- Language: Ruby
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# s3_bucket_notification_lambda
A module to create a S3 notification to a lambda function.
The [module provided by AWS](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_notification) manage S3 notifications as one resource and only support a single notification configuration. (See issue https://github.com/hashicorp/terraform-provider-aws/issues/501)
With this module, you can manage your S3 notifications from different terraform stacks.
⚠️ **Warning:**
- This module only support S3 notifications to a lambda function. Other notifications created for the source bucket will be overwritten.
- This module is in alpha state and is not recommended for production.
## Example
```hcl
module "s3-notification" {
source = "github.com/evalmee/s3_bucket_notification_lambda"
s3_bucket_name = "your-bucket-name"
lambda_arn = "your-lambda-arn"
events = "s3:ObjectCreated:*"
prefix = "foo"
suffix = ".jpeg"
notification_id = "image upload notification"
}
```
## How does it work?
This module retrieves the current S3 notification configuration from the bucket and merge the new configuration with the existing one.
The notification name is used as identifier.
## Requirement
This module executes a Ruby script to manage the S3 notifications.
You need a working Ruby installation (version >2.6) to use this module.