I believe the issue is due to eventual consistency in AWS APIs meaning that occasionally, instances will be created and subsequent API calls won't know they yet exist.
I think if we were to wrap the the call to retrieve the instance in a retryable function similar (if not) InstanceStateRefreshFunc then we could work around the issue.
I am starting to see the following issues regularly during builds:
Error finding source instance (i-6b5b81b7): The instance ID 'i-6b5b81b7' does not exist (InvalidInstanceID.NotFound)
and00:23:05.725 Build 'amazon-ebs' errored: Error waiting for AMI: 500 Internal Server Error
It appears to be related to issues with upstream Packer:
I believe the issue is due to eventual consistency in AWS APIs meaning that occasionally, instances will be created and subsequent API calls won't know they yet exist.
I think if we were to wrap the the call to retrieve the instance in a retryable function similar (if not)
InstanceStateRefreshFunc
then we could work around the issue.