---
description: |
  The Packer Image Iteration Data Source retrieves information about an
  iteration from the HCP Packer registry. This information can be parsed to
  provide a source image to various Packer builders.
page_title: Packer Image Iteration - Data Sources
---

<BadgesHeader>
  <PluginBadge type="official" />
  <PluginBadge type="hcp_packer_ready" />
</BadgesHeader>

# Packer Image Iteration Data Source

Type: `packer-image-iteration`

The `Packer Image Iteration` Data Source retrieves information about an
iteration from the HCP Packer registry. This information can be parsed to
provide a source image to various Packer builders.

To get started with HCP Packer, refer to the [HCP Packer documentation](https://cloud.hashicorp.com/docs/packer) or try the [Get Started with HCP Packer tutorials](https://learn.hashicorp.com/collections/packer/hcp-get-started).

~> **Note:** You will receive an error if you try to reference metadata from a deactivated or deleted registry. An administrator can manually deactivate or delete a registry, and HCP Packer automatically deactivates registries with billing issues. Contact [HashiCorp Support](https://support.hashicorp.com/) with questions.

## Revoked Iterations

If an iteration is revoked, the `hcp-packer-iteration` data source will fail and Packer won't proceed with the build. Building new images from a revoked image is not compliant.
Iterations that are scheduled to be revoked will still be considered valid until the revocation date.

## Basic Example

Below is a fully functioning example. It stores information about an image
iteration, which can then be parsed and accessed using HCL tools.

```hcl
data "packer-image-iteration" "hardened-source" {
  bucket = "hardened-ubuntu-16-04"
  channel = "production-stable"
}
```

## Configuration Reference

Configuration options are organized below into two categories: required and
optional. Within each category, the available options are alphabetized and
described.

### Required:

@include 'datasource/packer-image-iteration/Config-required.mdx'

There are currently no optional fields for this datasource, though we intend
to add filtering fields in the future.
