Class CfnSubscription
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.sns.CfnSubscription
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,ISubscriptionRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:18.259Z")
@Stability(Stable)
public class CfnSubscription
extends CfnResource
implements IInspectable, ISubscriptionRef
The
AWS::SNS::Subscription resource subscribes an endpoint to an Amazon 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;
Object replayPolicy;
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")
.replayPolicy(replayPolicy)
.subscriptionRoleArn("subscriptionRoleArn")
.build();
- See Also:
-
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.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.sns.ISubscriptionRef
ISubscriptionRef.Jsii$Default, ISubscriptionRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnSubscription(software.amazon.jsii.JsiiObjectRef objRef) CfnSubscription(software.constructs.Construct scope, String id, CfnSubscriptionProps props) Create a newAWS::SNS::Subscription. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForSubscription(ISubscriptionRef resource) Returns the ARN of the subscription created by theAWS::SNS::Subscriptionresource.The 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.Specifies whether Amazon resends the notification to the subscription when a message's attribute changes.A reference to a Subscription resource.This property applies only to Amazon Data Firehose delivery stream subscriptions.The ARN of the topic to subscribe to.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnSubscription.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.voidsetReplayPolicy(Object value) Specifies whether Amazon resends the notification to the subscription when a message's attribute changes.voidsetSubscriptionRoleArn(String value) This property applies only to Amazon Data Firehose delivery stream subscriptions.voidsetTopicArn(String value) The ARN of the topic to subscribe to.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnSubscriptionProps props) Create a newAWS::SNS::Subscription.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForSubscription
@Stability(Stable) @NotNull public static String arnForSubscription(@NotNull ISubscriptionRef resource) - Parameters:
resource- This parameter is required.
-
isCfnSubscription
Checks whether the given object is a CfnSubscription.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
Returns the ARN of the subscription created by theAWS::SNS::Subscriptionresource. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getSubscriptionRef
A reference to a Subscription resource.- Specified by:
getSubscriptionRefin interfaceISubscriptionRef
-
getProtocol
The subscription's protocol. -
setProtocol
The subscription's protocol. -
getTopicArn
The ARN of the topic to subscribe to. -
setTopicArn
The ARN of the topic to subscribe to. -
getDeliveryPolicy
The delivery policy JSON assigned to the subscription. -
setDeliveryPolicy
The delivery policy JSON assigned to the subscription. -
getEndpoint
The subscription's endpoint. -
setEndpoint
The subscription's endpoint. -
getFilterPolicy
The filter policy JSON assigned to the subscription. -
setFilterPolicy
The filter policy JSON assigned to the subscription. -
getFilterPolicyScope
This attribute lets you choose the filtering scope by using one of the following string value types:. -
setFilterPolicyScope
This attribute lets you choose the filtering scope by using one of the following string value types:. -
getRawMessageDelivery
When set totrue, enables raw message delivery.Returns union: either
BooleanorIResolvable -
setRawMessageDelivery
When set totrue, enables raw message delivery. -
setRawMessageDelivery
When set totrue, enables raw message delivery. -
getRedrivePolicy
When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. -
setRedrivePolicy
When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. -
getRegion
For cross-region subscriptions, the region in which the topic resides. -
setRegion
For cross-region subscriptions, the region in which the topic resides. -
getReplayPolicy
Specifies whether Amazon resends the notification to the subscription when a message's attribute changes. -
setReplayPolicy
Specifies whether Amazon resends the notification to the subscription when a message's attribute changes. -
getSubscriptionRoleArn
This property applies only to Amazon Data Firehose delivery stream subscriptions. -
setSubscriptionRoleArn
This property applies only to Amazon Data Firehose delivery stream subscriptions.
-