Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMDS option instance_metadata_tags does not work on packer 1.8.5 #428

Closed
blueprismo opened this issue Nov 1, 2023 · 2 comments
Closed

Comments

@blueprismo
Copy link

Overview of the Issue

I am using packer with ebs-volume builder to create an AMI, the goal is to create an AMI with the "Access to tags in instance metadata" feature enabled.
To do so: add the instance_metadata_tags to "enabled" in the template.pkr.hcl file. sauce

Reproduction Steps

Have an ebs volume as source like:

source "amazon-ebs" "watever" {
ami_name = "whatever"
  metadata_options {
    instance_metadata_tags = "enabled"
  }
[...]
}

Then packer build it.
Afterwards, try to create a new instance with the generated AMI.
You'll see that accessing tags from IMDS is disabled

Plugin and Packer version

From packer version
1.8.5

Simplified Packer Buildfile

build {
  sources = ["source.amazon-ebs.whatever"]

  post-processor "manifest" {
    output = "manifest.json"
    strip_path = true
  }
}

Operating system and Environment details

running on ubuntu20.04 (amd/64)

Log Fragments and crash.log files

No log errors, all executes smoothly

@blueprismo blueprismo added the bug label Nov 1, 2023
@lbajolet-hashicorp
Copy link
Contributor

lbajolet-hashicorp commented Nov 1, 2023

Hi @blueprismo,

The metadata_options are only for the instance during the build, not all the future instances the AMI created by Packer will be using, for those, you will need to explicitly select that option when creating them.

I'm not sure what you're asking for is supported by the APIs, but if so, do you have a reference to share? We could maybe implement it later, or if you feel comfortable in Go, please feel free to give it a shot, and we'll happily review!

I'll mark this as not a bug for now, but please let us know if I'm misunderstanding your issue.

@blueprismo
Copy link
Author

Hello @lbajolet-hashicorp Thanks for your fast response,
Oh what a big facepalm, thought that metadata_options would also apply for the future instances created by Packer.
Sorry for the inconvenience, this issue can be closed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants