TopicSubscriptionConfig

class aws_cdk.aws_sns.TopicSubscriptionConfig(*, endpoint, protocol, dead_letter_queue=None, filter_policy=None, raw_message_delivery=None, region=None, subscriber_id, subscriber_scope=None)

Bases: aws_cdk.aws_sns.SubscriptionOptions

__init__(*, endpoint, protocol, dead_letter_queue=None, filter_policy=None, raw_message_delivery=None, region=None, subscriber_id, subscriber_scope=None)

Subscription configuration.

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

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

  • 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.

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

  • 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.

  • subscriber_id (str) – The id of the SNS subscription resource created under scope. In most cases, it is recommended to use the uniqueId of the topic you are subscribing to.

  • subscriber_scope (Optional[Construct]) – The scope in which to create the SNS subscription resource. Normally you’d want the subscription to be created on the consuming stack because the topic is usually referenced by the consumer’s resource policy (e.g. SQS queue policy). Otherwise, it will cause a cyclic reference. If this is undefined, the subscription will be created on the topic’s stack. Default: - use the topic as the scope of the subscription, in which case subscriberId must be defined.

Return type

None

Attributes

dead_letter_queue

Queue to be used as dead letter queue.

If not passed no dead letter queue is enabled.

default :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 :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 :default: false

Return type

Optional[bool]

region

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

default :default: - the region where the CloudFormation stack is being deployed.

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

Return type

Optional[str]

subscriber_id

The id of the SNS subscription resource created under scope.

In most cases, it is recommended to use the uniqueId of the topic you are subscribing to.

Return type

str

subscriber_scope

The scope in which to create the SNS subscription resource.

Normally you’d want the subscription to be created on the consuming stack because the topic is usually referenced by the consumer’s resource policy (e.g. SQS queue policy). Otherwise, it will cause a cyclic reference.

If this is undefined, the subscription will be created on the topic’s stack.

default :default: - use the topic as the scope of the subscription, in which case subscriberId must be defined.

Return type

Optional[Construct]