State module for managing SNS subscription.

async, ctx, name: str, topic_arn: str, protocol: str, endpoint: str, resource_id: str = None, attributes: Dict[str, str] = None, return_subscription_arn: bool = None) Dict[str, Any][source]#

Creates a new endpoint subscription to a topic.

If the endpoint type is HTTP/S or email, or if the endpoint and the topic are not in the same Amazon Web Services account, For http and email protocols the endpoint owner must run the ConfirmSubscription action to confirm the subscription.

  • name (str) – The idem name for the resource

  • topic_arn (str) – The ARN of the topic to which the subscription should be added

  • protocol (str) – The protocol that you want to use.Supported protocols are:http,https,email,email-json,sms,sqs,application, lambda,firehose

  • endpoint (str) – The endpoint that you want to receive notifications.Endpoints vary by protocol

  • resource_id (str, Optional) – The AWS resource identifier, here it is resource arn

  • attributes (dict, Optional) – Attributes of the subscription

  • return_subscription_arn (bool, Optional) – A bool value to specify if the subscription_arn should be return after creation.By default,it is false i.e. subscription_arn is not returned.


dict[str, Any]


    - topic_arn: arn:aws:sns:eu-west-3:537227425989:test-topic
    - protocol: sms
    - endpoint: "+911234567890"
    - attributes:
        DeliveryPolicy: '{"healthyRetryPolicy": {"minDelayTarget": 10,"maxDelayTarget": 30,"numRetries": 10,"numMaxDelayRetries": 7,"numNoDelayRetries": 0,"numMinDelayRetries": 3,"backoffFunction": "linear"},"sicklyRetryPolicy": null,"throttlePolicy": null,"guaranteed": false}'
        FilterPolicy: '{"pets": ["dog", "cat"]}'
    - return_subscription_arn: True
async, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified subscription.

This action is idempotent, so deleting a topic that does not exist does not result in an error.

  • name (str) – The name of the state.

  • resource_id (str, Optional) – The AWS resource identifier i.e. resource arn

Request Syntax:
  - resource_id: 'string'

dict[str, Any]


  - resource_id: arn:aws:sns:eu-west-3:537227425989:test-topic:9c0fd640-7fc6-4888-bc08-f0a497a6237f
async, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

Describes list of all the subscriptions present in all topics.


dict[str, Any]


$ idem describe aws.sns.subscription