RequestPolicy

class aws_cdk.aws_sns.RequestPolicy(*, header_content_type=None)

Bases: object

Options for customising aspects of the content sent in AWS SNS HTTP/S requests.

Parameters:

header_content_type (Optional[str]) – The content type of the notification being sent to HTTP/S endpoints. Default: - text/plain; charset=UTF-8

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

header_content_type

The content type of the notification being sent to HTTP/S endpoints.

Default:
  • text/plain; charset=UTF-8