The task is to control the ESP over internet(not intranet) by building one way communication from a mobile app to ESP8266(12E). The app would be publishing messages to AWS IoT which the ESP should receive(the app is not part of requirement).
1. Build a sketch using arduino IDE 1.8 for ESP8266-12E board which connects to AWS IoT securely, it can be through MQTT or websockets or any other way.
2. ESP should then register itself programatically(if required) and create & subscribe to its own unique topic(eg:"Device12345"). ESP will then listen to this topic without blocking in order to receive any messages published to it. The received msg can simply be printed to serial.
3. There should not be any manual process to either register/create topic etc for each device separately, though there can be a one time activity post which it should allow any number of ESP to create & subscribe to its own topic programatically.
I'm open to use any server other than AWS IoT as long as it has a good free tier eg. Google pub/sub. Don't need any other server or app code, just the ESP8266 code will do(along with required libraries & AWS config steps if any).