sns_topic
Manages AWS SNS topics and subscriptions
Collection: community.aws
Full Name: community.aws.sns_topic
Synopsis
Manages AWS SNS topics and subscriptions
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| content_based_deduplication | str | |||
| debug_botocore_endpoint_logs | bool | false | ||
| delivery_policy | dict | |||
| display_name | str | |||
| endpoint_url | str | |||
| name | str | yes | ||
| policy | dict | |||
| profile | str | |||
| purge_subscriptions | bool | true | ||
| purge_tags | bool | true | ||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| state | str | present | ||
| subscriptions | list | [] | ||
| tags | dict | |||
| topic_type | str | standard | ||
| validate_certs | bool | true |
Example
yaml
- name: Create alarm SNS topic
community.aws.sns_topic:
name: "alarms"
state: present
display_name: "alarm SNS topic"
delivery_policy:
http:
defaultHealthyRetryPolicy:
minDelayTarget: 2
maxDelayTarget: 4
numRetries: 9
numMaxDelayRetries: 5
numMinDelayRetries: 2
numNoDelayRetries: 2
backoffFunction: "linear"
disableSubscriptionOverrides: true
defaultThrottlePolicy:
maxReceivesPerSecond: 10
subscriptions:
- endpoint: "my_email_address@example.com"
protocol: "email"
- endpoint: "my_mobile_number"
protocol: "sms"
- name: Create a topic permitting S3 bucket notifications
community.aws.sns_topic:
name: "S3Notifications"
state: present
display_name: "S3 notifications SNS topic"
policy:
Id: s3-topic-policy
Version: 2012-10-17
Statement:
- Sid: Statement-id
Effect: Allow
Resource: "arn:aws:sns:*:*:S3Notifications"
Principal:
Service: s3.amazonaws.com
Action: sns:Publish
Condition:
ArnLike:
aws:SourceArn: "arn:aws:s3:*:*:SomeBucket"
- name: Example deleting a topic
community.aws.sns_topic:
name: "ExampleTopic"
state: absent