1 Answer
- Newest
- Most votes
- Most comments
1
Hi,
my proposed approach is to follow these steps:
- Point a Wireless Destination to an AWS IoT Rule (let's call it ProcessLoRaWANUplink)
- Use the following IoT SQL:
SELECT *
- Add "Republish" action and specify a topic as following:
devices/lorawan/${WirelessMetadata.LoRaWAN.DevEui}/uplinks
Please notice:
- You should double-check that including metadata is enabled in the Service Profile you assigned to the LoRaWAN device
- Double-Check that IAM Role assigned to the "Republish" action us allowing "iot:Publish" to "devices/lorawan/*". In this specific case, I recommend not to use "Create role" option when creating an Action the Management Console, but create a role using AWS IAM Management Console, using the following trust relationship:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "iot.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
and the following policy:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:<Region e.g. eu-west-1>:<Account id>:topic/devices/lorawan/*"
}
}
best regards, Andrei
answered 2 years ago
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 months ago
Thank you! Got it working. Question though, is there any kind of scalability / pricing penalty for republishing which is effectively doubling the number of messages on the broker?
Short answer is: yes, there will be price impact and no, there are no scalability concerns I see here.
Long answer: The IoT Core Message broker is not involved if you "just" specify an IoT Rule in your Wireless Destination. In such case you are billed "only" for the IoT Rules invocations and Actions executions.
If you follow the approach proposed in my reply, you will additionally be billed for a/ Repbulishing action b/ IoT IoT Core Message broker publishing.
Based on my experience I recommend to look to the actual cost estimation (https://aws.amazon.com/iot-core/pricing/), especially for LoRaWAN devices that typically ingest only few times a day / hour.