When an EC2 instance terminates, the value of DeleteOnTermination attributes defines whether to preserve the EBS volumes attached to that EC2 instance or delete it.
By default, the value of this attribute is set to true for root volumes and false for other volumes.
So if you leave the values of the flag to default for all the volumes, the EBS volumes apart from the root volumes will not be deleted and adds up to your monthly AWS bill.
In order to avoid such unnecessary addons on your bill, you have to set the attribute value to true on each of the EBS volumes. But AWS doesn't give the option to set this flag if you add the volume to an already running EC2 instance.
We at MagicPowershell are here to solve this problem by providing a solution to set that attribute value to true for all the volumes attached to the EC2 instance using Powershell.
This Script will ask for the EC2 instance name on which you want to enable the Delete On Termination Flag and enables it on all the attached EBS volumes of the EC2 Instance.
0 comments:
Post a Comment