github.com/hashicorp/packer@v1.14.3/website/content/docs/post-processors/checksum.mdx (about)

     1  ---
     2  description: >
     3    The `checksum` post-processor computes the checksum for the artifact list
     4    from an upstream builder or post-processor so that you can verify artifacts. 
     5  page_title: checksum post-processor reference
     6  ---
     7  
     8  <BadgesHeader>
     9    <PluginBadge type="official" />
    10  </BadgesHeader>
    11  
    12  # `checksum` post-processor
    13  
    14  Artifact BuilderId: `packer.post-processor.checksum`
    15  
    16  The checksum post-processor computes specified checksum for the artifact list
    17  from an upstream builder or post-processor. All downstream post-processors will
    18  see the new artifacts. The primary use-case is compute checksum for artifact to
    19  verify it later.
    20  
    21  After computes checksum for artifacts, you can use new artifacts with other
    22  post-processors like
    23  [artifice](/packer/docs/post-processors/artifice),
    24  [compress](/packer/docs/post-processors/compress),
    25  [docker-push](/packer/plugins/post-processors/docker/docker-push), or
    26  a third-party post-processor.
    27  
    28  ## Basic example
    29  
    30  <Tabs>
    31  <Tab heading="HCL2">
    32  
    33  ```hcl
    34  post-processor "checksum" {
    35    checksum_types = ["sha1", "sha256"]
    36    output = "packer_{{.BuildName}}_{{.ChecksumType}}.checksum"
    37  }
    38  ```
    39  
    40  </Tab>
    41  <Tab heading="JSON">
    42  
    43  ```json
    44  {
    45    "type": "checksum",
    46    "checksum_types": ["sha1", "sha256"],
    47    "output": "packer_{{.BuildName}}_{{.ChecksumType}}.checksum"
    48  }
    49  ```
    50  
    51  </Tab>
    52  </Tabs>
    53  
    54  ## Configuration Reference
    55  
    56  Optional parameters:
    57  
    58  - `checksum_types` (array of strings) - An array of strings of checksum types
    59    to compute. If empty, Defaults to md5. Allowed values are:
    60  
    61    - md5
    62    - sha1
    63    - sha224
    64    - sha256
    65    - sha384
    66    - sha512
    67  
    68  - `output` (string) - Specify filename to store checksums. This defaults to
    69    `packer_{{.BuildName}}_{{.BuilderType}}_{{.ChecksumType}}.checksum`. For
    70    example, if you had a builder named `database`, you might see the file
    71    written as `packer_database_docker_md5.checksum`. This is treated as a
    72    [template engine](/packer/docs/templates/legacy_json_templates/engine). Therefore, you
    73    may use user variables and template functions in this field.
    74    The following special variables are also available to use in the output
    75    template:
    76  
    77    - `BuildName`: The name of the builder that produced the artifact.
    78    - `BuilderType`: The type of builder used to produce the artifact.
    79    - `ChecksumType`: The type of checksums the file contains. This should be
    80      used if you have more than one value in `checksum_types`.