64 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

---
2020-03-18 18:46:47 -04:00
description: >
The `packer inspect` command takes a template and outputs the various
components a template defines. This can help you quickly learn about a
template
2021-02-16 10:08:47 +01:00
without having to dive into the HCL itself. The command will tell you things
2020-03-18 18:46:47 -04:00
like what variables a template accepts, the builders it defines, the
provisioners it defines and the order they'll run, and more.
page_title: packer inspect - Commands
sidebar_title: <tt>inspect</tt>
---
# `inspect` Command
2018-10-26 17:02:51 -07:00
The `packer inspect` command takes a template and outputs the various
components a template defines. This can help you quickly learn about a template
2021-02-16 10:08:47 +01:00
without having to dive into the HCL itself. The command will tell you things
2018-10-26 17:02:51 -07:00
like what variables a template accepts, the builders it defines, the
provisioners it defines and the order they'll run, and more.
2018-10-26 17:02:51 -07:00
This command is extra useful when used with [machine-readable
output](/docs/commands) enabled. The command outputs the components
2018-10-26 17:02:51 -07:00
in a way that is parseable by machines.
The command doesn't validate the actual configuration of the various components
2018-10-26 17:02:51 -07:00
(that is what the `validate` command is for), but it will validate the syntax
of your template by necessity.
## Usage Example
Given a basic template, here is an example of what the output might look like:
```shell-session
2021-02-16 10:08:47 +01:00
$ packer inspect template.pkr.hcl
> input-variables:
2021-02-16 10:08:47 +01:00
var.aws_access_key: "<sensitive>"
var.aws_secret_key: "<sensitive>"
2021-02-16 10:08:47 +01:00
> local-variables:
2021-02-16 10:08:47 +01:00
> builds:
2021-02-16 10:08:47 +01:00
> <unnamed build 0>:
2021-02-16 10:08:47 +01:00
sources:
amazon-ebs.foo
amazon-instance.bar
virtualbox-iso.basic
provisioners:
shell
post-processors:
<no post-processor>
```