aws-cdk-lib.aws_iot.CfnTopicRuleProps

interface CfnTopicRuleProps

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

Properties for defining a CfnTopicRule.

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 cfnTopicRuleProps: iot.CfnTopicRuleProps = {
  topicRulePayload: {
    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,
  },

  // the properties below are optional
  ruleName: 'ruleName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties

NameTypeDescription
topicRulePayloadIResolvable | TopicRulePayloadPropertyThe rule payload.
ruleName?stringThe name of the rule.
tags?CfnTag[]Metadata which can be used to manage the topic rule.

topicRulePayload

Type: IResolvable | TopicRulePayloadProperty

The rule payload.


ruleName?

Type: string (optional)

The name of the rule.


tags?

Type: CfnTag[] (optional)

Metadata which can be used to manage the topic rule.

For URI Request parameters use format: ...key1=value1&key2=value2...

For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."

For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."