code: def wait_for_copy_available(self, image_id, region):
          
          waiting = True
  
          describe_image_cmd = "aws ec2 --profile {} --region {} --output json describe-images --image-id {}"\
              .format(self.aws_project, region, image_id)
          while waiting:
              res = subprocess.check_output(shlex.split(describe_image_cmd))
              print "described image returned: {}".format(res)
              image_json = parse_image_json(res)
              image_state = image_json['State']
              if image_state == 'available':
                  print "Copied AMI is renamed and ready to use!"
                  return
              elif image_state == 'failed':
                  print "Copied AMI failed for some reason..."
                  sys.exit(5)
              else:
                  print "image state is currently: {}".format(image_state)
                  print "Sleeping for 30 seconds..."
                  time.sleep(30)
docs: Wait for the newly copied ami to become available
          :param image_id: image id to monitor
          :param region: region to monitor copy