mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-13 10:40:05 -04:00
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.
21 lines
715 B
JSON
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 }}"
|
|
}
|
|
}]
|
|
}
|