aws-cdk-lib.aws_iot.CfnTopicRule.ActionProperty

interface ActionProperty

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

Describes the actions associated with 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 actionProperty: iot.CfnTopicRule.ActionProperty = {
  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',
    },
  },
};

Properties

NameTypeDescription
cloudwatchAlarm?IResolvable | CloudwatchAlarmActionPropertyChange the state of a CloudWatch alarm.
cloudwatchLogs?IResolvable | CloudwatchLogsActionPropertySends data to CloudWatch.
cloudwatchMetric?IResolvable | CloudwatchMetricActionPropertyCapture a CloudWatch metric.
dynamoDBv2?IResolvable | DynamoDBv2ActionPropertyWrite to a DynamoDB table.
dynamoDb?IResolvable | DynamoDBActionPropertyWrite to a DynamoDB table.
elasticsearch?IResolvable | ElasticsearchActionPropertyWrite data to an Amazon OpenSearch Service domain.
firehose?IResolvable | FirehoseActionPropertyWrite to an Amazon Kinesis Firehose stream.
http?IResolvable | HttpActionPropertySend data to an HTTPS endpoint.
iotAnalytics?IResolvable | IotAnalyticsActionPropertySends message data to an AWS IoT Analytics channel.
iotEvents?IResolvable | IotEventsActionPropertySends an input to an AWS IoT Events detector.
iotSiteWise?IResolvable | IotSiteWiseActionPropertySends data from the MQTT message that triggered the rule to AWS IoT SiteWise asset properties.
kafka?IResolvable | KafkaActionPropertySend messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
kinesis?IResolvable | KinesisActionPropertyWrite data to an Amazon Kinesis stream.
lambda?IResolvable | LambdaActionPropertyInvoke a Lambda function.
location?IResolvable | LocationActionPropertySends device location data to Amazon Location Service .
openSearch?IResolvable | OpenSearchActionPropertyWrite data to an Amazon OpenSearch Service domain.
republish?IResolvable | RepublishActionPropertyPublish to another MQTT topic.
s3?IResolvable | S3ActionPropertyWrite to an Amazon S3 bucket.
sns?IResolvable | SnsActionPropertyPublish to an Amazon SNS topic.
sqs?IResolvable | SqsActionPropertyPublish to an Amazon SQS queue.
stepFunctions?IResolvable | StepFunctionsActionPropertyStarts execution of a Step Functions state machine.
timestream?IResolvable | TimestreamActionPropertyWrites attributes from an MQTT message.

cloudwatchAlarm?

Type: IResolvable | CloudwatchAlarmActionProperty (optional)

Change the state of a CloudWatch alarm.


cloudwatchLogs?

Type: IResolvable | CloudwatchLogsActionProperty (optional)

Sends data to CloudWatch.


cloudwatchMetric?

Type: IResolvable | CloudwatchMetricActionProperty (optional)

Capture a CloudWatch metric.


dynamoDBv2?

Type: IResolvable | DynamoDBv2ActionProperty (optional)

Write to a DynamoDB table.

This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.


dynamoDb?

Type: IResolvable | DynamoDBActionProperty (optional)

Write to a DynamoDB table.


elasticsearch?

Type: IResolvable | ElasticsearchActionProperty (optional)

Write data to an Amazon OpenSearch Service domain.

The Elasticsearch action can only be used by existing rule actions. To create a new rule action or to update an existing rule action, use the OpenSearch rule action instead. For more information, see OpenSearchAction .


firehose?

Type: IResolvable | FirehoseActionProperty (optional)

Write to an Amazon Kinesis Firehose stream.


http?

Type: IResolvable | HttpActionProperty (optional)

Send data to an HTTPS endpoint.


iotAnalytics?

Type: IResolvable | IotAnalyticsActionProperty (optional)

Sends message data to an AWS IoT Analytics channel.


iotEvents?

Type: IResolvable | IotEventsActionProperty (optional)

Sends an input to an AWS IoT Events detector.


iotSiteWise?

Type: IResolvable | IotSiteWiseActionProperty (optional)

Sends data from the MQTT message that triggered the rule to AWS IoT SiteWise asset properties.


kafka?

Type: IResolvable | KafkaActionProperty (optional)

Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.


kinesis?

Type: IResolvable | KinesisActionProperty (optional)

Write data to an Amazon Kinesis stream.


lambda?

Type: IResolvable | LambdaActionProperty (optional)

Invoke a Lambda function.


location?

Type: IResolvable | LocationActionProperty (optional)

Sends device location data to Amazon Location Service .


openSearch?

Type: IResolvable | OpenSearchActionProperty (optional)

Write data to an Amazon OpenSearch Service domain.


republish?

Type: IResolvable | RepublishActionProperty (optional)

Publish to another MQTT topic.


s3?

Type: IResolvable | S3ActionProperty (optional)

Write to an Amazon S3 bucket.


sns?

Type: IResolvable | SnsActionProperty (optional)

Publish to an Amazon SNS topic.


sqs?

Type: IResolvable | SqsActionProperty (optional)

Publish to an Amazon SQS queue.


stepFunctions?

Type: IResolvable | StepFunctionsActionProperty (optional)

Starts execution of a Step Functions state machine.


timestream?

Type: IResolvable | TimestreamActionProperty (optional)

Writes attributes from an MQTT message.