Deleting a workspace
Deletes a workspace from the IBM Cloud Schematics. Deleting a workspace does not automatically remove the IBM Cloud resources that the workspace manages. Use workspace destroy to remove all resources that are associated with the workspace.
IBM Cloud Schematics deprecates older version of Terraform. For more information, see Deprecating older version of Terraform process in IBM Cloud Schematics.
IBM Cloud Schematics deprecates creation of workspace using the IBM Cloud Provider Plug-in for Terraform v1.2, v1.3 template from 2nd week of April 2024.
Before you begin
- Create a Terraform configuration, and store the configuration in a
GitHub
,GitLab
, orBitbucket
repository. You can also upload a tape archive file (.tar
) from your local workstation to provide your template to IBM Cloud Schematics. For more information, see theibmcloud schematics workspace upload
command and see the upload atar
file to your workspace API. - Make sure that you have the permissions to create a workspace.
Ensure the location
and the url
endpoint are pointing to the same region when you create or update the Schematics workspaces and actions. For more information about location and endpoint, see Where is your information stored?
Deleting the workspace through UI
- Log in to IBM Cloud console.
- Click the Menu icon > Platform Automation > Schematics > Terraform.
- In Terraform List:
- Click required Workspace to delete.
- Select Actions > Delete workspace.
- Click
Next
.
- In Delete workspace dialog box. Enter a name of your
workspace name
for confirmation before delete. - Click
Delete
. Your workspace can be deleted with a Draft, Inactive, Active state.
- In Terraform List:
Verifying workspace delete
- Click your workspace that is listed in the IBM Cloud console to view the results of the destroyed operation.
- Click Workspaces tab to see the workspace list.
- Type Workspace name in the search box to get confirmation about your workspace is deleted.
Deleting the workspace through CLI
-
Delete workspace configuration. For more about deleting the workspace, see the
ibmcloud schematics workspace delete
command.ibmcloud schematics workspace delete --id <workspace_id>
-
Verify that your workspace is deleted.
ibmcloud schematics workspace list
-
Refer to, Managing IBM Cloud resources with Schematics to start Deleting, updating, or deleting IBM Cloud resources with Terraform.
Verifying workspace delete
Verify that the workspace are created successfully. When you destroy the resource by using the CLI, the command deletes the workspace completely.
ibmcloud schematics workspace delete --id us-east.workspace.testwspace03jan.811182d2
Do you really want to delete the workspace us-east.workspace.testwspace03jan.811182d2? [y/N]> y
Successfully deleted the workspace.
OK
On successful deleting, it returns the Successfully deleted the workspace confirmation.
For more information, see troubleshooting section.
Deleting the workspace through API
-
Follow the steps to retrieve your IAM access token and authenticate with IBM Cloud Schematics by using the API.
-
Delete the workspace.
Example
DELETE /v1/workspaces/us-east.workspace.testwspace03jan.4abe4795 HTTP/1.1 Host: schematics.cloud.ibm.com Content-Type: application/json Authorization: <auth_token> Cache-Control: no-cache Postman-Token: 420968d1-2874-2b40-d278-edc59b526eb0 { "name":"testwspace03jan", "type":[ "terraform_v1.4" ], "description":"terraform workspace", "location":"us-east", "tags":[ "department:HR", "application:compensation", "environment:production" ], "template_repo":{ "url":"https://github.com/Anil-CM/newrepo" }, "workspace_status":{ "frozen":true }, "template_data":[ { "folder":".", "type":"terraform_v1.4", "variablestore":[ { "name":"sample_var", "secure":true, "value":"THIS IS IBM CLOUD TERRAFORM CLI DEMO", "description":"Description of sample_var" }, { "name":"sleepy_time", "value":"15" } ] } ] }
-
See Managing IBM Cloud resources with Schematics to deploy, update, or delete IBM Cloud resources with Terraform.
Verifying workspace delete
Verify that the workspace gets deleted successfully as shown in the output.
Output
""
Deleting the workspace with Terraform
-
Follow the steps in Deleting Schematics data to delete your workspace with Terraform.
-
See Managing IBM Cloud resources with Schematics to create, update, and delete IBM Cloud resources with Terraform.
Next steps
- Looking for more workspace samples to work with? Check out the IBM Cloud Schematics GitHub repository.
Check the
Readme
files of the examples for further customization, and usage for each sample.