From 5ebcd60759767d88dfb4045ef81fcda94d232c4e Mon Sep 17 00:00:00 2001 From: Jonathan Newnham Date: Thu, 2 Feb 2023 15:24:48 +1300 Subject: [PATCH 1/2] Update destroy.mdx mention -target --- website/docs/cli/commands/destroy.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/website/docs/cli/commands/destroy.mdx b/website/docs/cli/commands/destroy.mdx index beb9782ebf..49f0c208bf 100644 --- a/website/docs/cli/commands/destroy.mdx +++ b/website/docs/cli/commands/destroy.mdx @@ -44,3 +44,14 @@ you the proposed destroy changes without executing them. -> **Note:** The `-destroy` option to `terraform apply` exists only in Terraform v0.15.2 and later. For earlier versions, you _must_ use `terraform destroy` to get the effect of `terraform apply -destroy`. + +## Options + +In exceptional circumstances, it may be useful to use the `-target` option. +This will destroy only a particular resource (and its dependencies): + +``` +terraform destroy -target RESOURCE_TYPE.NAME +``` + +For more about `-target`, see [`plan`](/cli/commands/plan). From 1e5b97e51161259c20c4244d3251f6d33393a419 Mon Sep 17 00:00:00 2001 From: Craig Wright Date: Thu, 25 Jul 2024 16:56:41 -0700 Subject: [PATCH 2/2] Update website/docs/cli/commands/destroy.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- website/docs/cli/commands/destroy.mdx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/website/docs/cli/commands/destroy.mdx b/website/docs/cli/commands/destroy.mdx index 49f0c208bf..f0e83552bc 100644 --- a/website/docs/cli/commands/destroy.mdx +++ b/website/docs/cli/commands/destroy.mdx @@ -45,13 +45,7 @@ you the proposed destroy changes without executing them. Terraform v0.15.2 and later. For earlier versions, you _must_ use `terraform destroy` to get the effect of `terraform apply -destroy`. -## Options +### Target a specific resource -In exceptional circumstances, it may be useful to use the `-target` option. -This will destroy only a particular resource (and its dependencies): +You can use the `-target` option to destroy a particular resource and its dependencies: -``` -terraform destroy -target RESOURCE_TYPE.NAME -``` - -For more about `-target`, see [`plan`](/cli/commands/plan).