Here is the workflow for provisioning a device:
With the advancement in the field of IoT, Customers are building globally distributed IoT solutions with AWS. To implement global IoT solution, devices are built with required sensors and features and shipped across the globe. Devices then connect to AWS IoT and sends performance data to cloud. A device that connects to AWS IoT must be provisioned in an AWS Region. However, when devices are shipped globally, you don’t know in which AWS IoT Region the device will connect when it starts operation. To solve this issue AWS has described a process known as AWS IoT Device Provisioning.
To automate global device provisioning, we use an architecture as shown below.
The device sends a provisioning request to an Amazon API Gateway endpoint with the device id as the things name. Amazon API Gateway calls an AWS Lambda function, which implements a method to find the best region for the device and then provisions the device in that region. The best region is the one geographically closest to the device. A lambda function is written which uses the device IP address (https://ipstack.com API’s are used to get geolocation of IP address) to get the geolocation of device and closest AWS Region.
Upon successful provisioning, the following are returned to the device:
Here is the workflow for provisioning a device: