EC2: Waiting until a new instance is in running state

前端 未结 6 2214
死守一世寂寞
死守一世寂寞 2021-02-19 23:33

I would like to create a new instance based on my stored AMI.

I achieve this by the following code:

RunInstancesRequest rir = new RunInstancesRequest(ima         


        
6条回答
  •  死守一世寂寞
    2021-02-19 23:36

    You can use boto3 waiters, https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#waiters

    for this ex: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Waiter.InstanceRunning

    Or in Java https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/ I am sure there are waiters implemented in all the AWS sdks.

提交回复
热议问题