reworked docs, and created docs page. Not adding to the website index because we don't want this doc page live until after the HCP Packer registry enters public beta

This commit is contained in:
Megan Marsh 2021-08-30 16:27:08 -07:00
parent c0eb830c42
commit 60b734733b
5 changed files with 49 additions and 17 deletions

View file

@ -25,9 +25,9 @@ type Datasource struct {
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// The name of the bucket your image is in.
Bucket string `mapstructure:"bucket_name"`
Bucket string `mapstructure:"bucket_name" required:"true"`
// The name of the channel to use when retrieving your image
Channel string `mapstructure:"channel"`
Channel string `mapstructure:"channel" required:"true"`
// TODO: Version string `mapstructure:"version"`
// TODO: Label string `mapstructure:"label"`
}

View file

@ -18,8 +18,8 @@ type FlatConfig struct {
PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
Bucket *string `mapstructure:"bucket_name" cty:"bucket_name" hcl:"bucket_name"`
Channel *string `mapstructure:"channel" cty:"channel" hcl:"channel"`
Bucket *string `mapstructure:"bucket_name" required:"true" cty:"bucket_name" hcl:"bucket_name"`
Channel *string `mapstructure:"channel" required:"true" cty:"channel" hcl:"channel"`
}
// FlatMapstructure returns a new FlatConfig.

View file

@ -0,0 +1,43 @@
---
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
---
# 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.
Please note: The HCP Packer registry is in development, and is not yet available
for public use. For more information about HCP Packer, see https://www.hashicorp.com/blog/announcing-hcp-packer
## 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/RunConfig-required.mdx'
There are currently no optional fields for this datasource, though we intend
to add filtering fields in the future.

View file

@ -1,11 +0,0 @@
<!-- Code generated from the comments of the DatasourceOutput struct in datasource/packer-artifact-registry/data.go; DO NOT EDIT MANUALLY -->
- `Id` (string) - Id
- `incremental_version` (int32) - Incremental Version
- `created_at` (string) - Created At
- `builds` (map[string]interface{}) - Builds
<!-- End of code generated from the comments of the DatasourceOutput struct in datasource/packer-artifact-registry/data.go; -->

View file

@ -1,7 +1,7 @@
<!-- Code generated from the comments of the Config struct in datasource/packer-artifact-registry/data.go; DO NOT EDIT MANUALLY -->
<!-- Code generated from the comments of the Config struct in datasource/packer-image-iteration/data.go; DO NOT EDIT MANUALLY -->
- `bucket_name` (string) - The name of the bucket your image is in.
- `channel` (string) - The name of the channel to use when retrieving your image
<!-- End of code generated from the comments of the Config struct in datasource/packer-artifact-registry/data.go; -->
<!-- End of code generated from the comments of the Config struct in datasource/packer-image-iteration/data.go; -->