Forrest logo
back to the terraform tool

terraform-plan:tldr:9e30f

terraform-plan: Output a plan as JSON.
$ terraform plan -json
try on your machine

The terraform plan -json command is used in Terraform, an infrastructure as code tool, to generate and output the execution plan in JSON format.

Here is a breakdown of the command:

  • terraform is the main CLI (Command Line Interface) command to interact with Terraform.
  • plan is a subcommand used to create an execution plan for applying or modifying infrastructure resources.
  • -json is an optional flag that configures the output format to be JSON.

When you run terraform plan -json, Terraform will analyze the configuration files and any available state data to generate an execution plan for your infrastructure. The plan describes the actions that Terraform will take to achieve the desired state defined in the configuration files.

By using the -json flag, Terraform will output the execution plan in JSON format. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for machines to parse and generate, making it more convenient for programmatic consumption and integration with other tools.

The JSON output will include detailed information about the changes that Terraform plans to apply, such as creating, modifying, or destroying resources. You can use this output to review and validate the planned changes before actually applying them to your infrastructure.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the terraform tool