Forrest logo
back to the terraform tool

terraform-plan:tldr:481b3

terraform-plan: Show a plan to update the Terraform state and output values.
$ terraform plan -refresh-only
try on your machine

The command "terraform plan -refresh-only" is used in the Terraform infrastructure provisioning tool. This command is used to generate an execution plan and refresh the state of the resources by querying the infrastructure provider.

Here's a breakdown of the different components of the command:

  • "terraform plan": This is the basic command used to create an execution plan, which analyzes the current Terraform configuration and shows the changes that will be made to the infrastructure. It does not actually apply any changes.

  • "-refresh-only": This is an optional flag that can be added to the "terraform plan" command. When specified, it tells Terraform to only refresh the state of the resources without creating or updating any resources. This means that Terraform will query the infrastructure provider (such as AWS, Azure, or GCP) to get the latest state of the resources, but will not make any changes.

Using "terraform plan -refresh-only" is useful in scenarios where you want to verify the current state of the resources without modifying anything. It can help in troubleshooting and identifying potential issues or conflicts in the configuration.

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