packer/website/content/docs/post-processors/checksum.mdx
Zach Shilton 879fd9035c
fix: update redirected and broken links (#12060)
* website: fix broken links on /docs/templates

* fix: redirected install-plugins link

* fix: debugging link

* fix: secrets manager link in docs

* fix: secrets manager link in source

* fix: amazon ami plugin link in docs

* fix: amazon ami plugin link in source

* fix: extending plugins link

* fix: plugins/builders/amazon links

* fix: various builders links

* fix: various amazon builder links

* fix: redirected terminology link

* fix: custom-provisioners link

* fix: docker-push redirected plugin link

* fix: googlecompute plugin links

* fix: hyperv iso plugin links

* website: update link to hcl upgrade guide

Co-authored-by: Wilken Rivera <wilken@hashicorp.com>

Co-authored-by: Wilken Rivera <wilken@hashicorp.com>
2022-10-21 11:00:58 -04:00

85 lines
2.5 KiB
Text

---
description: >
The checksum post-processor computes specified checksum for the artifact list
from an upstream builder or post-processor. All downstream post-processors
will see the new artifacts. The primary use-case is compute checksum for
artifacts allows to verify it later. So firstly this post-processor get
artifact, compute it checksum and pass to next post-processor original
artifacts and checksum files.
page_title: Checksum - Post-Processors
---
<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>
# Checksum Post-Processor
Type: `checksum`
Artifact BuilderId: `packer.post-processor.checksum`
The checksum post-processor computes specified checksum for the artifact list
from an upstream builder or post-processor. All downstream post-processors will
see the new artifacts. The primary use-case is compute checksum for artifact to
verify it later.
After computes checksum for artifacts, you can use new artifacts with other
post-processors like
[artifice](/docs/post-processors/artifice),
[compress](/docs/post-processors/compress),
[docker-push](/plugins/post-processors/docker/docker-push), or
a third-party post-processor.
## Basic example
<Tabs>
<Tab heading="JSON">
```json
{
"type": "checksum",
"checksum_types": ["sha1", "sha256"],
"output": "packer_{{.BuildName}}_{{.ChecksumType}}.checksum"
}
```
</Tab>
<Tab heading="HCL2">
```hcl
post-processor "checksum" {
checksum_types = ["sha1", "sha256"]
output = "packer_{{.BuildName}}_{{.ChecksumType}}.checksum"
}
```
</Tab>
</Tabs>
## Configuration Reference
Optional parameters:
- `checksum_types` (array of strings) - An array of strings of checksum types
to compute. If empty, Defaults to md5. Allowed values are:
- md5
- sha1
- sha224
- sha256
- sha384
- sha512
- `output` (string) - Specify filename to store checksums. This defaults to
`packer_{{.BuildName}}_{{.BuilderType}}_{{.ChecksumType}}.checksum`. For
example, if you had a builder named `database`, you might see the file
written as `packer_database_docker_md5.checksum`. This is treated as a
[template engine](/docs/templates/legacy_json_templates/engine). Therefore, you
may use user variables and template functions in this field.
The following special variables are also available to use in the output
template:
- `BuildName`: The name of the builder that produced the artifact.
- `BuilderType`: The type of builder used to produce the artifact.
- `ChecksumType`: The type of checksums the file contains. This should be
used if you have more than one value in `checksum_types`.