EC2: Waiting until a new instance is in running state

前端 未结 6 2177
死守一世寂寞
死守一世寂寞 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:46

    boto3 has:

    instance.wait_until_running()
    

    From the boto3 docs:

    Waits until this Instance is running. This method calls EC2.Waiter.instance_running.wait() which polls EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.

提交回复
热议问题