packer/command/test-fixtures/hcl2_upgrade/ami_test/input.json
Lucas Bajolet 3c249c0d42 hcl2_upgrade: replace passthroughs by pre-visit
In previous versions of hcl2_upgrade, we referenced a list of
passthrough statements from the original JSON template to be replaced by
their equivalent Go-template in HCL2.

This works but requires us to explicitely accept every possible
templated variable in order to not ever encounter <no value> in our
generated HCL2 templates.

This is suboptimal, hence this commit changes approach by pre-visting
the AST from the original Go Template, escaping every sequence that is
not covered by the list of functions we can migrate. Pipes are also
excluded from this function.
2022-10-26 15:35:02 -04:00

21 lines
715 B
JSON

{
"builders": [{
"type": "amazon-ebs",
"tags": {
"SourceAMIName" : "{{ .SourceAMIName }}",
"SourceAMI" : "{{ .SourceAMI }}",
"SourceAMICreationDate" : "{{ .SourceAMICreationDate }}",
"SourceAMIOwner" : "{{ .SourceAMIOwner }}",
"SourceAMIOwnerName" : "{{ .SourceAMIOwnerName }}",
"SourceAMITags": "{{ .SourceAMITags.TagName }}"
},
"run_tags": {
"SourceAMIName" : "{{.SourceAMIName}}",
"SourceAMI" : "{{.SourceAMI}}",
"SourceAMICreationDate" : "{{.SourceAMICreationDate}}",
"SourceAMIOwner" : "{{.SourceAMIOwner}}",
"SourceAMIOwnerName" : "{{.SourceAMIOwnerName}}",
"SourceAMITags": "{{ .SourceAMITags.TagName }}"
}
}]
}