class IotSql
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IoT.Alpha.IotSql |
Go | github.com/aws/aws-cdk-go/awscdkiotalpha/v2#IotSql |
Java | software.amazon.awscdk.services.iot.alpha.IotSql |
Python | aws_cdk.aws_iot_alpha.IotSql |
TypeScript (source) | @aws-cdk/aws-iot-alpha 禄 IotSql |
Defines AWS IoT SQL.
Example
import * as sns from 'aws-cdk-lib/aws-sns';
const topic = new sns.Topic(this, 'MyTopic');
const topicRule = new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323(
"SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'",
),
actions: [
new actions.SnsTopicAction(topic, {
messageFormat: actions.SnsActionMessageFormat.JSON, // optional property, default is SnsActionMessageFormat.RAW
}),
],
});
Initializer
new IotSql()
Methods
Name | Description |
---|---|
bind(scope) | Returns the IoT SQL configuration. |
static from | Uses the original SQL version built on 2015-10-08. |
static from | Uses the SQL version built on 2016-03-23. |
static from | Uses the most recent beta SQL version. |
bind(scope)
public bind(scope: Construct): IotSqlConfig
Parameters
- scope
Construct
Returns
Returns the IoT SQL configuration.
static fromStringAsVer20151008(sql)
public static fromStringAsVer20151008(sql: string): IotSql
Parameters
- sql
string
鈥� The actual SQL-like syntax query.
Returns
Uses the original SQL version built on 2015-10-08.
static fromStringAsVer20160323(sql)
public static fromStringAsVer20160323(sql: string): IotSql
Parameters
- sql
string
鈥� The actual SQL-like syntax query.
Returns
Uses the SQL version built on 2016-03-23.
static fromStringAsVerNewestUnstable(sql)
public static fromStringAsVerNewestUnstable(sql: string): IotSql
Parameters
- sql
string
鈥� The actual SQL-like syntax query.
Returns
Uses the most recent beta SQL version.
If you use this version, it might introduce breaking changes to your rules.