A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/terraform/cli/commands/apply below:

terraform apply command reference | Terraform

The terraform apply command executes the actions proposed in a Terraform plan.

Hands On: Try the Apply Terraform Configuration tutorial to learn how Terraform applies a configuration, how Terraform recovers from errors during apply, and common ways to use this command.

Usage: terraform apply [options] [plan file]

Automatic Plan Mode

When you run terraform apply without passing a saved plan file, Terraform automatically creates a new execution plan as if you had run terraform plan, prompts you to approve that plan, and takes the indicated actions. You can use all of the planning modes and planning options to customize how Terraform will create the plan.

You can pass the -auto-approve option to instruct Terraform to apply the plan without asking for confirmation.

Warning: If you use -auto-approve, we recommend making sure that no one can change your infrastructure outside of your Terraform workflow. This minimizes the risk of unpredictable changes and configuration drift.

Saved Plan Mode

When you pass a saved plan file to terraform apply, Terraform takes the actions in the saved plan without prompting you for confirmation. You may want to use this two-step workflow when running Terraform in automation.

Use terraform show to inspect a saved plan file before applying it.

When using a saved plan, you cannot specify any additional planning modes or options. These options only affect Terraform's decisions about which actions to take, and the plan file contains the final results of those decisions.

Plan Options

Without a saved plan file, terraform apply supports all planning modes and planning options available for terraform plan.

Apply Options

The following options change how the apply command executes and reports on the apply operation.

For configurations using the local backend only, terraform apply also accepts the legacy options -state, -state-out, and -backup.

Terraform v0.13 and earlier also accepted a directory path in place of the plan file argument to terraform apply, in which case Terraform would use that directory as the root module instead of the current working directory.

That usage was deprecated in Terraform v0.14 and removed in Terraform v0.15. If your workflow relies on overriding the root module directory, use the -chdir global option instead, which works across all commands and makes Terraform consistently look in the given directory for all files it would normally read or write in the current working directory.

If your previous use of this legacy pattern was also relying on Terraform writing the .terraform subdirectory into the current working directory even though the root module directory was overridden, use the TF_DATA_DIR environment variable to direct Terraform to write the .terraform directory to a location other than the current working directory.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4