Retry query on certain EC2 status codes