Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 2.73 KB

README.md

File metadata and controls

84 lines (58 loc) · 2.73 KB

ibmcloud-nuke

Remove all resources from an IBM Cloud account.

Caution!

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.

  1. By default IBM Cloud Nuke only lists all nukeable resources. You need to add -n flag to actually delete resources.
  2. 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.

CLI options

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 called ibmcloud-nuke in the local directory.

Using the CLI

  1. Clone the repo.

    git clone
  2. Log into IBM Cloud.

    ibmcloud login
  3. 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

TODO

  1. The project needs support for deleting the following types of resources: