espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
266 stars 157 forks source link

Just In Time registration on AWS (CA-132) #50

Open asurti9 opened 3 years ago

asurti9 commented 3 years ago

Hello,

We have a requirement like below: We will be having multiple devices which needs to be connected to the AWS IoT cloud. Each one of them has a unique device ID. We need to register all the devices using Just In Time registration, such that a unique thing name is created when the robot is connected to the cloud first time. The thingname can be the device ID which is unique. Here we want to implement the feature mentioned in the below link: https://docs.aws.amazon.com/iot/latest/developerguide/auto-register-device-cert.html The question here is, is this possible with this example code? And if it is, then how we can enable this?

Thanks in advance!

shahpiyushv commented 3 years ago

@asurti9 , the entire Just in Time Registration/Provisioning is independent of the MQTT client side implementation. From the client's perspective, you still have a private key, a client certificate and a server certificate and so, the examples in esp-aws-iot will work fine. Rest all is managed by AWS, either automatically like in case of JITP, or via some Lambda, like in case of JITR. Just note that the first MQTT connection from any new client would fail in this case as the appropriate workflow gets triggered in AWS backend during the first connection attempt. However, all subsequent connections would work fine.