EC2: Waiting until a new instance is in running state

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

    Depending on what you are trying to do (and how many servers you plan on starting), instead of polling for the instance start events, you could install on the AMI a simple program/script that runs once when the instance starts and sends out a notification to that effect, i.e. to an AWS SNS Topic.

    The process that needs to know about new servers starting could then subscribe to this SNS topic, and would receive a push notifications each time a server starts.

    Solves the same problem from a different angle; your mileage may vary.

提交回复
热议问题