Class CfnTopicRule.DynamoDBActionProperty
Describes an action to write to a DynamoDB table.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.IoT
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DynamoDBActionProperty : Object, CfnTopicRule.IDynamoDBActionProperty
Syntax (vb)
Public Class DynamoDBActionProperty
Inherits Object
Implements CfnTopicRule.IDynamoDBActionProperty
Remarks
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 .
ExampleMetadata: fixture=_generated
Examples
// 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"
};
Synopsis
Constructors
DynamoDBActionProperty() |
Properties
HashKeyField | The hash key name. |
HashKeyType | The hash key type. |
HashKeyValue | The hash key value. |
PayloadField | The action payload. |
RangeKeyField | The range key name. |
RangeKeyType | The range key type. |
RangeKeyValue | The range key value. |
RoleArn | The ARN of the IAM role that grants access to the DynamoDB table. |
TableName | The name of the DynamoDB table. |
Constructors
DynamoDBActionProperty()
public DynamoDBActionProperty()
Properties
HashKeyField
The hash key name.
public string HashKeyField { get; set; }
Property Value
System.String
Remarks
HashKeyType
The hash key type.
public string HashKeyType { get; set; }
Property Value
System.String
Remarks
Valid values are "STRING" or "NUMBER"
HashKeyValue
The hash key value.
public string HashKeyValue { get; set; }
Property Value
System.String
Remarks
PayloadField
The action payload.
public string PayloadField { get; set; }
Property Value
System.String
Remarks
RangeKeyField
The range key name.
public string RangeKeyField { get; set; }
Property Value
System.String
Remarks
RangeKeyType
The range key type.
public string RangeKeyType { get; set; }
Property Value
System.String
Remarks
Valid values are "STRING" or "NUMBER"
RangeKeyValue
The range key value.
public string RangeKeyValue { get; set; }
Property Value
System.String
Remarks
RoleArn
The ARN of the IAM role that grants access to the DynamoDB table.
public string RoleArn { get; set; }
Property Value
System.String
Remarks
TableName
The name of the DynamoDB table.
public string TableName { get; set; }
Property Value
System.String