A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/iot/latest/developerguide/dynamodb-rule-action.html below:

DynamoDB - AWS IoT Core

DynamoDB

The DynamoDB (dynamoDB) action writes all or part of an MQTT message to an Amazon DynamoDB table.

You can follow a tutorial that shows you how to create and test a rule with a DynamoDB action. For more information, see Tutorial: Storing device data in a DynamoDB table.

Note

This rule writes non-JSON data to DynamoDB as binary data. The DynamoDB console displays the data as base64-encoded text.

Requirements

This rule action has the following requirements:

Parameters

When you create an AWS IoT rule with this action, you must specify the following information:

tableName

The name of the DynamoDB table.

Supports substitution templates: API and AWS CLI only

hashKeyField

The name of the hash key (also called the partition key).

Supports substitution templates: API and AWS CLI only

hashKeyType

(Optional) The data type of the hash key (also called the partition key). Valid values: STRING, NUMBER.

Supports substitution templates: API and AWS CLI only

hashKeyValue

The value of the hash key. Consider using a substitution template such as ${topic()} or ${timestamp()}.

Supports substitution templates: Yes

rangeKeyField

(Optional) The name of the range key (also called the sort key).

Supports substitution templates: API and AWS CLI only

rangeKeyType

(Optional) The data type of the range key (also called the sort key). Valid values: STRING, NUMBER.

Supports substitution templates: API and AWS CLI only

rangeKeyValue

(Optional) The value of the range key. Consider using a substitution template such as ${topic()} or ${timestamp()}.

Supports substitution templates: Yes

payloadField

(Optional) The name of the column where the payload is written. If you omit this value, the payload is written to the column named payload.

Supports substitution templates: Yes

operation

(Optional) The type of operation to be performed. Valid values: INSERT, UPDATE, DELETE.

Supports substitution templates: Yes

roleARN

The IAM role that allows access to the DynamoDB table. For more information, see Requirements.

Supports substitution templates: No

The data written to the DynamoDB table is the result from the SQL statement of the rule.

Examples

The following JSON example defines a DynamoDB action in an AWS IoT rule.

{
    "topicRulePayload": {
        "sql": "SELECT * AS message FROM 'some/topic'", 
        "ruleDisabled": false,
        "awsIotSqlVersion": "2016-03-23",
        "actions": [
            {
                "dynamoDB": {
                    "tableName": "my_ddb_table",
                    "hashKeyField": "key",
                    "hashKeyValue": "${topic()}",
                    "rangeKeyField": "timestamp",
                    "rangeKeyValue": "${timestamp()}",
                    "roleArn": "arn:aws:iam::123456789012:role/aws_iot_dynamoDB"
                }
            }
        ]
    }
}
See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4