Class CfnTopic
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.CfnTopic
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,ITopicRef,ITaggable,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.262Z")
@Stability(Stable)
public class CfnTopic
extends CfnResource
implements IInspectable, ITopicRef, ITaggable
The
AWS::SNS::Topic resource creates a topic to which notifications can be published.
One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see Amazon endpoints and quotas in the AWS General Reference .
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 archivePolicy;
Object dataProtectionPolicy;
CfnTopic cfnTopic = CfnTopic.Builder.create(this, "MyCfnTopic")
.archivePolicy(archivePolicy)
.contentBasedDeduplication(false)
.dataProtectionPolicy(dataProtectionPolicy)
.deliveryStatusLogging(List.of(LoggingConfigProperty.builder()
.protocol("protocol")
// the properties below are optional
.failureFeedbackRoleArn("failureFeedbackRoleArn")
.successFeedbackRoleArn("successFeedbackRoleArn")
.successFeedbackSampleRate("successFeedbackSampleRate")
.build()))
.displayName("displayName")
.fifoThroughputScope("fifoThroughputScope")
.fifoTopic(false)
.kmsMasterKeyId("kmsMasterKeyId")
.signatureVersion("signatureVersion")
.subscription(List.of(SubscriptionProperty.builder()
.endpoint("endpoint")
.protocol("protocol")
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.topicName("topicName")
.tracingConfig("tracingConfig")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnTopic.static interfaceTheLoggingConfigproperty type specifies theDeliverystatus logging configuration for anAWS::SNS::Topic.static interfaceSubscriptionis an embedded property that describes the subscription endpoints of an Amazon topic.Nested 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.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.sns.ITopicRef
ITopicRef.Jsii$Default, ITopicRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnTopic(software.amazon.jsii.JsiiObjectRef objRef) Create a newAWS::SNS::Topic.CfnTopic(software.constructs.Construct scope, String id, CfnTopicProps props) Create a newAWS::SNS::Topic. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForTopic(ITopicRef resource) TheArchivePolicydetermines the number of days Amazon retains messages in FIFO topics.Returns the ARN of an Amazon topic.Returns the name of an Amazon topic.ContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics.The body of the policy document you want to use for this topic.TheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.The display name to use for an Amazon topic with SMS subscriptions.Specifies the throughput quota and deduplication behavior to apply for the FIFO topic.Set to true to create a FIFO topic.The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK.The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.The Amazon subscriptions (endpoints) for this topic.getTags()Tag Manager which manages the tags for this resource.The list of tags to add to a new topic.The name of the topic you want to create.A reference to a Topic resource.Tracing mode of an Amazon topic.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanisCfnTopic(Object x) Checks whether the given object is a CfnTopic.renderProperties(Map<String, Object> props) voidsetArchivePolicy(Object value) TheArchivePolicydetermines the number of days Amazon retains messages in FIFO topics.voidContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics.voidContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics.voidsetDataProtectionPolicy(Object value) The body of the policy document you want to use for this topic.voidsetDeliveryStatusLogging(List<Object> value) TheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.voidTheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.voidsetDisplayName(String value) The display name to use for an Amazon topic with SMS subscriptions.voidsetFifoThroughputScope(String value) Specifies the throughput quota and deduplication behavior to apply for the FIFO topic.voidsetFifoTopic(Boolean value) Set to true to create a FIFO topic.voidsetFifoTopic(IResolvable value) Set to true to create a FIFO topic.voidsetKmsMasterKeyId(String value) The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK.voidsetSignatureVersion(String value) The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.voidsetSubscription(List<Object> value) The Amazon subscriptions (endpoints) for this topic.voidsetSubscription(IResolvable value) The Amazon subscriptions (endpoints) for this topic.voidsetTagsRaw(List<CfnTag> value) The list of tags to add to a new topic.voidsetTopicName(String value) The name of the topic you want to create.voidsetTracingConfig(String value) Tracing mode of an Amazon topic.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
-
CfnTopic
protected CfnTopic(software.amazon.jsii.JsiiObjectRef objRef) -
CfnTopic
protected CfnTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnTopic
@Stability(Stable) public CfnTopic(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnTopicProps props) Create a newAWS::SNS::Topic.- 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.
-
CfnTopic
@Stability(Stable) public CfnTopic(@NotNull software.constructs.Construct scope, @NotNull String id) Create a newAWS::SNS::Topic.- 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.
-
-
Method Details
-
arnForTopic
- Parameters:
resource- This parameter is required.
-
isCfnTopic
Checks whether the given object is a CfnTopic.- 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.
-
getAttrTopicArn
Returns the ARN of an Amazon topic. -
getAttrTopicName
Returns the name of an Amazon topic. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getTopicRef
A reference to a Topic resource.- Specified by:
getTopicRefin interfaceITopicRef
-
getArchivePolicy
TheArchivePolicydetermines the number of days Amazon retains messages in FIFO topics. -
setArchivePolicy
TheArchivePolicydetermines the number of days Amazon retains messages in FIFO topics. -
getContentBasedDeduplication
ContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics.Returns union: either
BooleanorIResolvable -
setContentBasedDeduplication
ContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics. -
setContentBasedDeduplication
ContentBasedDeduplicationenables deduplication of messages based on their content for FIFO topics. -
getDataProtectionPolicy
The body of the policy document you want to use for this topic. -
setDataProtectionPolicy
The body of the policy document you want to use for this topic. -
getDeliveryStatusLogging
TheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnTopic.LoggingConfigProperty> -
setDeliveryStatusLogging
TheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:. -
setDeliveryStatusLogging
TheDeliveryStatusLoggingconfiguration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:. -
getDisplayName
The display name to use for an Amazon topic with SMS subscriptions. -
setDisplayName
The display name to use for an Amazon topic with SMS subscriptions. -
getFifoThroughputScope
Specifies the throughput quota and deduplication behavior to apply for the FIFO topic. -
setFifoThroughputScope
Specifies the throughput quota and deduplication behavior to apply for the FIFO topic. -
getFifoTopic
Set to true to create a FIFO topic.Returns union: either
BooleanorIResolvable -
setFifoTopic
Set to true to create a FIFO topic. -
setFifoTopic
Set to true to create a FIFO topic. -
getKmsMasterKeyId
The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK. -
setKmsMasterKeyId
The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK. -
getSignatureVersion
The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. -
setSignatureVersion
The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. -
getSubscription
The Amazon subscriptions (endpoints) for this topic.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnTopic.SubscriptionProperty> -
setSubscription
The Amazon subscriptions (endpoints) for this topic. -
setSubscription
The Amazon subscriptions (endpoints) for this topic. -
getTagsRaw
The list of tags to add to a new topic. -
setTagsRaw
The list of tags to add to a new topic. -
getTopicName
The name of the topic you want to create. -
setTopicName
The name of the topic you want to create. -
getTracingConfig
Tracing mode of an Amazon topic. -
setTracingConfig
Tracing mode of an Amazon topic.
-