You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,7 @@ Add `json-updater` type to Packer template's post-processor section:
32
32
],
33
33
"templates/child_template_2.json": [
34
34
"variables.aws_source_ami"
35
-
],
36
-
"templates/child_template_3.json": [
37
-
"{{ build_name }}.aws_source_ami"
38
-
],
35
+
]
39
36
}
40
37
}
41
38
]
@@ -46,4 +43,24 @@ The above `ami_id` configuration indicates that the ID of the newly created AWS
46
43
"aws_source_ami": "<ami_id>"
47
44
}
48
45
49
-
You can use Configuration Templates, they will be expanded upon Template build time.
46
+
Variable interpolation is also supported:
47
+
48
+
"variables": {
49
+
"build_id": "build_123"
50
+
},
51
+
"post-processors": [
52
+
{
53
+
"type": "json-updater",
54
+
"ami_id": {
55
+
"templates/child_template_3.json": [
56
+
"variables.aws_source_ami_{{user `build_id` }}"
57
+
],
58
+
}
59
+
}
60
+
]
61
+
62
+
The above `ami_id` configuration indicates that the ID of the newly created AWS AMI will be set as the value of `variables.aws_source_ami_build_123` key in `templates/child_template_3.json` file.
0 commit comments