Better Programming

Advice for programmers.

Follow publication

Member-only story

Dynamically Increase Your AWS EBS Volumes

Geoffrey Mariette
Better Programming
Published in
5 min readMay 27, 2022
Photo by Igal Ness on Unsplash

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.

Important. Before extending a file system that contains valuable data, it is best practice to create a snapshot of the volume, in case you need to roll back your changes. For more information, see create Amazon EBS snapshots. If you’re Linux AMI uses the MBR partitioning scheme, you are limited to a boot volume size of up to 2 TB. For more information, see requirements for Linux volumes and constraints on the size and configuration of an EBS volume.

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:

  1. You are using GP3 volumes, which means you…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Geoffrey Mariette
Geoffrey Mariette

Written by Geoffrey Mariette

Working in IT for 10 years, just want to share with others.

Write a response