PARALLAX

sns

Send Amazon Simple Notification Service messages

Collection: community.aws

Full Name: community.aws.sns

Synopsis

Send Amazon Simple Notification Service messages

Parameters

NameTypeRequiredDefaultDescription
access_keystr
applicationstr
aws_ca_bundlepath
aws_configdict
debug_botocore_endpoint_logsboolfalse
emailstr
email_jsonstr
endpoint_urlstr
httpstr
httpsstr
lambdastr
message_attributesdict
message_deduplication_idstr
message_group_idstr
message_structurestrjson
msgstryes
profilestr
regionstr
secret_keystr
session_tokenstr
smsstr
sqsstr
subjectstr
topicstryes
validate_certsbooltrue

Example

yaml
- name: Send default notification message via SNS
  community.aws.sns:
    msg: '{{ inventory_hostname }} has completed the play.'
    subject: Deploy complete!
    topic: deploy
  delegate_to: localhost

- name: Send notification messages via SNS with short message for SMS
  community.aws.sns:
    msg: '{{ inventory_hostname }} has completed the play.'
    sms: deployed!
    subject: Deploy complete!
    topic: deploy
  delegate_to: localhost

- name: Send message with message_attributes
  community.aws.sns:
    topic: "deploy"
    msg: "message with extra details!"
    message_attributes:
        channel:
            data_type: String
            string_value: "mychannel"
        color:
            data_type: String
            string_value: "green"
  delegate_to: localhost

- name: Send message to a fifo topic
  community.aws.sns:
    topic: "deploy"
    msg: "Message with message group id"
    subject: Deploy complete!
    message_group_id: "deploy-1"
  delegate_to: localhost
Search
    ↑ ↓ move↵ openesc close