I’ve been trying to get some tags onto my EBS in Packer via HCL2 and I can’t get it to work.
I don’t know where to define the tag/tags block. I also don’t know how to write it in HCL2.
The documentation is not helping.
I am not able to put a tag/tags block inside a launch_block_device_mappings so even though it’s not what I wanted, I tried putting it in the source block. Doesn’t work in there either. It’s not clear if there is a syntax issue or if the tag/tags block just isn’t allowed there.
When in the source block:
tags {
Name = "Billing"
Value = "SUN"
}
then
Blocks of type "tags" are not expected here. Did you mean "tag"?
so then
tag {
Name = "Billing"
Value = "SUN"
}
and
An argument named "Name" is not expected here.
...
An argument named "Value" is not expected here. Did you mean "value"?
Did I mean “value”? I don’t know!
Maybe
tag {
Billing = "SUN"
}
but
An argument named "Billing" is not expected here.
So, what’s the correct way to do at least one tag?