The Kinesis Data Streams (kinesis
) action writes data from an MQTT message to Amazon Kinesis Data Streams.
This rule action has the following requirements:
An IAM role that AWS IoT can assume to perform the kinesis:PutRecord
operation. For more information, see Granting an AWS IoT rule the access it requires.
In the AWS IoT console, you can choose or create a role to allow AWS IoT to perform this rule action.
If you use an AWS KMS customer-managed AWS KMS key (KMS key) to encrypt data at rest in Kinesis Data Streams, the service must have permission to use the AWS KMS key on the caller's behalf. For more information, see Permissions to use user-generated AWS KMS keys in the Amazon Kinesis Data Streams Developer Guide.
When you create an AWS IoT rule with this action, you must specify the following information:
stream
The Kinesis data stream to which to write data.
Supports substitution templates: API and AWS CLI only
partitionKey
The partition key used to determine to which shard the data is written. The partition key is usually composed of an expression (for example, ${topic()}
or ${timestamp()}
).
Supports substitution templates: Yes
roleArn
The ARN of the IAM role that grants AWS IoT permission to access the Kinesis data stream. For more information, see Requirements.
Supports substitution templates: No
The following JSON example defines a Kinesis Data Streams action in an AWS IoT rule.
{
"topicRulePayload": {
"sql": "SELECT * FROM 'some/topic'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23",
"actions": [
{
"kinesis": {
"streamName": "my_kinesis_stream",
"partitionKey": "${topic()}",
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_kinesis"
}
}
]
}
}
The following JSON example defines a Kinesis action with substitution templates in an AWS IoT rule.
{
"topicRulePayload": {
"sql": "SELECT * FROM 'some/topic'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23",
"actions": [
{
"kinesis": {
"streamName": "${topic()}",
"partitionKey": "${timestamp()}",
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_kinesis"
}
}
]
}
}
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