Class TopicRule

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, ITopicRule, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:57.724Z") @Stability(Experimental) public class TopicRule extends Resource implements ITopicRule
(experimental) Defines an AWS IoT Rule in this stack.

Example:

 Bucket bucket = new Bucket(this, "MyBucket");
 TopicRule.Builder.create(this, "TopicRule")
         .sql(IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"))
         .actions(List.of(
             S3PutObjectAction.Builder.create(bucket)
                     .accessControl(BucketAccessControl.PUBLIC_READ)
                     .build()))
         .build();
 
  • 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 (usually this). 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

      @Stability(Experimental) public void addAction(@NotNull IAction action)
      (experimental) Add a action to the topic rule.

      Parameters:
      action - the action to associate with the topic rule. This parameter is required.
    • getTopicRuleArn

      @Stability(Experimental) @NotNull public String getTopicRuleArn()
      (experimental) Arn of this topic rule.
      Specified by:
      getTopicRuleArn in interface ITopicRule
    • getTopicRuleName

      @Stability(Experimental) @NotNull public String getTopicRuleName()
      (experimental) Name of this topic rule.
      Specified by:
      getTopicRuleName in interface ITopicRule