Class CfnDetectorModel.DynamoDBProperty
Defines an action to write to the Amazon DynamoDB table that you created.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.IoTEvents
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DynamoDBProperty : Object, CfnDetectorModel.IDynamoDBProperty
Syntax (vb)
Public Class DynamoDBProperty
Inherits Object
Implements CfnDetectorModel.IDynamoDBProperty
Remarks
The standard action payload contains all the information about the detector model instance and the event that triggered the action. You can customize the payload . One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify.
You must use expressions for all parameters in DynamoDBAction
. The expressions accept literals, operators, functions, references, and substitution templates.
Examples - For literal values, the expressions must contain single quotes. For example, the value for the hashKeyType
parameter can be 'STRING'
.
In the following example, the value for the hashKeyValue
parameter uses a substitution template.
'${$input.GreenhouseInput.temperature * 6 / 5 + 32} in Fahrenheit'
In the following example, the value for the tableName
parameter uses a string concatenation.
'GreenhouseTemperatureTable ' + $input.GreenhouseInput.date
For more information, see Expressions in the AWS IoT Events Developer Guide .
If the defined payload type is a string, DynamoDBAction
writes non-JSON data to the DynamoDB table as binary data. The DynamoDB console displays the data as Base64-encoded text. The value for the payloadField
parameter is <payload-field>_raw
.
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.IoTEvents;
var dynamoDBProperty = new DynamoDBProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
Operation = "operation",
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
};
Synopsis
Constructors
DynamoDBProperty() |
Properties
HashKeyField | The name of the hash key (also called the partition key). |
HashKeyType | The data type for the hash key (also called the partition key). You can specify the following values:. |
HashKeyValue | The value of the hash key (also called the partition key). |
Operation | The type of operation to perform. You can specify the following values:. |
Payload | Information needed to configure the payload. |
PayloadField | The name of the DynamoDB column that receives the action payload. |
RangeKeyField | The name of the range key (also called the sort key). |
RangeKeyType | The data type for the range key (also called the sort key), You can specify the following values:. |
RangeKeyValue | The value of the range key (also called the sort key). |
TableName | The name of the DynamoDB table. |
Constructors
DynamoDBProperty()
public DynamoDBProperty()
Properties
HashKeyField
The name of the hash key (also called the partition key).
public string HashKeyField { get; set; }
Property Value
System.String
Remarks
The hashKeyField
value must match the partition key of the target DynamoDB table.
HashKeyType
The data type for the hash key (also called the partition key). You can specify the following values:.
public string HashKeyType { get; set; }
Property Value
System.String
Remarks
If you don't specify hashKeyType
, the default value is 'STRING'
.
HashKeyValue
The value of the hash key (also called the partition key).
public string HashKeyValue { get; set; }
Property Value
System.String
Remarks
Operation
The type of operation to perform. You can specify the following values:.
public string Operation { get; set; }
Property Value
System.String
Remarks
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
Payload
Information needed to configure the payload.
public object Payload { get; set; }
Property Value
System.Object
Remarks
By default, AWS IoT Events generates a standard payload in JSON for any action. This action payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. To configure the action payload, you can use contentExpression
.
PayloadField
The name of the DynamoDB column that receives the action payload.
public string PayloadField { get; set; }
Property Value
System.String
Remarks
If you don't specify this parameter, the name of the DynamoDB column is payload
.
RangeKeyField
The name of the range key (also called the sort key).
public string RangeKeyField { get; set; }
Property Value
System.String
Remarks
The rangeKeyField
value must match the sort key of the target DynamoDB table.
RangeKeyType
The data type for the range key (also called the sort key), You can specify the following values:.
public string RangeKeyType { get; set; }
Property Value
System.String
Remarks
If you don't specify rangeKeyField
, the default value is 'STRING'
.
RangeKeyValue
The value of the range key (also called the sort key).
public string RangeKeyValue { get; set; }
Property Value
System.String
Remarks
TableName
The name of the DynamoDB table.
public string TableName { get; set; }
Property Value
System.String
Remarks
The tableName
value must match the table name of the target DynamoDB table.