As part of my day job I help administer an IBM Cloud account for our organization. Over 50 people have access to spin up just about anything they want on the account. You can imagine that this leads to a good chunk of spending. As noted by Corey Quinn below, this is becoming an increasingly common problem.
"Our AWS bill is through the roof, we need to do something about it!" Answering this question is my entire consulting business; I have some thoughts on the cultural bits.— Corey Quinn (@QuinnyPig) February 18, 2019
Unfortunately, there is no equivalent SDK (as far as I know) for all common IBM Cloud services. Instead I decided to go old-school and write something in Bash that could using the IBM Cloud CLI. If you’re looking for a resource to learn more about Bash, check out the BASH Cheat Sheet on PCWDLD.
IBM Cloud Nuke is available to try. It will list and delete many IBM Cloud resources and attempt to delete them. Some safety measure have been put in place. A dry run is run by default that lists the resources that will be deleted. A
-n flag must be specified in order to actually delete resources. And, a
-c flag can be used to specify a file that contains IDs and names of resources that will not be deleted.
An example run can be seen below:
Attempting to use config file at default location: .ibmcloud-nuke
No (-n) flag found. Will NOT delete any resources.
DRY_RUN = 1
CONFIG_FILE = .ibmcloud-nuke
skipping Kubeflow-Faz as it exists in .ibmcloud-nuke
I hope the project is useful to folks who have a messy account like I did. Please provide feedback as issues or PRs.