Class Topic
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.sns.TopicBase
software.amazon.awscdk.services.sns.Topic
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,INotificationRuleTarget
,ITopic
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:38.198Z")
@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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.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 TypeMethodDescriptionstatic ITopic
fromTopicArn
(software.constructs.Construct scope, String id, String topicArn) Import an existing SNS topic provided an ARN.protected Boolean
Controls automatic creation of policy objects.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, grantPublish, metric, metric, metricNumberOfMessagesPublished, metricNumberOfMessagesPublished, metricNumberOfNotificationsDelivered, metricNumberOfNotificationsDelivered, metricNumberOfNotificationsFailed, metricNumberOfNotificationsFailed, metricNumberOfNotificationsFilteredOut, metricNumberOfNotificationsFilteredOut, metricNumberOfNotificationsFilteredOutInvalidAttributes, metricNumberOfNotificationsFilteredOutInvalidAttributes, metricNumberOfNotificationsFilteredOutNoMessageAttributes, metricNumberOfNotificationsFilteredOutNoMessageAttributes, metricPublishSize, metricPublishSize, metricSMSMonthToDateSpentUSD, metricSMSMonthToDateSpentUSD, metricSMSSuccessRate, metricSMSSuccessRate, validate
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.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.
-
getAutoCreatePolicy
Controls automatic creation of policy objects.Set by subclasses.
- Specified by:
getAutoCreatePolicy
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
-