Just like the Daleks, exterminate resources from your Linode account.
This project is inspired by what is aws-nuke for automatic resource removal from an cloud provider account.
Be aware of the risks, you should not use this script in a production account.
To reduce the range and mitigate some problems there are some safety precautions:
-
By default only a few paid features are covered by this script: Linodes (VMs), Volumes, NodeBalancers and LKE (Kubernets cluster).
-
Also by default, the script will check for the existence of tags with the string name
prod
or related tags and will ignore removing the resource that is associated with this tag. -
This script will not read or remove any other resources than those listed above.
Linode charges you for the use of VMs even if they are in a powered off state and this can cause a huge cost issue for some people. So you can never simply forget to remove your instances after some testing. Including your tests with Terraform that may have failed to apply or you forgot to destroy
when finished.
With this script your resources will be deleted days at a time pre-scheduled by you with the help of GitHub actions.
- Create a Linode Personal Access Token.
- Clone this repo.
- Create a repository secret (
Settings
»Secret and variables
»Actions
»New repository secret
) namedLINODE_TOKEN
and insert your Linode Personal Access Token.
- Edit the
linode-nuke.yml
uncommenting lines4
and5
and adjust the period in which you want the removal action to be performed. By default it will run daily at 3:33am.
schedule:
- cron: "33 3 * * *"
You can also use a Docker container to run the script manually when you want.
- Clone this repo.
- In the Dockerfile file, edit the
LINODE_CLI_TOKEN
variable and insert your Linode Personal Access Token. - Build.
- Exec.
If you like this work, give me it a star on GitHub, and consider supporting it buying me a coffee: