The `packer hcl2_upgrade` Packer command is used to transpile a JSON
configuration template to its formatted HCL2 counterpart. The command will
return a zero exit status on success, and a non-zero exit status on failure.
page_title: packer hcl2_upgrade - Commands
The `packer hcl2_upgrade` Packer command transpiles a JSON
configuration template into HCL2 so you can transition to HCL templates.
page_title: packer hcl2_upgrade command reference
---
-> **Note:** This command is Beta, and currently being improved upon; do not
hesitate [opening a new
issue](https://github.com/hashicorp/packer/issues/new/choose) if you find
something wrong.
# `packer hcl2_upgrade` command reference
# `hcl2_upgrade` Command
The `packer hcl2_upgrade` Packer command transpiles a JSON
configuration template to it's formatted HCL2 counterpart. The command
returns a zero exit status on success and a non-zero exit status on failure.
The `packer hcl2_upgrade` Packer command is used to transpile a JSON
configuration template to it's formatted HCL2 counterpart. The command will
return a zero exit status on success, and a non-zero exit status on failure.
-> **This command is beta**. We do not recommend using beta functionality in production environments. To report an issue and provide feedback, [open a GitHub
Packer is controlled using a command-line interface. All interaction with
Packer is done via the `packer` tool. Like many other command-line tools, the
`packer` tool takes a subcommand to execute, and that subcommand may have
additional options as well. Subcommands are executed with `packer SUBCOMMAND`,
where "SUBCOMMAND" is the actual command you wish to execute.
page_title: Commands
The Packer command-line interface lets you perform Packer operations. Use the `packer` CLI command with subcommands, flags, and options to build and manage artifacts and install and manage plugins.
page_title: Packer commands overview
---
# Packer Commands (CLI)
# Packer Commands Overview
Packer is controlled using a command-line interface. All interaction with
Packer is done via the `packer` tool. Like many other command-line tools, the
Reference information about the `packer init` command, which downloads and installs one or more plugin binaries specified in a Packer template written in HCL.
page_title: packer init command line reference
The `packer init` command downloads and installs the plugins specified in a Packer template.
page_title: packer init command reference
---
# `init` command reference
# `packer init` command reference
The `packer init` command initializes Packer according to an HCL template configuration. Refer to [Installing Plugins](/packer/docs/plugins/install) for additional information about installing plugins.
The "plugins required" command lists all plugins required in a Packer configuration.
page_title: plugins Command
The `packer plugins required` command lists all of the plugins required by a Packer configuration and any installed binaries that satisfy the requirements.
The SSH communicator uses SSH to upload files, execute scripts, etc. on
the machine being created.
page_title: Communicators - SSH
The `ssh` communicator establishes an SSH connection so that Packer can perform actions, such as upload files and execute scripts, on the machine it creates.
page_title: Establish an SSH connection
---
# SSH Communicator
# Establish an SSH Connection
This topic describes how to use the `ssh` communicator to establish an SSH connection to the machine it creates so that Packer can perform actions, such as upload files and execute scripts.
## Introduction
Communicators are the mechanism Packer uses to upload files, execute scripts,
etc. on the machine being created, and are configured within the
Communicators are the mechanism Packer uses to upload files, execute scripts,
etc. with the machine being created.
page_title: Communicators - Templates
The `winrm` communicator establishes a WinRM connection, letting Packer upload files or execute scripts on the machine it creates.
page_title: Establish a WinRM Connection
---
# WinRM Communicator
# Establish a WinRM Connection
This topic describes how to use the `winrm` communicator to establish a WinRM connection to the machine it creates so that Packer can perform actions, such as upload files and execute scripts.
## Introduction
Communicators are the mechanism Packer uses to upload files, execute scripts,
etc. with the machine being created. The WinRM communicator uses the
etc. with the machine being created. The `winrm` communicator uses the
Windows Remote Management protocol to do this.
## Getting Ready to Use the WinRM Communicator
## Getting Ready to Use the `winrm` Communicator
The WinRM communicator is not the default communicator, so you will always have
The `winrm` communicator is not the default communicator, so you will always have
to set the `"communicator": "winrm",` template option explicitly. In addition,
you will almost always have to provide a pre-run script that enables and
configures WinRM on the guest machine. This will generally be in the form of a
@ -32,7 +35,7 @@ If you are unfamiliar with how to use an autounattend file, take a look at our
how to automatically initalize your operating system is critical for being able
Learn how to use environment variables when running Packer that configure global behaviors.
page_title: Configuring Packer
Learn how to configure Packer's global behavior using environment variables.
page_title: Configure Packer
---
# Configuring Packer
# Configure Packer
This topic describes how to configure Packer. The default configurations are suitable for learning how to get started, but you should refer to this topic for guidance as you become more familiar with Packer.
The artifice post-processor overrides the artifact list from an upstream
builder or post-processor. All downstream post-processors will see the new
artifacts you specify. The primary use-case is to build artifacts inside a
packer builder -- for example, spinning up an EC2 instance to build a Docker
container -- and then extracting the Docker container and throwing away the
EC2
instance.
page_title: Artifice - Post-Processors
The `artifice` post-processor overrides the artifact list from an upstream builder or post-processor. Use it to build artifacts inside a Packer builder, such as starting an EC2 instance to build a Docker container, but only keep the Docker container's artifacts.
Post-processors run after the image is built by the builder and provisioned by
the provisioner(s).
page_title: Post-Processors
Post-processors are programs that you can run after Packer builds and provisions an image. Use post-processors to upload artifacts and repackage files.
page_title: Post-processors overview
---
# Post-Processors
# Post-processors overview
Post-processors run after builders and provisioners. Post-processors are optional, and you can use them to upload artifacts, re-package files, and more. The documentation includes a page for each type of post-processor.