CfnSubscriptionProps

class aws_cdk.aws_sns.CfnSubscriptionProps(*, protocol, topic_arn, delivery_policy=None, endpoint=None, filter_policy=None, filter_policy_scope=None, raw_message_delivery=None, redrive_policy=None, region=None, replay_policy=None, subscription_role_arn=None)

Bases: object

Properties for defining a CfnSubscription.

Parameters:
  • protocol (str) – The subscription’s protocol. For more information, see the Protocol parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference .

  • topic_arn (str) – The ARN of the topic to subscribe to.

  • delivery_policy (Optional[Any]) – The delivery policy JSON assigned to the subscription. Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference and Message delivery retries in the Amazon SNS Developer Guide .

  • endpoint (Optional[str]) – The subscription’s endpoint. The endpoint value depends on the protocol that you specify. For more information, see the Endpoint parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference .

  • filter_policy (Optional[Any]) – The filter policy JSON assigned to the subscription. Enables the subscriber to filter out unwanted messages. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference and Message filtering in the Amazon SNS Developer Guide .

  • filter_policy_scope (Optional[str]) – This attribute lets you choose the filtering scope by using one of the following string value types:. - MessageAttributes (default) - The filter is applied on the message attributes. - MessageBody - The filter is applied on the message body.

  • raw_message_delivery (Union[bool, IResolvable, None]) – When set to true , enables raw message delivery. Raw messages don’t contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference .

  • redrive_policy (Optional[Any]) – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can’t be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing. For more information about the redrive policy and dead-letter queues, see Amazon SQS dead-letter queues in the Amazon SQS Developer Guide .

  • region (Optional[str]) – For cross-region subscriptions, the region in which the topic resides. If no region is specified, AWS CloudFormation uses the region of the caller as the default. If you perform an update operation that only updates the Region property of a AWS::SNS::Subscription resource, that operation will fail unless you are either: - Updating the Region from NULL to the caller region. - Updating the Region from the caller region to NULL .

  • replay_policy (Optional[Any]) –

  • subscription_role_arn (Optional[str]) – This property applies only to Amazon Data Firehose delivery stream subscriptions. Specify the ARN of the IAM role that has the following: - Permission to write to the Amazon Data Firehose delivery stream - Amazon SNS listed as a trusted entity Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see Fanout to Amazon Data Firehose delivery streams in the Amazon SNS Developer Guide.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html

ExampleMetadata:

fixture=_generated

Example:

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

# delivery_policy: Any
# filter_policy: Any
# redrive_policy: Any
# replay_policy: Any

cfn_subscription_props = sns.CfnSubscriptionProps(
    protocol="protocol",
    topic_arn="topicArn",

    # the properties below are optional
    delivery_policy=delivery_policy,
    endpoint="endpoint",
    filter_policy=filter_policy,
    filter_policy_scope="filterPolicyScope",
    raw_message_delivery=False,
    redrive_policy=redrive_policy,
    region="region",
    replay_policy=replay_policy,
    subscription_role_arn="subscriptionRoleArn"
)

Attributes

delivery_policy

The delivery policy JSON assigned to the subscription.

Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference and Message delivery retries in the Amazon SNS Developer Guide .

See:

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

endpoint

The subscription’s endpoint.

The endpoint value depends on the protocol that you specify. For more information, see the Endpoint parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference .

See:

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

filter_policy

The filter policy JSON assigned to the subscription.

Enables the subscriber to filter out unwanted messages. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference and Message filtering in the Amazon SNS Developer Guide .

See:

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

filter_policy_scope

.

  • MessageAttributes (default) - The filter is applied on the message attributes.

  • MessageBody - The filter is applied on the message body.

See:

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

Type:

This attribute lets you choose the filtering scope by using one of the following string value types

protocol

The subscription’s protocol.

For more information, see the Protocol parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference .

See:

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

raw_message_delivery

When set to true , enables raw message delivery.

Raw messages don’t contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see [GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html) in the Amazon SNS API Reference .

See:

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

redrive_policy

When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.

Messages that can’t be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.

For more information about the redrive policy and dead-letter queues, see Amazon SQS dead-letter queues in the Amazon SQS Developer Guide .

See:

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

region

For cross-region subscriptions, the region in which the topic resides.

If no region is specified, AWS CloudFormation uses the region of the caller as the default.

If you perform an update operation that only updates the Region property of a AWS::SNS::Subscription resource, that operation will fail unless you are either:

  • Updating the Region from NULL to the caller region.

  • Updating the Region from the caller region to NULL .

See:

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

replay_policy

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

Type:

see

subscription_role_arn

This property applies only to Amazon Data Firehose delivery stream subscriptions.

Specify the ARN of the IAM role that has the following:

  • Permission to write to the Amazon Data Firehose delivery stream

  • Amazon SNS listed as a trusted entity

Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see Fanout to Amazon Data Firehose delivery streams in the Amazon SNS Developer Guide.

See:

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

topic_arn

The ARN of the topic to subscribe to.

See:

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