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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.sns.ITopic
ITopic.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedTopic(software.amazon.jsii.JsiiObjectRef objRef) Topic(software.constructs.Construct scope, String id, TopicProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic ITopicfromTopicArn(software.constructs.Construct scope, String id, String topicArn) Import an existing SNS topic provided an ARN.protected BooleanControls 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, validateMethods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesizeMethods inherited from class software.constructs.Construct
toStringMethods 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.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods 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:
getAutoCreatePolicyin 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:
getTopicArnin interfaceITopic- Specified by:
getTopicArnin classTopicBase
-
getTopicName
The name of the topic.- Specified by:
getTopicNamein interfaceITopic- Specified by:
getTopicNamein classTopicBase
-