New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for variable interpolation to hcp_packer_registry and build blocks. #11421
Conversation
@@ -48,7 +48,7 @@ func (p *Parser) decodeHCPRegistry(block *hcl.Block) (*HCPPackerRegistryBlock, h | |||
BuildLabels map[string]string `hcl:"build_labels,optional"` | |||
Config hcl.Body `hcl:",remain"` | |||
} | |||
diags := gohcl.DecodeBody(body, nil, &b) | |||
diags := gohcl.DecodeBody(body, cfg.EvalContext(BuildContext, nil), &b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I would've done ! 👍🏼
9bea722
to
8192c14
Compare
8192c14
to
d14649d
Compare
hcp_packer_registry
block8175f5c
to
996cc9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome ! LGTM
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This change allows for the use of variables for setting HCP Packer metadata.
Users should be able to set variables either statically or dynamically via environment variables to set bucket_name, bucket_labels, and build_labels.
This change adds support for using variables within the base Packer build block - merged in from Add build block variable interpolation #11425
Closes #9794
Closes https://github.com/hashicorp/packer-internal-issues/issues/20