sns
Send Amazon Simple Notification Service messages
Collection: community.aws
Full Name: community.aws.sns
Synopsis
Send Amazon Simple Notification Service messages
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| application | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| str | ||||
| email_json | str | |||
| endpoint_url | str | |||
| http | str | |||
| https | str | |||
| lambda | str | |||
| message_attributes | dict | |||
| message_deduplication_id | str | |||
| message_group_id | str | |||
| message_structure | str | json | ||
| msg | str | yes | ||
| profile | str | |||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| sms | str | |||
| sqs | str | |||
| subject | str | |||
| topic | str | yes | ||
| validate_certs | bool | true |
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