PARALLAX

s3_bucket_notification

Creates, updates or deletes S3 Bucket notifications targeting Lambda functions, SNS or SQS

Collection: community.aws

Full Name: community.aws.s3_bucket_notification

Synopsis

Creates, updates or deletes S3 Bucket notifications targeting Lambda functions, SNS or SQS

Parameters

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
bucket_namestryes
debug_botocore_endpoint_logsboolfalse
endpoint_urlstr
event_namestryes
eventslist[]
lambda_aliasstr
lambda_function_arnstr
lambda_versionint0
prefixstr
profilestr
queue_arnstr
regionstr
secret_keystr
session_tokenstr
statestrpresent
suffixstr
topic_arnstr
validate_certsbooltrue

Example

yaml
# Examples adding notification target configs to a S3 bucket
- name: Setup bucket event notification to a Lambda function
  community.aws.s3_bucket_notification:
    state: present
    event_name: on_file_add_or_remove
    bucket_name: test-bucket
    lambda_function_arn: arn:aws:lambda:us-east-2:123456789012:function:test-lambda
    events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"]
    prefix: images/
    suffix: .jpg

- name: Setup bucket event notification to SQS
  community.aws.s3_bucket_notification:
    state: present
    event_name: on_file_add_or_remove
    bucket_name: test-bucket
    queue_arn: arn:aws:sqs:us-east-2:123456789012:test-queue
    events: ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"]
    prefix: images/
    suffix: .jpg

# Example removing an event notification
- name: Remove event notification
  community.aws.s3_bucket_notification:
    state: absent
    event_name: on_file_add_or_remove
    bucket_name: test-bucket
Search
    ↑ ↓ move↵ openesc close