Destroy Workspaces
Learn how to destroy workspaces using an interactive guide, step-by-step instructions, and YAML.
You can perform specific operations against your workspace configuration. Similarly to provisioning a workspace, you can tear down the infrastructure state from a workspace without deleting the workspace itself. This guide walks you through how to create a Destroy pipeline to run the init, plan and destroy commands with OpenTofu or Terraform.
Follow these instructions to provision a workspace within the Harness Visual Editor.
In the Harness project pane, select Pipelines.
Click + Create a Pipeline to set up a new pipeline.
Click Add Stage and select Infrastructure from the Select Stage Type pane.
Enter a stage name, optional description, and tag, then select Set Up Stage.
On the Workspace tab, select an existing workspace or click + Create New Workspace to create one.
Go to the Execution tab. Under Common Operations, select Destroy to configure the workspace destruction process.
Select Use Strategy to automatically add
init,plan, anddestroysteps, or customize the pipeline by adding steps manually.Click Save and then Run Pipeline to execute.
To destroy a workspace via YAML, use the template below. Replace bracketed placeholders as needed.
Troubleshooting
Last updated
Was this helpful?