I would like to create a new instance based on my saved AMI.
I achieve this with the following code:
RunInstancesRequest rir = new RunInstancesRequest(imageId,1, 1); // Code for configuring the settings of the new instance ... RunInstancesResult runResult = ec2.runInstances(rir);
However, I cannot wait to โlockโ / wait until the instance rises and closes from the Thread.currentThread () command. sleep (xxxx).
On the other hand, StartInstancesResult and TerminateInstancesResult gives you the ability to access the state of instances and control any changes. But what about the state of an entirely new instance?
source share