DeliveryPolicy

class aws_cdk.aws_sns.DeliveryPolicy(*, healthy_retry_policy=None, request_policy=None, throttle_policy=None)

Bases: object

Options for customising the delivery of SNS messages to HTTP/S endpoints.

Parameters:
  • healthy_retry_policy (Union[HealthyRetryPolicy, Dict[str, Any], None]) – The retry policy of the delivery of SNS messages to HTTP/S endpoints. Default: - Amazon SNS attempts up to three retries with a delay between failed attempts set at 20 seconds

  • request_policy (Union[RequestPolicy, Dict[str, Any], None]) – The request of the content sent in AWS SNS HTTP/S requests. Default: - The content type is set to ‘text/plain; charset=UTF-8’

  • throttle_policy (Union[ThrottlePolicy, Dict[str, Any], None]) – The throttling policy of the delivery of SNS messages to HTTP/S endpoints. Default: - No throttling

ExampleMetadata:

infused

Example:

my_topic = sns.Topic(self, "MyTopic")

my_topic.add_subscription(
    subscriptions.UrlSubscription("https://foobar.com/",
        delivery_policy=sns.DeliveryPolicy(
            healthy_retry_policy=sns.HealthyRetryPolicy(
                min_delay_target=Duration.seconds(5),
                max_delay_target=Duration.seconds(10),
                num_retries=6,
                backoff_function=sns.BackoffFunction.EXPONENTIAL
            ),
            throttle_policy=sns.ThrottlePolicy(
                max_receives_per_second=10
            ),
            request_policy=sns.RequestPolicy(
                header_content_type="application/json"
            )
        )
    ))

Attributes

healthy_retry_policy

The retry policy of the delivery of SNS messages to HTTP/S endpoints.

Default:
  • Amazon SNS attempts up to three retries with a delay between failed attempts set at 20 seconds

request_policy

The request of the content sent in AWS SNS HTTP/S requests.

Default:
  • The content type is set to ‘text/plain; charset=UTF-8’

throttle_policy

The throttling policy of the delivery of SNS messages to HTTP/S endpoints.

Default:
  • No throttling