简体   繁体   中英

How to destroy resources in Terraform?

I have created resources in different workspace in terraform but not able to destroy resource from one specific workspace. Is there any way to destroy resources by specifying workspace? I have switched to that specific workspace while destroying resources but it is still pointing to other workspace state file.

You have to first select the workspace with the following command

terraform workspace select <workspace_name>

Then you can destroy the workspace with

terraform destroy -refresh=false

if you want to list the workspaces created use

terraform workspace list

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM