Class TopicRule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.iot.alpha.TopicRule
- All Implemented Interfaces:
IResource,ITopicRule,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:50.189Z")
@Stability(Experimental)
public class TopicRule
extends Resource
implements ITopicRule
(experimental) Defines an AWS IoT Rule in this stack.
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 ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forTopicRule.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.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.iot.alpha.ITopicRule
ITopicRule.Jsii$Default, ITopicRule.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedTopicRule(software.amazon.jsii.JsiiObjectRef objRef) TopicRule(software.constructs.Construct scope, String id, TopicRuleProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid(experimental) Add a action to the topic rule.static ITopicRulefromTopicRuleArn(software.constructs.Construct scope, String id, String topicRuleArn) (experimental) Import an existing AWS IoT Rule provided an ARN.(experimental) Arn of this topic rule.(experimental) Name of this topic rule.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
TopicRule
protected TopicRule(software.amazon.jsii.JsiiObjectRef objRef) -
TopicRule
protected TopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
TopicRule
@Stability(Experimental) public TopicRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TopicRuleProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromTopicRuleArn
@Stability(Experimental) @NotNull public static ITopicRule fromTopicRuleArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String topicRuleArn) (experimental) Import an existing AWS IoT Rule provided an ARN.- Parameters:
scope- The parent creating construct (usuallythis). This parameter is required.id- The construct's name. This parameter is required.topicRuleArn- AWS IoT Rule ARN (i.e. arn:aws:iot::invalid input: '<'account-id>:rule/MyRule). This parameter is required.
-
addAction
(experimental) Add a action to the topic rule.- Parameters:
action- the action to associate with the topic rule. This parameter is required.
-
getTopicRuleArn
(experimental) Arn of this topic rule.- Specified by:
getTopicRuleArnin interfaceITopicRule
-
getTopicRuleName
(experimental) Name of this topic rule.- Specified by:
getTopicRuleNamein interfaceITopicRule
-