Remove all resources from an IBM Cloud account.
Be aware that IBM Cloud Nuke is a very destructive tool, be very careful while using it. Otherwise you might delete production data. Do NOT run this application on an IBM Cloud account where you cannot afford to lose all resources.
Some safety precautions have been put in place.
- By default IBM Cloud Nuke only lists all nukeable resources. You need to add
-n
flag to actually delete resources. - A config file can be used to specify names and IDs of resources to skip over.
The project itself is just a shell script that is required be run by an authenticated IBM Cloud user. The shell script will find and delete the following resources:
- Kubernetes and OpenShift clusters
- Container Registry namespaces
- Applications (Cloud Foundry or Stater Kits)
- Services (like Cloudant, Watson services, Object Storage (and their underlying buckets), etc)
- Classic Baremetal servers
- Classic Virtual servers
- Classic File and Block volumes
- Code Engine projects (and their underlying jobs)
- Cloud Functions Namespaces (and their underlying actions)
- API keys (excluding ones requires for managing Kubernetes clusters)
- Satellite locations
- VPC VSI
- VPC Subnets and Public Gateways
- VPC Block Storage
- VPCs
Sometimes this script will throw some errors as there is no delay between requests to remove resources which may have an upstream dependency (ex: a block volume for a VM). This may require a second (or third?) execution of the script so that dependencies are cleared before all resource modules succeed in the removals.
main.sh [-n] [-c <path-to-config-file>]
-n
: Specify "no dry run". Resources will be deleted.-c
: Specify a config file for IDs/names of resources to be saved from deletion. The tool will automatically look for a file calledibmcloud-nuke
in the local directory.
-
Clone the repo.
git clone
-
Log into IBM Cloud.
ibmcloud login
-
Run the CLI.
Perform a dry run:
./main.sh
Delete all resources (will skip over any resorces found in
.ibmcloud-nuke
):./main.sh -n
Delete all resources but skip resources list in
myfile.txt
:./main.sh -c myfile.txt
-
The project needs support for deleting the following types of resources:
- Schematics Workspaces
- Developer Tools (toolchains)
- Reclamations
- VMware solutions