PARALLAX

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

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
content_based_deduplicationstr
debug_botocore_endpoint_logsboolfalse
delivery_policydict
display_namestr
endpoint_urlstr
namestryes
policydict
profilestr
purge_subscriptionsbooltrue
purge_tagsbooltrue
regionstr
secret_keystr
session_tokenstr
statestrpresent
subscriptionslist[]
tagsdict
topic_typestrstandard
validate_certsbooltrue

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
Search
    ↑ ↓ move↵ openesc close