I would like to destroy specific resources through terraform cloud. I found that TF_CLI_ARGS_plan will do a target plan. But I cannot find any variable to target destroy. Kindly let me know if this is possible in terraform cloud.
I tried TF_CLI_ARGS_destroy but it seems that variable is not working.
The above commands are used to create environment variables and to customize behavior
So that the targeted plan and apply can be made.
Terraform Cloud uses the export command to populate the shell with environment variables.
creating an environment variable named
TF_CLI_ARGS_plan
is to target a particular resource, same way you can make use of terraform destroy command with target option , which uses terraform apply in destroy mode:Below Command worked for me:
Reference: https://github.com/hashicorp/terraform/issues/12917