Closed sam-chen-zocdoc closed 5 months ago
Hi @sam-chen-zocdoc,
This is actually an unsupported workflow on the AWS side, if an AMI enforces IMDSv2, it cannot go back to supporting both v1 and v2.
The option we're exporting mimics what the AWS APIs allow, so either empty (default to whatever was present in the original AMI), or v2 to enforce IMDSv2 on newly created AMIs.
I'll close this issue: this is not a bug on our end, as this is not something we can't address within Packer or the AWS Plugin.
Please feel free to reopen if you think we've missed something.
Thanks!
Overview of the Issue
Using latest packer v1.10.2 with plugin packer-plugin-amazon_v1.3.1_x5.0_linux_amd64 on amazon linux 2023 as source ami
"ImdsSupport": "v2.0"
, Instance metadata V2, always enabled on resulting AMI even with imds_support: ""Reproduction Steps
choose source ami with
"ImdsSupport": "v2.0"
, i.e.:set
imds_support: ""
block in example.pkr.hcl and see if the AMI created is having IMDSv2 enforcedPlugin and Packer version
From
packer version
v1.10.2Simplified Packer Buildfile
Operating system and Environment details
centos8 container amd_64 arch
Log Fragments and crash.log files
no error
describe resulting ami