Getting the Source AMI id when using HCL configuration

41 views
Skip to first unread message

sim...@irrelevant.org

unread,
Jul 31, 2020, 5:35:07 AM7/31/20
to Packer
Does anyone know of a way of being able to put the SourceAMI into a tag when using the HCL2 configuration? The build works fine, just need the source ami for an audit trail. Much appreciated!

dragon788

unread,
Aug 2, 2020, 12:01:37 AM8/2/20
to Packer

Simon Dick

unread,
Aug 3, 2020, 6:03:48 AM8/3/20
to packe...@googlegroups.com
Yep that helps a lot, thanks, I was trying to use then as ${ variables
rather than using {{ }}

On Sun, 2 Aug 2020 at 05:01, dragon788 <drag...@gmail.com> wrote:
>
> https://www.packer.io/docs/builders/amazon/ebs#build-shared-information-variables
>
> Does this help?
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/17d447ea-5969-49fb-be7e-82de01c59c3eo%40googlegroups.com.

Simon Dick

unread,
Aug 3, 2020, 8:54:33 AM8/3/20
to packe...@googlegroups.com
Spoke too quickly, I now just get "<no value>" when setting the tag
from the hcl source section, I'll keep my fingers crossed for future
versions (I'm running 1.6.1)

dragon788

unread,
Aug 4, 2020, 8:49:00 AM8/4/20
to Packer
Can you share the code file or section where you are calling this?

Megan Marsh

unread,
Aug 4, 2020, 4:37:46 PM8/4/20
to packe...@googlegroups.com

On Tue, Aug 4, 2020 at 5:49 AM dragon788 <drag...@gmail.com> wrote:
Can you share the code file or section where you are calling this?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Simon Dick

unread,
Aug 25, 2020, 10:49:20 AM8/25/20
to packe...@googlegroups.com
Sorry, been working on something else for a while, but unfortunately
not, I need to be able to access the .SourceAMI in the source section
rather than the build/provisioner section in order to set a tag's
value.
> To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAGPV1upRFydgE6YKposBEP%3DLW2Hv37hux2D7wLAdEYNJgi%3Dyew%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages