Metadata storage overview
This topic provides an overview of how HCP Packer stores metadata about the artifacts you build with Packer.
HCP Packer stores metadata about your Packer artifacts so that you can track updates, use the most up-to-date base artifacts, and deploy the most up-to-date downstream artifacts. The following process describes how HCP Packer acquires metadata from Packer builds:
Create a bucket in the HCP Packer registry to store artifacts. HCP Packer automatically creates a bucket when you build the artifact if a bucket does not already exist. Refer to Create and manage buckets for additional information. Configure the Packer template or set environment variables that enable you to push artifact metadata in HCP Packer. Refer to Push metadata to HCP Packer for additional information. Run Packer and specify the template to build the artifact and generate metadata. Packer pushes the metadata to the registry in HCP Packer. Refer to the Packer documentation for instructions on how to run Packer commands.
Each HCP Packer project in your HCP organization has one Packer registry. The registry contains one or more buckets. Each bucket contains the version and build information associated with the artifacts built from a Packer template. Additionally, you can assign versions to channels, which are human-readable names that consumers can reference in Packer templates and Terraform configurations. Refer to Metadata concepts for additional information about each construct.
The metadata stored in HCP Packer is organized around the following concepts.
HCP Packer stores artifact metadata for each version of the artifact in a bucket. Each HCP Packer registry has one or more buckets that map to a Packer template. Refer to Create and manage buckets for additional information.
Every time you build a Packer template, the registry creates a new artifact version in the associated bucket. A version is an immutable record generated by
packer build command that contains the metadata for all of the builds in the template.
Versions let you track revisions and revocations of artifacts over time. Each complete version has at least one build, but a version may have many builds depending on how you configured sources in your template.
Each version has at least one build that contains the metadata from all artifacts produced by a single builder. By default, HCP Packer stores an artifact ID and a creation date, but individual builders may also produce additional information for the artifact. The registry adds this information as auto-generated labels to each completed build. Refer to Builders in the Packer documentation for additional information.
Ancestry refers to the relationship between source artifacts, or parents, and the child artifacts created from the source. Depending on whether you are using registry channels and whether HCP Packer is configured to track parent artifacts, HCP Packer creates an ancestry relationship between new child artifact versions and its source artifact when Packer pushes artifact metadata to the registry. Refer to View ancestry for additional information.
Channels are names that you can assign to versions. People that consume your artifacts can include the channel name in their Packer template or Terraform configurations so that they use the correct version without modifying their code. Refer to Create and manage channels for additional information.