CfnSubscriptionProps Struct
Properties for defining a CfnSubscription.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sns as sns } from 'aws-cdk-lib';
declare const deliveryPolicy: any;
declare const filterPolicy: any;
declare const redrivePolicy: any;
declare const replayPolicy: any;
const cfnSubscriptionProps: sns.CfnSubscriptionProps = {
protocol: 'protocol',
topicArn: 'topicArn',
// the properties below are optional
deliveryPolicy: deliveryPolicy,
endpoint: 'endpoint',
filterPolicy: filterPolicy,
filterPolicyScope: 'filterPolicyScope',
rawMessageDelivery: false,
redrivePolicy: redrivePolicy,
region: 'region',
replayPolicy: replayPolicy,
subscriptionRoleArn: 'subscriptionRoleArn',
};
Properties
deliveryPolicyoptionalanydelivery_policyoptionalAnydeliveryPolicyoptionalObjectDeliveryPolicyoptionalobjectDeliveryPolicyoptionalinterface{}#notes
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 API Reference and Message delivery retries in the Amazon Developer Guide .
endpointoptionalstring | IDeliveryStreamRef | IFunctionRef | IVersionRef | IQueueRefendpointoptionaltyping.Union[str, IDeliveryStreamRef, IFunctionRef, IVersionRef, IQueueRef]endpointoptionalStringEndpointoptionalstringEndpointoptionalinterface{}#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 API Reference .
filterPolicyoptionalanyfilter_policyoptionalAnyfilterPolicyoptionalObjectFilterPolicyoptionalobjectFilterPolicyoptionalinterface{}#notes
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 API Reference and Message filtering in the Amazon Developer Guide .
filterPolicyScopeoptionalstringfilter_policy_scopeoptionalstrfilterPolicyScopeoptionalStringFilterPolicyScopeoptionalstringFilterPolicyScopeoptional*string#notes
MessageAttributes(default) - The filter is applied on the message attributes.MessageBody- The filter is applied on the message body.
Nullis not a valid value forFilterPolicyScope. To delete a filter policy, delete theFilterPolicyproperty but keepFilterPolicyScopeproperty as is.
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 API Reference .
rawMessageDeliveryoptionalboolean | IResolvableraw_message_deliveryoptionaltyping.Union[bool, IResolvable]rawMessageDeliveryoptionalBooleanRawMessageDeliveryoptionalboolRawMessageDeliveryoptionalinterface{}#notes
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 API Reference .
redrivePolicyoptionalanyredrive_policyoptionalAnyredrivePolicyoptionalObjectRedrivePolicyoptionalobjectRedrivePolicyoptionalinterface{}#notes
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 .
notes
If no region is specified, 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
RegionfromNULLto the caller region. - Updating the
Regionfrom the caller region toNULL.
replayPolicyoptionalanyreplay_policyoptionalAnyreplayPolicyoptionalObjectReplayPolicyoptionalobjectReplayPolicyoptionalinterface{}#subscriptionRoleArnoptionalstring | IRoleRefsubscription_role_arnoptionaltyping.Union[str, IRoleRef]subscriptionRoleArnoptionalStringSubscriptionRoleArnoptionalstringSubscriptionRoleArnoptionalinterface{}#notes
Specify the ARN of the IAM role that has the following:
- Permission to write to the Amazon Data Firehose delivery stream
- Amazon 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 Developer Guide.