Member-only story
Dynamically Increase Your AWS EBS Volumes
And save a bunch of dollars!
Disclaimer: If you consider using this script in production, I really advise you to test it in real life, and make sure you already know how your application is consuming disk space. Even if saving some money sounds like a great idea, it’s better to have your business running than a system impaired due to some disk issues.
On my side, this script is only running on non-prod environments.
Please also carefully read the AWS warning before considering using this script.

Running multiple environments can cost a fortune if you do not optimize the cost at every single level. A typical example is that you don’t need to leave the environment running 24/7 as most of the time your users are not at work.
But you also have many other optimization tricks that you can use to save a little bit more. We will go through one today, the EBS volumes unused disk space.
Before going further, we must assume that you meet some prerequisites to be eligible for the logic we will discuss:
- You are using GP3 volumes, which means you…