title: ec2 wait for instance to come up with timeout [Python]
body: <p>I'm using AWS python API (boto3).  My script starts a few instances and then waits for them to come up online, before proceeding doing stuff.  I want the wait to timeout after a predefined period, but I can't find any API for that in Python.  Any ideas?  A snippet of my current code:</p>
  
  <pre><code>def waitForInstance(id):
      runningWaiter = self.ec2c.get_waiter("instance_status_ok")
      runningWaiter.wait(InstanceIds = [id])
      instance = ec2resource.Instance(id)
      return instance.state
  </code></pre>
  
  <p>I can certainly do something like running this piece of code in a separate thread and terminate it if needed, but I was wondering whether there is already a built in API in boto3 for that and I'm just missing it.</p>