SubscriptionOptions

class aws_cdk.aws_sns.SubscriptionOptions(*, dead_letter_queue=None, endpoint, filter_policy=None, protocol, raw_message_delivery=None, region=None, subscription_role_arn=None)

Bases: object

Options for creating a new subscription.

Parameters
  • dead_letter_queue (Optional[IQueue]) – Queue to be used as dead letter queue. If not passed no dead letter queue is enabled. Default: - No dead letter queue enabled.

  • endpoint (str) – The subscription endpoint. The meaning of this value depends on the value for ‘protocol’.

  • filter_policy (Optional[Mapping[str, SubscriptionFilter]]) – The filter policy. Default: - all messages are delivered

  • protocol (SubscriptionProtocol) – What type of subscription to add.

  • raw_message_delivery (Optional[bool]) – true if raw message delivery is enabled for the subscription. Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple Notification Service API Reference. Default: false

  • region (Optional[str]) – The region where the topic resides, in the case of cross-region subscriptions. Default: - the region where the CloudFormation stack is being deployed.

  • subscription_role_arn (Optional[str]) – Arn of role allowing access to firehose delivery stream. Required for a firehose subscription protocol. Default: - No subscription role is provided

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sns as sns
import aws_cdk.aws_sqs as sqs

# queue is of type Queue
# subscription_filter is of type SubscriptionFilter

subscription_options = sns.SubscriptionOptions(
    endpoint="endpoint",
    protocol=sns.SubscriptionProtocol.HTTP,

    # the properties below are optional
    dead_letter_queue=queue,
    filter_policy={
        "filter_policy_key": subscription_filter
    },
    raw_message_delivery=False,
    region="region",
    subscription_role_arn="subscriptionRoleArn"
)

Attributes

dead_letter_queue

Queue to be used as dead letter queue.

If not passed no dead letter queue is enabled.

Default
  • No dead letter queue enabled.

Return type

Optional[IQueue]

endpoint

The subscription endpoint.

The meaning of this value depends on the value for ‘protocol’.

Return type

str

filter_policy

The filter policy.

Default
  • all messages are delivered

Return type

Optional[Mapping[str, SubscriptionFilter]]

protocol

What type of subscription to add.

Return type

SubscriptionProtocol

raw_message_delivery

true if raw message delivery is enabled for the subscription.

Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple Notification Service API Reference.

Default

false

Return type

Optional[bool]

region

The region where the topic resides, in the case of cross-region subscriptions.

Default
  • the region where the CloudFormation stack is being deployed.

Link

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-region

Return type

Optional[str]

subscription_role_arn

Arn of role allowing access to firehose delivery stream.

Required for a firehose subscription protocol.

Default
  • No subscription role is provided

Return type

Optional[str]