The SQS (sqs
) action sends data from an MQTT message to an Amazon Simple Queue Service (Amazon SQS) queue.
This rule action has the following requirements:
An IAM role that AWS IoT can assume to perform the sqs:SendMessage
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 to encrypt data at rest in Amazon SQS, the service must have permission to use the AWS KMS key on the caller's behalf. For more information, see Key management in the Amazon Simple Queue Service Developer Guide.
When you create an AWS IoT rule with this action, you must specify the following information:
queueUrl
The URL of the Amazon SQS queue to which to write the data. The region in this URL doesn't need to be the same AWS Region as your AWS IoT rule.
NoteThere can be additional charges for data transfer cross AWS Regions using the SQS rule action. For more information, see Amazon SQS pricing.
Supports substitution templates: API and AWS CLI only
useBase64
Set this parameter to true
to configure the rule action to base64-encode the message data before it writes the data to the Amazon SQS queue. Defaults to false
.
Supports substitution templates: No
roleArn
The IAM role that allows access to the Amazon SQS queue. For more information, see Requirements.
Supports substitution templates: No
The following JSON example defines an SQS action in an AWS IoT rule.
{
"topicRulePayload": {
"sql": "SELECT * FROM 'some/topic'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23",
"actions": [
{
"sqs": {
"queueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/my_sqs_queue",
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_sqs"
}
}
]
}
}
The following JSON example defines an SQS action with substitution templates in an AWS IoT rule.
{
"topicRulePayload": {
"sql": "SELECT * FROM 'some/topic'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23",
"actions": [
{
"sqs": {
"queueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/${topic()}",
"useBase64": true,
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_sqs"
}
}
]
}
}
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