I am using latest packer for OS X with "amazon-ebs" builder.
I do packer build
It looks like while it's doing "amazon-ebs: Waiting for AMI to become ready..." packer exits prematurely.
I am pretty sure that AWS API returns that AMI is ready. However, I wonder whether there is a better way to check whether AMI is available through all AWS facilities (including UI).
I'm afraid, since amazon only offers us eventual consistency, that there's nothing further we can do. We already wait for the image to become visible to us, and output the AMI ID, but we have no further power after that. Because of the way their API works, even if the AMI is visible to us, there's no way we can guarantee that it's visible globally.
I advise reading through this guide, and implementing their suggestion to wait using exponential back-off: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#eventual-consistency
If you'd like help figuring out how to get your downstream services to use exponential back off, I'd be happy to help here, but I think the mailing list would be the best place to go.
got it. yeah. it totally makes sense (I wasn't aware of eventual consistency).
I know this is an old thread, but since it's one of the first things that comes up when you google this issue.
I've found this little powershell command quite useful.
PreReqs: Install AWSCLI, and know your ami-id & region.
(aws ec2 describe-images --image-ids [YOUR AMI-ID] --region [AMI REGION] | ConvertFrom-Json | sel
ect -expand Images | Select -ExpandProperty state | Out-String -Stream) -eq "available"
Stick it in a loop in a wait step and you're good to go!
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I know this is an old thread, but since it's one of the first things that comes up when you google this issue.
I've found this little powershell command quite useful.
PreReqs: Install AWSCLI, and know your ami-id & region.
Stick it in a loop in a wait step and you're good to go!