IotSql

class aws_cdk.aws_iot_alpha.IotSql

Bases: object

(experimental) Defines AWS IoT SQL.

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_sns as sns


topic = sns.Topic(self, "MyTopic")

topic_rule = iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
    actions=[
        actions.SnsTopicAction(topic,
            message_format=actions.SnsActionMessageFormat.JSON
        )
    ]
)
Stability:

experimental

Methods

abstract bind(scope)

(experimental) Returns the IoT SQL configuration.

Parameters:

scope (Construct) –

Stability:

experimental

Return type:

IotSqlConfig

Static Methods

classmethod from_string_as_ver20151008(sql)

(experimental) Uses the original SQL version built on 2015-10-08.

Parameters:

sql (str) – The actual SQL-like syntax query.

Return type:

IotSql

Returns:

Instance of IotSql

Stability:

experimental

classmethod from_string_as_ver20160323(sql)

(experimental) Uses the SQL version built on 2016-03-23.

Parameters:

sql (str) – The actual SQL-like syntax query.

Return type:

IotSql

Returns:

Instance of IotSql

Stability:

experimental

classmethod from_string_as_ver_newest_unstable(sql)

(experimental) Uses the most recent beta SQL version.

If you use this version, it might introduce breaking changes to your rules.

Parameters:

sql (str) – The actual SQL-like syntax query.

Return type:

IotSql

Returns:

Instance of IotSql

Stability:

experimental