Update docs to clarify how to use build vars in build template engines (#10141)
This commit is contained in:
parent
ee4b3e796e
commit
edca188175
|
@ -557,6 +557,22 @@ Usage example:
|
|||
<Tab heading="HCL2">
|
||||
|
||||
```hcl
|
||||
// When accessing one of these variables from inside the builder, you need to
|
||||
// use the golang templating syntax. This is due to an architectural quirk that
|
||||
// won't be easily resolvable until legacy json templates are deprecated:
|
||||
|
||||
{
|
||||
source "amazon-ebs" "basic-example" {
|
||||
tags = {
|
||||
OS_Version = "Ubuntu"
|
||||
Release = "Latest"
|
||||
Base_AMI_ID = "{{ .SourceAMI }}"
|
||||
Base_AMI_Name = "{{ .SourceAMIName }}"
|
||||
}
|
||||
}
|
||||
|
||||
// when accessing one of the variables from a provisioner or post-processor, use
|
||||
// hcl-syntax
|
||||
post-processor "manifest" {
|
||||
output = "manifest.json"
|
||||
strip_path = true
|
||||
|
|
|
@ -361,6 +361,22 @@ Usage example:
|
|||
<Tab heading="HCL2">
|
||||
|
||||
```hcl
|
||||
// When accessing one of these variables from inside the builder, you need to
|
||||
// use the golang templating syntax. This is due to an architectural quirk that
|
||||
// won't be easily resolvable until legacy json templates are deprecated:
|
||||
|
||||
{
|
||||
source "amazon-ebs" "basic-example" {
|
||||
tags = {
|
||||
OS_Version = "Ubuntu"
|
||||
Release = "Latest"
|
||||
Base_AMI_ID = "{{ .SourceAMI }}"
|
||||
Base_AMI_Name = "{{ .SourceAMIName }}"
|
||||
}
|
||||
}
|
||||
|
||||
// when accessing one of the variables from a provisioner or post-processor, use
|
||||
// hcl-syntax
|
||||
post-processor "manifest" {
|
||||
output = "manifest.json"
|
||||
strip_path = true
|
||||
|
|
|
@ -265,6 +265,22 @@ Usage example:
|
|||
<Tab heading="HCL2">
|
||||
|
||||
```hcl
|
||||
// When accessing one of these variables from inside the builder, you need to
|
||||
// use the golang templating syntax. This is due to an architectural quirk that
|
||||
// won't be easily resolvable until legacy json templates are deprecated:
|
||||
|
||||
{
|
||||
source "amazon-ebs" "basic-example" {
|
||||
tags = {
|
||||
OS_Version = "Ubuntu"
|
||||
Release = "Latest"
|
||||
Base_AMI_ID = "{{ .SourceAMI }}"
|
||||
Base_AMI_Name = "{{ .SourceAMIName }}"
|
||||
}
|
||||
}
|
||||
|
||||
// when accessing one of the variables from a provisioner or post-processor, use
|
||||
// hcl-syntax
|
||||
post-processor "manifest" {
|
||||
output = "manifest.json"
|
||||
strip_path = true
|
||||
|
|
|
@ -312,6 +312,22 @@ Usage example:
|
|||
<Tab heading="HCL2">
|
||||
|
||||
```hcl
|
||||
// When accessing one of these variables from inside the builder, you need to
|
||||
// use the golang templating syntax. This is due to an architectural quirk that
|
||||
// won't be easily resolvable until legacy json templates are deprecated:
|
||||
|
||||
{
|
||||
source "amazon-ebs" "basic-example" {
|
||||
tags = {
|
||||
OS_Version = "Ubuntu"
|
||||
Release = "Latest"
|
||||
Base_AMI_ID = "{{ .SourceAMI }}"
|
||||
Base_AMI_Name = "{{ .SourceAMIName }}"
|
||||
}
|
||||
}
|
||||
|
||||
// when accessing one of the variables from a provisioner or post-processor, use
|
||||
// hcl-syntax
|
||||
post-processor "manifest" {
|
||||
output = "manifest.json"
|
||||
strip_path = true
|
||||
|
|
|
@ -258,6 +258,22 @@ Usage example:
|
|||
<Tab heading="HCL2">
|
||||
|
||||
```hcl
|
||||
// When accessing one of these variables from inside the builder, you need to
|
||||
// use the golang templating syntax. This is due to an architectural quirk that
|
||||
// won't be easily resolvable until legacy json templates are deprecated:
|
||||
|
||||
{
|
||||
source "amazon-ebs" "basic-example" {
|
||||
tags = {
|
||||
OS_Version = "Ubuntu"
|
||||
Release = "Latest"
|
||||
Base_AMI_ID = "{{ .SourceAMI }}"
|
||||
Base_AMI_Name = "{{ .SourceAMIName }}"
|
||||
}
|
||||
}
|
||||
|
||||
// when accessing one of the variables from a provisioner or post-processor, use
|
||||
// hcl-syntax
|
||||
post-processor "manifest" {
|
||||
output = "manifest.json"
|
||||
strip_path = true
|
||||
|
|
Loading…
Reference in New Issue