Reputation: 1466
Problem context: AWS IoT connected to Kinesis Data Stream (KDS) usin AWS Rule Engine, there is an option for PartitionKey in Rule Engine rule definition. PartionKey could be popluated using an expression such as "${topic()}". Example message payload is
{
Id:"123"
GS:"123"
}
Question: How an expression could be defined which uses payload, something like "part${payload().GS}"
Upvotes: 0
Views: 530
Reputation: 8474
You can do this using a substitution template.
e.g.:
{
"rule": {
"sql": "SELECT * FROM 'some/topic'",
"ruleDisabled": false,
"actions": [{
"kinesis": {
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_kinesis",
"streamName": "my_kinesis_stream",
"partitionKey": "${GS}"
}
}],
}
}
Upvotes: 1