I’m starting to use Packer to generate some AMIs and would like to add some metadata tags to the resulting images. In particular, I’d like to annotate the images with the version of Packer that they were built with.
I wasn’t able to find any programmatic way to access that information inside the build, so I ended up defining it as a variable that I just pass in:
packer build -var 'packer_version=$(packer version)' my_image.pkr.hcl
That works fine, but is there a more direct way to achieve this that I’m missing?
Thanks in advance!