I have the need to get a prepared/configured AWS EC2 instance (my template instance), clone it (into the same region) get the corresponding IP address of the newly created instance, change its hostname and run a script inside of it to start a Node.js program using PM2.
I saw the CLI approach as well as the SDK for Node.js (because the creator program is a Nose.js endpoint), but I wasn't able to figure out how to accomplish this use case. It seems CLI has some limitations about configuring it, and the SDK in creating it, it only configures.
Does AWS exposes an integrated and official process for cloning (or at least creating), returning it's IP addr,starting, configuring and running a script inside of it?