DynamoDBActionProperty
Describes an action to write to a DynamoDB table.
The tableName , hashKeyField , and rangeKeyField values must match the values used when you created the table.
The hashKeyValue and rangeKeyvalue fields use a substitution template syntax. These templates provide data at runtime. The syntax is as follows: ${ sql-expression }.
You can specify any valid expression in a WHERE or SELECT clause, including JSON properties, comparisons, calculations, and functions. For example, the following field uses the third level of the topic:
"hashKeyValue": "${topic(3)}"
The following field uses the timestamp:
"rangeKeyValue": "${timestamp()}"
For more information, see DynamoDBv2 Action in the AWS IoT Developer Guide .
| Source | |
|---|---|
| Type last changed |
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 dynamoDBActionProperty: iot.CfnTopicRule.DynamoDBActionProperty = {
hashKeyField: 'hashKeyField',
hashKeyValue: 'hashKeyValue',
roleArn: 'roleArn',
tableName: 'tableName',
// the properties below are optional
hashKeyType: 'hashKeyType',
payloadField: 'payloadField',
rangeKeyField: 'rangeKeyField',
rangeKeyType: 'rangeKeyType',
rangeKeyValue: 'rangeKeyValue',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iot as iot
dynamo_db_action_property = iot.CfnTopicRule.DynamoDBActionProperty(
hash_key_field="hashKeyField",
hash_key_value="hashKeyValue",
role_arn="roleArn",
table_name="tableName",
# the properties below are optional
hash_key_type="hashKeyType",
payload_field="payloadField",
range_key_field="rangeKeyField",
range_key_type="rangeKeyType",
range_key_value="rangeKeyValue"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iot.*;
DynamoDBActionProperty dynamoDBActionProperty = DynamoDBActionProperty.builder()
.hashKeyField("hashKeyField")
.hashKeyValue("hashKeyValue")
.roleArn("roleArn")
.tableName("tableName")
// the properties below are optional
.hashKeyType("hashKeyType")
.payloadField("payloadField")
.rangeKeyField("rangeKeyField")
.rangeKeyType("rangeKeyType")
.rangeKeyValue("rangeKeyValue")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoT;
var dynamoDBActionProperty = new DynamoDBActionProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
RoleArn = "roleArn",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
dynamoDBActionProperty := &DynamoDBActionProperty{
HashKeyField: jsii.String("hashKeyField"),
HashKeyValue: jsii.String("hashKeyValue"),
RoleArn: jsii.String("roleArn"),
TableName: jsii.String("tableName"),
// the properties below are optional
HashKeyType: jsii.String("hashKeyType"),
PayloadField: jsii.String("payloadField"),
RangeKeyField: jsii.String("rangeKeyField"),
RangeKeyType: jsii.String("rangeKeyType"),
RangeKeyValue: jsii.String("rangeKeyValue"),
}
Properties
hashKeyFieldstringhash_key_fieldstrhashKeyFieldStringHashKeyFieldstringHashKeyField*string required #hashKeyTypeoptionalstringhash_key_typeoptionalstrhashKeyTypeoptionalStringHashKeyTypeoptionalstringHashKeyTypeoptional*string #Valid values are "STRING" or "NUMBER"
hashKeyValuestringhash_key_valuestrhashKeyValueStringHashKeyValuestringHashKeyValue*string required #payloadFieldoptionalstringpayload_fieldoptionalstrpayloadFieldoptionalStringPayloadFieldoptionalstringPayloadFieldoptional*string #This name can be customized.
rangeKeyFieldoptionalstringrange_key_fieldoptionalstrrangeKeyFieldoptionalStringRangeKeyFieldoptionalstringRangeKeyFieldoptional*string #rangeKeyTypeoptionalstringrange_key_typeoptionalstrrangeKeyTypeoptionalStringRangeKeyTypeoptionalstringRangeKeyTypeoptional*string #Valid values are "STRING" or "NUMBER"
rangeKeyValueoptionalstringrange_key_valueoptionalstrrangeKeyValueoptionalStringRangeKeyValueoptionalstringRangeKeyValueoptional*string #