aws-cdk-lib.aws_iot.CfnTopicRule.TopicRulePayloadProperty

interface TopicRulePayloadProperty

LanguageType name
.NETAmazon.CDK.AWS.IoT.CfnTopicRule.TopicRulePayloadProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsiot#CfnTopicRule_TopicRulePayloadProperty
Javasoftware.amazon.awscdk.services.iot.CfnTopicRule.TopicRulePayloadProperty
Pythonaws_cdk.aws_iot.CfnTopicRule.TopicRulePayloadProperty
TypeScript aws-cdk-lib » aws_iot » CfnTopicRule » TopicRulePayloadProperty

Describes a rule.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const topicRulePayloadProperty: iot.CfnTopicRule.TopicRulePayloadProperty = {
  actions: [{
    cloudwatchAlarm: {
      alarmName: 'alarmName',
      roleArn: 'roleArn',
      stateReason: 'stateReason',
      stateValue: 'stateValue',
    },
    cloudwatchLogs: {
      logGroupName: 'logGroupName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
    },
    cloudwatchMetric: {
      metricName: 'metricName',
      metricNamespace: 'metricNamespace',
      metricUnit: 'metricUnit',
      metricValue: 'metricValue',
      roleArn: 'roleArn',

      // the properties below are optional
      metricTimestamp: 'metricTimestamp',
    },
    dynamoDb: {
      hashKeyField: 'hashKeyField',
      hashKeyValue: 'hashKeyValue',
      roleArn: 'roleArn',
      tableName: 'tableName',

      // the properties below are optional
      hashKeyType: 'hashKeyType',
      payloadField: 'payloadField',
      rangeKeyField: 'rangeKeyField',
      rangeKeyType: 'rangeKeyType',
      rangeKeyValue: 'rangeKeyValue',
    },
    dynamoDBv2: {
      putItem: {
        tableName: 'tableName',
      },
      roleArn: 'roleArn',
    },
    elasticsearch: {
      endpoint: 'endpoint',
      id: 'id',
      index: 'index',
      roleArn: 'roleArn',
      type: 'type',
    },
    firehose: {
      deliveryStreamName: 'deliveryStreamName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
      separator: 'separator',
    },
    http: {
      url: 'url',

      // the properties below are optional
      auth: {
        sigv4: {
          roleArn: 'roleArn',
          serviceName: 'serviceName',
          signingRegion: 'signingRegion',
        },
      },
      confirmationUrl: 'confirmationUrl',
      headers: [{
        key: 'key',
        value: 'value',
      }],
    },
    iotAnalytics: {
      channelName: 'channelName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
    },
    iotEvents: {
      inputName: 'inputName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
      messageId: 'messageId',
    },
    iotSiteWise: {
      putAssetPropertyValueEntries: [{
        propertyValues: [{
          timestamp: {
            timeInSeconds: 'timeInSeconds',

            // the properties below are optional
            offsetInNanos: 'offsetInNanos',
          },
          value: {
            booleanValue: 'booleanValue',
            doubleValue: 'doubleValue',
            integerValue: 'integerValue',
            stringValue: 'stringValue',
          },

          // the properties below are optional
          quality: 'quality',
        }],

        // the properties below are optional
        assetId: 'assetId',
        entryId: 'entryId',
        propertyAlias: 'propertyAlias',
        propertyId: 'propertyId',
      }],
      roleArn: 'roleArn',
    },
    kafka: {
      clientProperties: {
        clientPropertiesKey: 'clientProperties',
      },
      destinationArn: 'destinationArn',
      topic: 'topic',

      // the properties below are optional
      key: 'key',
      partition: 'partition',
    },
    kinesis: {
      roleArn: 'roleArn',
      streamName: 'streamName',

      // the properties below are optional
      partitionKey: 'partitionKey',
    },
    lambda: {
      functionArn: 'functionArn',
    },
    location: {
      deviceId: 'deviceId',
      latitude: 'latitude',
      longitude: 'longitude',
      roleArn: 'roleArn',
      trackerName: 'trackerName',

      // the properties below are optional
      timestamp: {
        value: 'value',

        // the properties below are optional
        unit: 'unit',
      },
    },
    openSearch: {
      endpoint: 'endpoint',
      id: 'id',
      index: 'index',
      roleArn: 'roleArn',
      type: 'type',
    },
    republish: {
      roleArn: 'roleArn',
      topic: 'topic',

      // the properties below are optional
      headers: {
        contentType: 'contentType',
        correlationData: 'correlationData',
        messageExpiry: 'messageExpiry',
        payloadFormatIndicator: 'payloadFormatIndicator',
        responseTopic: 'responseTopic',
        userProperties: [{
          key: 'key',
          value: 'value',
        }],
      },
      qos: 123,
    },
    s3: {
      bucketName: 'bucketName',
      key: 'key',
      roleArn: 'roleArn',

      // the properties below are optional
      cannedAcl: 'cannedAcl',
    },
    sns: {
      roleArn: 'roleArn',
      targetArn: 'targetArn',

      // the properties below are optional
      messageFormat: 'messageFormat',
    },
    sqs: {
      queueUrl: 'queueUrl',
      roleArn: 'roleArn',

      // the properties below are optional
      useBase64: false,
    },
    stepFunctions: {
      roleArn: 'roleArn',
      stateMachineName: 'stateMachineName',

      // the properties below are optional
      executionNamePrefix: 'executionNamePrefix',
    },
    timestream: {
      databaseName: 'databaseName',
      dimensions: [{
        name: 'name',
        value: 'value',
      }],
      roleArn: 'roleArn',
      tableName: 'tableName',

      // the properties below are optional
      timestamp: {
        unit: 'unit',
        value: 'value',
      },
    },
  }],
  sql: 'sql',

  // the properties below are optional
  awsIotSqlVersion: 'awsIotSqlVersion',
  description: 'description',
  errorAction: {
    cloudwatchAlarm: {
      alarmName: 'alarmName',
      roleArn: 'roleArn',
      stateReason: 'stateReason',
      stateValue: 'stateValue',
    },
    cloudwatchLogs: {
      logGroupName: 'logGroupName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
    },
    cloudwatchMetric: {
      metricName: 'metricName',
      metricNamespace: 'metricNamespace',
      metricUnit: 'metricUnit',
      metricValue: 'metricValue',
      roleArn: 'roleArn',

      // the properties below are optional
      metricTimestamp: 'metricTimestamp',
    },
    dynamoDb: {
      hashKeyField: 'hashKeyField',
      hashKeyValue: 'hashKeyValue',
      roleArn: 'roleArn',
      tableName: 'tableName',

      // the properties below are optional
      hashKeyType: 'hashKeyType',
      payloadField: 'payloadField',
      rangeKeyField: 'rangeKeyField',
      rangeKeyType: 'rangeKeyType',
      rangeKeyValue: 'rangeKeyValue',
    },
    dynamoDBv2: {
      putItem: {
        tableName: 'tableName',
      },
      roleArn: 'roleArn',
    },
    elasticsearch: {
      endpoint: 'endpoint',
      id: 'id',
      index: 'index',
      roleArn: 'roleArn',
      type: 'type',
    },
    firehose: {
      deliveryStreamName: 'deliveryStreamName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
      separator: 'separator',
    },
    http: {
      url: 'url',

      // the properties below are optional
      auth: {
        sigv4: {
          roleArn: 'roleArn',
          serviceName: 'serviceName',
          signingRegion: 'signingRegion',
        },
      },
      confirmationUrl: 'confirmationUrl',
      headers: [{
        key: 'key',
        value: 'value',
      }],
    },
    iotAnalytics: {
      channelName: 'channelName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
    },
    iotEvents: {
      inputName: 'inputName',
      roleArn: 'roleArn',

      // the properties below are optional
      batchMode: false,
      messageId: 'messageId',
    },
    iotSiteWise: {
      putAssetPropertyValueEntries: [{
        propertyValues: [{
          timestamp: {
            timeInSeconds: 'timeInSeconds',

            // the properties below are optional
            offsetInNanos: 'offsetInNanos',
          },
          value: {
            booleanValue: 'booleanValue',
            doubleValue: 'doubleValue',
            integerValue: 'integerValue',
            stringValue: 'stringValue',
          },

          // the properties below are optional
          quality: 'quality',
        }],

        // the properties below are optional
        assetId: 'assetId',
        entryId: 'entryId',
        propertyAlias: 'propertyAlias',
        propertyId: 'propertyId',
      }],
      roleArn: 'roleArn',
    },
    kafka: {
      clientProperties: {
        clientPropertiesKey: 'clientProperties',
      },
      destinationArn: 'destinationArn',
      topic: 'topic',

      // the properties below are optional
      key: 'key',
      partition: 'partition',
    },
    kinesis: {
      roleArn: 'roleArn',
      streamName: 'streamName',

      // the properties below are optional
      partitionKey: 'partitionKey',
    },
    lambda: {
      functionArn: 'functionArn',
    },
    location: {
      deviceId: 'deviceId',
      latitude: 'latitude',
      longitude: 'longitude',
      roleArn: 'roleArn',
      trackerName: 'trackerName',

      // the properties below are optional
      timestamp: {
        value: 'value',

        // the properties below are optional
        unit: 'unit',
      },
    },
    openSearch: {
      endpoint: 'endpoint',
      id: 'id',
      index: 'index',
      roleArn: 'roleArn',
      type: 'type',
    },
    republish: {
      roleArn: 'roleArn',
      topic: 'topic',

      // the properties below are optional
      headers: {
        contentType: 'contentType',
        correlationData: 'correlationData',
        messageExpiry: 'messageExpiry',
        payloadFormatIndicator: 'payloadFormatIndicator',
        responseTopic: 'responseTopic',
        userProperties: [{
          key: 'key',
          value: 'value',
        }],
      },
      qos: 123,
    },
    s3: {
      bucketName: 'bucketName',
      key: 'key',
      roleArn: 'roleArn',

      // the properties below are optional
      cannedAcl: 'cannedAcl',
    },
    sns: {
      roleArn: 'roleArn',
      targetArn: 'targetArn',

      // the properties below are optional
      messageFormat: 'messageFormat',
    },
    sqs: {
      queueUrl: 'queueUrl',
      roleArn: 'roleArn',

      // the properties below are optional
      useBase64: false,
    },
    stepFunctions: {
      roleArn: 'roleArn',
      stateMachineName: 'stateMachineName',

      // the properties below are optional
      executionNamePrefix: 'executionNamePrefix',
    },
    timestream: {
      databaseName: 'databaseName',
      dimensions: [{
        name: 'name',
        value: 'value',
      }],
      roleArn: 'roleArn',
      tableName: 'tableName',

      // the properties below are optional
      timestamp: {
        unit: 'unit',
        value: 'value',
      },
    },
  },
  ruleDisabled: false,
};

Properties

NameTypeDescription
actionsIResolvable | IResolvable | ActionProperty[]The actions associated with the rule.
sqlstringThe SQL statement used to query the topic.
awsIotSqlVersion?stringThe version of the SQL rules engine to use when evaluating the rule.
description?stringThe description of the rule.
errorAction?IResolvable | ActionPropertyThe action to take when an error occurs.
ruleDisabled?boolean | IResolvableSpecifies whether the rule is disabled.

actions

Type: IResolvable | IResolvable | ActionProperty[]

The actions associated with the rule.


sql

Type: string

The SQL statement used to query the topic.

For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide .


awsIotSqlVersion?

Type: string (optional)

The version of the SQL rules engine to use when evaluating the rule.

The default value is 2015-10-08.


description?

Type: string (optional)

The description of the rule.


errorAction?

Type: IResolvable | ActionProperty (optional)

The action to take when an error occurs.


ruleDisabled?

Type: boolean | IResolvable (optional)

Specifies whether the rule is disabled.