Skip to content

Commit

Permalink
Use terraform-docs to populate Packer information
Browse files Browse the repository at this point in the history
Since the new Packer configuration is in HCL2 we can use
`terraform-docs` to populate the Packer README with some information.
Although the information populated is limited it at least documents the
variables used by the configuration.
  • Loading branch information
mcdonnnj committed Oct 15, 2024
1 parent 9a5e8da commit 4deaa55
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packer/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
formatter: markdown table
output:
file: README.md
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
settings:
anchor: false
atx-closed: true
html: false
lockfile: false
36 changes: 36 additions & 0 deletions packer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,42 @@ may be required, for example, if a role that is being pulled from a
GitHub repository has been updated and you want the new changes. By
default `ansible-galaxy install` *will not* upgrade roles.

<!-- BEGIN_TF_DOCS -->
## Requirements ##

No requirements.

## Providers ##

| Name | Version |
|------|---------|
| amazon-ami | n/a |

## Modules ##

No modules.

## Resources ##

| Name | Type |
|------|------|
| [amazon-ami_amazon-ami.debian_bookworm](https://registry.terraform.io/providers/hashicorp/amazon-ami/latest/docs/data-sources/amazon-ami) | data source |
| [amazon-ami_amazon-ami.debian_buster](https://registry.terraform.io/providers/hashicorp/amazon-ami/latest/docs/data-sources/amazon-ami) | data source |

## Inputs ##

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| ami\_prefix | The prefix to use for the names of AMIs created. | `string` | `"cyhy"` | no |
| ami\_regions | The list of AWS regions to copy the AMI to once it has been created. Example: ["us-east-1"] | `list(string)` | ```[ "us-east-1", "us-west-1", "us-west-2" ]``` | no |
| build\_region | The region in which to retrieve the base AMI from and build the new AMI. | `string` | `"us-east-2"` | no |
| is\_prerelease | The pre-release status to use for the tags applied to the created AMI. | `bool` | `false` | no |

## Outputs ##

No outputs.
<!-- END_TF_DOCS -->

## License ##

This project is in the worldwide [public domain](LICENSE.md).
Expand Down

0 comments on commit 4deaa55

Please sign in to comment.