JSON and HCL2 feature reference
This topic provides reference information about configuring Packer templates using JSON versus HCL2.
Introduction
HCP Packer supports storing artifact metadata when the artifacts are built with a Packer template written in either JSON or HCL2. We recommend writing Packer template configurations in HCL2 because it has greater feature support in HCP Packer. Refer to the following topics for additional information about Packer templates and how HCP Packer stores metadata:
- Packer templates in the Packer documentation
- Metadata storage overview
Feature comparison
The following table shows the HCP Packer features supported by each configuration language.
Feature | HCL2 | JSON |
---|---|---|
Basic configuration with environment variables | Full Support | Full Support |
Custom configuration using the hcp_packer_registry block | Full Support | No Support |
Custom bucket description | Full Support | No Support |
Custom bucket labels | Full Support | No Support |
Custom version build labels | Full Support | No Support |
Ability to use HCP Packer data sources | Full Support | No Support |
HCP Packer artifact governance | Full Support | No Support |
HCP Packer artifact ancestry tracking | Full Support | Ancestry is only retrievable using the HCP Packer API. Refer to Ancestry for additional information. |