Class Topic
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.sns.TopicBase
software.amazon.awscdk.services.sns.Topic
- All Implemented Interfaces:
IResource
,INotificationRuleTarget
,ITopic
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:09.907Z")
@Stability(Stable)
public class Topic
extends TopicBase
A new SNS topic.
Example:
import software.amazon.awscdk.services.sns.*; Topic topic = new Topic(this, "MyTopic"); TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule") .sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'")) .actions(List.of( SnsTopicAction.Builder.create(topic) .messageFormat(SnsActionMessageFormat.JSON) .build())) .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.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.sns.ITopic
ITopic.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
Topic
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Topic
(software.amazon.jsii.JsiiObjectRef objRef) Topic
(software.constructs.Construct scope, String id, TopicProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLoggingConfig
(LoggingConfig config) Adds a delivery status logging configuration to the topic.static ITopic
fromTopicArn
(software.constructs.Construct scope, String id, String topicArn) Import an existing SNS topic provided an ARN.static ITopic
fromTopicAttributes
(software.constructs.Construct scope, String id, TopicAttributes attrs) Import an existing SNS topic provided a topic attributes.protected Boolean
Controls automatic creation of policy objects.Enables content-based deduplication for FIFO topics.getFifo()
Whether this topic is an Amazon SNS FIFO queue.The ARN of the topic.The name of the topic.Methods inherited from class software.amazon.awscdk.services.sns.TopicBase
addSubscription, addToResourcePolicy, bindAsNotificationRuleTarget, createSSLPolicyDocument, getEnforceSSL, grantPublish, grantSubscribe, metric, metric, metricNumberOfMessagesPublished, metricNumberOfMessagesPublished, metricNumberOfNotificationsDelivered, metricNumberOfNotificationsDelivered, metricNumberOfNotificationsFailed, metricNumberOfNotificationsFailed, metricNumberOfNotificationsFilteredOut, metricNumberOfNotificationsFilteredOut, metricNumberOfNotificationsFilteredOutInvalidAttributes, metricNumberOfNotificationsFilteredOutInvalidAttributes, metricNumberOfNotificationsFilteredOutNoMessageAttributes, metricNumberOfNotificationsFilteredOutNoMessageAttributes, metricPublishSize, metricPublishSize, metricSMSMonthToDateSpentUSD, metricSMSMonthToDateSpentUSD, metricSMSSuccessRate, metricSMSSuccessRate, setEnforceSSL
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
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.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Topic
protected Topic(software.amazon.jsii.JsiiObjectRef objRef) -
Topic
protected Topic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Topic
@Stability(Stable) public Topic(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable TopicProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
Topic
- Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromTopicArn
@Stability(Stable) @NotNull public static ITopic fromTopicArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String topicArn) Import an existing SNS topic provided an ARN.- Parameters:
scope
- The parent creating construct. This parameter is required.id
- The construct's name. This parameter is required.topicArn
- topic ARN (i.e. arn:aws:sns:us-east-2:444455556666:MyTopic). This parameter is required.
-
fromTopicAttributes
@Stability(Stable) @NotNull public static ITopic fromTopicAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TopicAttributes attrs) Import an existing SNS topic provided a topic attributes.- Parameters:
scope
- The parent creating construct. This parameter is required.id
- The construct's name. This parameter is required.attrs
- the attributes of the topic to import. This parameter is required.
-
addLoggingConfig
Adds a delivery status logging configuration to the topic.- Parameters:
config
- This parameter is required.
-
getAutoCreatePolicy
Controls automatic creation of policy objects.Set by subclasses.
- Specified by:
getAutoCreatePolicy
in classTopicBase
-
getContentBasedDeduplication
Enables content-based deduplication for FIFO topics.- Specified by:
getContentBasedDeduplication
in interfaceITopic
- Specified by:
getContentBasedDeduplication
in classTopicBase
-
getFifo
Whether this topic is an Amazon SNS FIFO queue.If false, this is a standard topic.
-
getTopicArn
The ARN of the topic.- Specified by:
getTopicArn
in interfaceITopic
- Specified by:
getTopicArn
in classTopicBase
-
getTopicName
The name of the topic.- Specified by:
getTopicName
in interfaceITopic
- Specified by:
getTopicName
in classTopicBase
-