Class CfnSubscription
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::SNS::Subscription
.
The AWS::SNS::Subscription
resource subscribes an endpoint to an Amazon SNS topic. For a subscription to be created, the owner of the endpoint must confirm the subscription.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.sns.*; Object deliveryPolicy; Object filterPolicy; Object redrivePolicy; CfnSubscription cfnSubscription = CfnSubscription.Builder.create(this, "MyCfnSubscription") .protocol("protocol") .topicArn("topicArn") // the properties below are optional .deliveryPolicy(deliveryPolicy) .endpoint("endpoint") .filterPolicy(filterPolicy) .filterPolicyScope("filterPolicyScope") .rawMessageDelivery(false) .redrivePolicy(redrivePolicy) .region("region") .subscriptionRoleArn("subscriptionRoleArn") .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnSubscription
(Construct scope, String id, CfnSubscriptionProps props) Create a newAWS::SNS::Subscription
.protected
CfnSubscription
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnSubscription
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe delivery policy JSON assigned to the subscription.The subscription's endpoint.The filter policy JSON assigned to the subscription.This attribute lets you choose the filtering scope by using one of the following string value types:.The subscription's protocol.When set totrue
, enables raw message delivery.When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.For cross-region subscriptions, the region in which the topic resides.This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.The ARN of the topic to subscribe to.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setDeliveryPolicy
(Object value) The delivery policy JSON assigned to the subscription.void
setEndpoint
(String value) The subscription's endpoint.void
setFilterPolicy
(Object value) The filter policy JSON assigned to the subscription.void
setFilterPolicyScope
(String value) This attribute lets you choose the filtering scope by using one of the following string value types:.void
setProtocol
(String value) The subscription's protocol.void
setRawMessageDelivery
(Boolean value) When set totrue
, enables raw message delivery.void
setRawMessageDelivery
(IResolvable value) When set totrue
, enables raw message delivery.void
setRedrivePolicy
(Object value) When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.void
For cross-region subscriptions, the region in which the topic resides.void
setSubscriptionRoleArn
(String value) This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.void
setTopicArn
(String value) The ARN of the topic to subscribe to.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnSubscription
protected CfnSubscription(software.amazon.jsii.JsiiObjectRef objRef) -
CfnSubscription
protected CfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnSubscription
@Stability(Stable) public CfnSubscription(@NotNull Construct scope, @NotNull String id, @NotNull CfnSubscriptionProps props) Create a newAWS::SNS::Subscription
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getDeliveryPolicy
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 . -
setDeliveryPolicy
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 . -
getFilterPolicy
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 . -
setFilterPolicy
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 . -
getProtocol
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 . -
setProtocol
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 . -
getRedrivePolicy
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 .
-
setRedrivePolicy
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 .
-
getTopicArn
The ARN of the topic to subscribe to. -
setTopicArn
The ARN of the topic to subscribe to. -
getEndpoint
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 . -
setEndpoint
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 . -
getFilterPolicyScope
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.
-
setFilterPolicyScope
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.
-
getRawMessageDelivery
When set totrue
, 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 . -
setRawMessageDelivery
When set totrue
, 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 . -
setRawMessageDelivery
When set totrue
, 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 . -
getRegion
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 aAWS::SNS::Subscription
resource, that operation will fail unless you are either:- Updating the
Region
fromNULL
to the caller region. - Updating the
Region
from the caller region toNULL
.
- Updating the
-
setRegion
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 aAWS::SNS::Subscription
resource, that operation will fail unless you are either:- Updating the
Region
fromNULL
to the caller region. - Updating the
Region
from the caller region toNULL
.
- Updating the
-
getSubscriptionRoleArn
This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.Specify the ARN of the IAM role that has the following:
- Permission to write to the Amazon Kinesis Data Firehose delivery stream
- Amazon SNS listed as a trusted entity
Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see Fanout to Amazon Kinesis Data Firehose delivery streams in the Amazon SNS Developer Guide.
-
setSubscriptionRoleArn
This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.Specify the ARN of the IAM role that has the following:
- Permission to write to the Amazon Kinesis Data Firehose delivery stream
- Amazon SNS listed as a trusted entity
Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see Fanout to Amazon Kinesis Data Firehose delivery streams in the Amazon SNS Developer Guide.
-