@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.233Z") @Stability(value=Stable) public class CfnSubscription extends CfnResource implements IInspectable
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)
.rawMessageDelivery(false)
.redrivePolicy(redrivePolicy)
.region("region")
.subscriptionRoleArn("subscriptionRoleArn")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnSubscription.Builder
A fluent builder for
CfnSubscription. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnSubscription(software.constructs.Construct scope,
String id,
CfnSubscriptionProps props)
Create a new `AWS::SNS::Subscription`.
|
protected |
CfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnSubscription(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
getCfnProperties() |
Object |
getDeliveryPolicy()
The delivery policy JSON assigned to the subscription.
|
String |
getEndpoint()
The subscription's endpoint.
|
Object |
getFilterPolicy()
The filter policy JSON assigned to the subscription.
|
String |
getProtocol()
The subscription's protocol.
|
Object |
getRawMessageDelivery()
When set to `true` , enables raw message delivery.
|
Object |
getRedrivePolicy()
When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
|
String |
getRegion()
For cross-region subscriptions, the region in which the topic resides.
|
String |
getSubscriptionRoleArn()
This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.
|
String |
getTopicArn()
The ARN of the topic to subscribe to.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
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 |
setProtocol(String value)
The subscription's protocol.
|
void |
setRawMessageDelivery(Boolean value)
When set to `true` , enables raw message delivery.
|
void |
setRawMessageDelivery(IResolvable value)
When set to `true` , enables raw message delivery.
|
void |
setRedrivePolicy(Object value)
When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
|
void |
setRegion(String value)
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.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnSubscription(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnSubscription(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnSubscriptionProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getDeliveryPolicy()
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 .
@Stability(value=Stable)
public void setDeliveryPolicy(@NotNull
Object value)
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 .
@Stability(value=Stable) @NotNull public Object getFilterPolicy()
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 .
@Stability(value=Stable)
public void setFilterPolicy(@NotNull
Object value)
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 .
@Stability(value=Stable) @NotNull public String getProtocol()
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 .
@Stability(value=Stable)
public void setProtocol(@NotNull
String value)
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 .
@Stability(value=Stable) @NotNull public Object getRedrivePolicy()
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 .
@Stability(value=Stable)
public void setRedrivePolicy(@NotNull
Object value)
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 .
@Stability(value=Stable) @NotNull public String getTopicArn()
@Stability(value=Stable)
public void setTopicArn(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getEndpoint()
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 .
@Stability(value=Stable)
public void setEndpoint(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public Object getRawMessageDelivery()
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 .
@Stability(value=Stable)
public void setRawMessageDelivery(@Nullable
Boolean value)
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 .
@Stability(value=Stable)
public void setRawMessageDelivery(@Nullable
IResolvable value)
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 .
@Stability(value=Stable) @Nullable public String getRegion()
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:
Region from NULL to the caller region.Region from the caller region to NULL .@Stability(value=Stable)
public void setRegion(@Nullable
String value)
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:
Region from NULL to the caller region.Region from the caller region to NULL .@Stability(value=Stable) @Nullable public String getSubscriptionRoleArn()
Specify the ARN of the IAM role that has the following:
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.
@Stability(value=Stable)
public void setSubscriptionRoleArn(@Nullable
String value)
Specify the ARN of the IAM role that has the following:
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.
Copyright © 2022. All rights reserved.