See detailed tutorial at https://mongoose.ws/tutorials/mqtt-client-aws-iot/