terraform-plan:tldr:481b3
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.