Closed orendain closed 4 years ago
Hello there, sorry you had this and thanks for trying HCL2 !!
This is a breaking change we brought in HCL2 to allow setting those fields from variables; So to quickly fix: filters {
becomes filters = {
. The PR bringing this change is this one: https://github.com/hashicorp/packer/pull/9035 and it's also in the CHANGELOG file.
It is now also possible to set repeatable singular blocks like filter
or tag
but with singular key
/name
& value
settings. ( those are intended to be used with the dynamic block setting, they will be extended in the future as well ).
Please note that HCL2 is still in beta and some breaking change might occur so please make sure to check the CHANGELOG for each version ! :)
That said I do not expect any more major breaking change coming any soon.
I'm going to close this issue because I think it is solved; do not hesitate to ask more questions though 🙂.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Overview of the Issue
Some (HCL) blocks that used to work pre v1.5.6, now do not. I'm specifically referring to
filters
when used within asource_ami_filter
block (that's what I tested), but it's possible that the other blocks listed in the PR below were affected as well.It is related to PR https://github.com/hashicorp/packer/pull/8889, which was created to address issue https://github.com/hashicorp/packer/issues/8684.
The PR above suggests that the
filters { ...}
block will continue to be supported. However, that doesn't seem to be the case.Reproduction Steps
Consider the following HCL:
Pre v1.5.6, the above works fine. Starting with Packer v1.5.6, the following error occurs:
Additionally (note, this may or may not be a separate issue - but they definitely appear related), modifying the code to satisfy the format in the above PR results in the following:
This also throws errors:
Packer version
From
v1.5.6
. The first block of code above worked fine in v1.5.5.