modules/notification submodule configures these notifications and automatically creates the IAM permissions needed for S3 to invoke Lambda, send to SQS, or publish to SNS.
Module reference
Variables
| Variable | Type | Description |
|---|---|---|
bucket | string | Name of the S3 bucket |
bucket_arn | string | ARN of the S3 bucket (used in IAM policies) |
lambda_notifications | any | Map of Lambda function notification configurations |
sqs_notifications | any | Map of SQS queue notification configurations |
sns_notifications | any | Map of SNS topic notification configurations |
eventbridge | bool | Enable EventBridge notifications |
create_lambda_permission | bool | Create aws_lambda_permission resources (default true) |
create_sqs_policy | bool | Create SQS queue policies (default true) |
create_sns_policy | bool | Create SNS topic policies (default true) |
Lambda notifications
The submodule creates anaws_lambda_permission granting s3.amazonaws.com the right to invoke the function, then registers the notification.
Lambda notification fields
| Field | Description |
|---|---|
function_arn | ARN of the Lambda function |
function_name | Name of the Lambda function (used in aws_lambda_permission) |
events | List of S3 event types (e.g. s3:ObjectCreated:*) |
filter_prefix | Only notify for keys with this prefix |
filter_suffix | Only notify for keys with this suffix |
qualifier | Lambda alias or version qualifier |
source_account | Source account for the Lambda permission |
SQS notifications
The submodule creates anaws_sqs_queue_policy allowing s3.amazonaws.com to call sqs:SendMessage on the queue.
SQS notification fields
| Field | Description |
|---|---|
queue_arn | ARN of the SQS queue |
events | List of S3 event types |
filter_prefix | Only notify for keys with this prefix |
filter_suffix | Only notify for keys with this suffix |
queue_id | Optional explicit queue URL (derived from ARN if omitted) |
SNS notifications
The submodule creates anaws_sns_topic_policy allowing s3.amazonaws.com to call sns:Publish on the topic.
SNS notification fields
| Field | Description |
|---|---|
topic_arn | ARN of the SNS topic |
events | List of S3 event types |
filter_prefix | Only notify for keys with this prefix |
filter_suffix | Only notify for keys with this suffix |
Combined notifications
You can configure Lambda, SQS, and SNS notifications in a single module call:EventBridge
To forward all S3 events to Amazon EventBridge (for fine-grained routing and filtering):Common S3 event types
| Event | Triggered when |
|---|---|
s3:ObjectCreated:* | Any object creation (Put, Post, Copy, multipart) |
s3:ObjectCreated:Put | PutObject only |
s3:ObjectRemoved:* | Any object deletion |
s3:ObjectRemoved:Delete | Permanent delete |
s3:ObjectRemoved:DeleteMarkerCreated | Delete marker created (versioned bucket) |
s3:ObjectRestore:* | Glacier restore initiated or completed |
s3:Replication:* | Replication events |

