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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnSubscription(Construct scope, String id, CfnSubscriptionProps props) Create a newAWS::SNS::Subscription.protectedCfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnSubscription(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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDeliveryPolicy(Object value) The delivery policy JSON assigned to the subscription.voidsetEndpoint(String value) The subscription's endpoint.voidsetFilterPolicy(Object value) The filter policy JSON assigned to the subscription.voidsetFilterPolicyScope(String value) This attribute lets you choose the filtering scope by using one of the following string value types:.voidsetProtocol(String value) The subscription's protocol.voidsetRawMessageDelivery(Boolean value) When set totrue, enables raw message delivery.voidsetRawMessageDelivery(IResolvable value) When set totrue, enables raw message delivery.voidsetRedrivePolicy(Object value) When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.voidFor cross-region subscriptions, the region in which the topic resides.voidsetSubscriptionRoleArn(String value) This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.voidsetTopicArn(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, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin 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
Protocolparameter 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
Protocolparameter 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
Endpointparameter 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
Endpointparameter 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
Regionproperty of aAWS::SNS::Subscriptionresource, that operation will fail unless you are either:- Updating the
RegionfromNULLto the caller region. - Updating the
Regionfrom 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
Regionproperty of aAWS::SNS::Subscriptionresource, that operation will fail unless you are either:- Updating the
RegionfromNULLto the caller region. - Updating the
Regionfrom 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.
-