简体   繁体   中英

AWS boto3 image waiter is not working properly

I am trying to write a python script with boto3 to create an AMI of an instance and tag the AMI and snapshots. Once the AMI creation function executes I want the script to wait/sleep until the resources are created. To do that I tried the below function. But it doesn't work, Any help here?

  ec2res = boto3.resource('ec2')
  ec2res.Image('ami-XXXXXX').wait_until_exists()

The image exists. Otherwise you wouldn't have an image ID to plug into your code. That's why the waiter is returning immediately. What you likely want is Image Available

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM