hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder
https://www.packer.io/docs/builders/amazon
Mozilla Public License 2.0
72 stars 110 forks source link

amazon-chroot instance id error #467

Closed phochard closed 6 months ago

phochard commented 6 months ago

Hello,

We've been working on the same packer configuration file using amazon-chroot builder since weeks now and we are still stuck with the same error : "Error retrieving the ID of the instance Packer is running on."

As we are just testing for now our configuration file looks like this :

{
  "type": "amazon-chroot",
  "access_key": "YOUR KEY HERE",
  "secret_key": "YOUR SECRET KEY HERE",
  "source_ami": "ami-e81d5881",
  "ami_name": "packer-amazon-chroot {{timestamp}}"
}

This is a basic example we found here : (

We already asked AWS support for help but no one is able to give us a relevant answer.

Does someone here knows what we are doing wrong ?

Thanks a lot.

Pauline

lbajolet-hashicorp commented 6 months ago

Hi @phochard,

The chroot builder is intended to run directly on a Linux AWS instance, is this the environment you're running your builds in? The error you're seeing is the plugin attempting to get the metadata from the IMDS server embedded on the instance, you can also experience that if it's not reachable for some reason, but it's hard to say what's the issue at that point. The error from the client could be forwarded to the UI though so you have something to troubleshoot your issue with.

This being said, I should point you to our Discuss instance for questions like these, as Github is mostly for us maintainers to track bugs/feature requests for the AWS plugin. We have an active community on Discuss, which may be better suited to answer your questions when it comes to Packer usage.

I'll close the issue now, but please feel free to respond or reopen if you think I missed something and there's something to do on our front.

Thanks!