TopicRuleProps

class aws_cdk.aws_iot.TopicRuleProps(*, sql, actions=None, description=None, enabled=None, error_action=None, topic_rule_name=None)

Bases: object

(experimental) Properties for defining an AWS IoT Rule.

Parameters:
  • sql (IotSql) – (experimental) A simplified SQL syntax to filter messages received on an MQTT topic and push the data elsewhere.

  • actions (Optional[Sequence[IAction]]) – (experimental) The actions associated with the topic rule. Default: No actions will be perform

  • description (Optional[str]) – (experimental) A textual description of the topic rule. Default: None

  • enabled (Optional[bool]) – (experimental) Specifies whether the rule is enabled. Default: true

  • error_action (Optional[IAction]) – (experimental) The action AWS IoT performs when it is unable to perform a rule’s action. Default: - no action will be performed

  • topic_rule_name (Optional[str]) – (experimental) The name of the topic rule. Default: None

Stability:

experimental

ExampleMetadata:

infused

Example:

bucket = s3.Bucket(self, "MyBucket")

iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
    actions=[
        actions.S3PutObjectAction(bucket,
            access_control=s3.BucketAccessControl.PUBLIC_READ
        )
    ]
)

Attributes

actions

(experimental) The actions associated with the topic rule.

Default:

No actions will be perform

Stability:

experimental

description

(experimental) A textual description of the topic rule.

Default:

None

Stability:

experimental

enabled

(experimental) Specifies whether the rule is enabled.

Default:

true

Stability:

experimental

error_action

(experimental) The action AWS IoT performs when it is unable to perform a rule’s action.

Default:
  • no action will be performed

Stability:

experimental

sql

(experimental) A simplified SQL syntax to filter messages received on an MQTT topic and push the data elsewhere.

See:

https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-reference.html

Stability:

experimental

topic_rule_name

(experimental) The name of the topic rule.

Default:

None

Stability:

experimental