From ce12130ed86ae1dc375870600d7255ae748e60f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 12:28:51 +0200 Subject: [PATCH] include help entry for -replace (#36780) (#37052) * include help entry for -replace * add to website docs as well * Update internal/command/apply.go * Update website/docs/cli/commands/apply.mdx --------- Co-authored-by: drewmullen Co-authored-by: Daniel Banck --- internal/command/apply.go | 3 +++ website/docs/cli/commands/apply.mdx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/command/apply.go b/internal/command/apply.go index 3bf441ecad..be6b8daa63 100644 --- a/internal/command/apply.go +++ b/internal/command/apply.go @@ -379,6 +379,9 @@ Options: -parallelism=n Limit the number of parallel resource operations. Defaults to 10. + -replace=resource Terraform will plan to replace this resource instance + instead of doing an update or no-op action. + -state=path Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate". diff --git a/website/docs/cli/commands/apply.mdx b/website/docs/cli/commands/apply.mdx index 2eb5a9a8c6..2c2abe1489 100644 --- a/website/docs/cli/commands/apply.mdx +++ b/website/docs/cli/commands/apply.mdx @@ -86,6 +86,9 @@ The following options change how the apply command executes and reports on the a [walks the graph](/terraform/internals/graph#walking-the-graph). Defaults to 10\. +- `-replace=resource` - Terraform will plan to replace this resource instance + instead of doing an update or no-op action. + - All [planning modes](/terraform/cli/commands/plan#planning-modes) and [planning options](/terraform/cli/commands/plan#planning-options) for `terraform plan` - Customize how Terraform will create the plan. Only available when you run `terraform apply` without a saved plan file.