Interface TopicRuleProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
TopicRuleProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:18.971Z") @Stability(Experimental) public interface TopicRuleProps extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for defining an AWS IoT Rule.

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();
 
  • Method Details

    • getSql

      @Stability(Experimental) @NotNull IotSql getSql()
      (experimental) A simplified SQL syntax to filter messages received on an MQTT topic and push the data elsewhere.

      See Also:
    • getActions

      @Stability(Experimental) @Nullable default List<IAction> getActions()
      (experimental) The actions associated with the topic rule.

      Default: No actions will be perform

    • getDescription

      @Stability(Experimental) @Nullable default String getDescription()
      (experimental) A textual description of the topic rule.

      Default: None

    • getEnabled

      @Stability(Experimental) @Nullable default Boolean getEnabled()
      (experimental) Specifies whether the rule is enabled.

      Default: true

    • getErrorAction

      @Stability(Experimental) @Nullable default IAction getErrorAction()
      (experimental) The action AWS IoT performs when it is unable to perform a rule's action.

      Default: - no action will be performed

    • getTopicRuleName

      @Stability(Experimental) @Nullable default String getTopicRuleName()
      (experimental) The name of the topic rule.

      Default: None

    • builder

      @Stability(Experimental) static TopicRuleProps.Builder builder()
      Returns:
      a TopicRuleProps.Builder of TopicRuleProps