In these difficult times it’s important to make every dollar count in the Cloud. I’ve put together five quick things you can do right now to save some cash on your AWS bill.
The Rightsizing Recommendations feature of Cost Explorer identifies EC2 instances that are either under utilised and can be replaced with smaller instance types or completely idle and can be terminated. It’s provided free but may not be turned on for your account.
Right sizing analyses utilisation data of your EC2 instances to provide recommendations. It can take up to 14 days after enabling the feature for initial recommendations to be generated
AWS Trusted Advisor includes automated recommendations to optimise cost across a range of AWS services. You will need to be on Business or Enterprise support to get access to these recommendations.
Depending on how the EC2 instances were configured at launch, terminated instances can have their associated EBS volumes persist after termination and continue to accrue cost.
You can identify EBS volumes that are no longer associated with an instance from the EC2 volumes section of the AWS console by filtering by the State attribute set to “available”. Alternatively using the AWS CLI:
# Describe unattached volumes in us-east-1 region
aws ec2 describe-volumes --region us-east-1 \
--filters Name=status,Values=available
The AWS documentation describes how to delete EBS volumes.
As always confirm you don’t need the unattached volumes before deletion. If you’re unsure consider taking a snapshot of the volume first.
Avoid EBS volumes persisting after the deletion of the associated EC2 instance by using the “delete on termination” option when launching new instances.
EBS snapshots pricing is based on how large the snapshot is and how long it’s kept. You can list for snapshots older than a certain period from the AWS console by filtering by the Started attribute, or using the AWS CLI:
# Describe snapshots owned by the given account in us-east-1 region created
# before January 31st 2020. Note the date format is YYYY-MM-DD
aws ec2 describe-snapshots --region us-east-1 \
--filters Name=owner-id,Values=<your-account-id> \
--query 'Snapshots[?StartTime<=`2020-01-31`]'
The AWS documentation describes how to delete EBS snapshots.
Note that Deleting a snapshot doesn’t always reduce your costs. Other snapshots might reference that snapshot’s data, and even though it won’t be visible to you, the referenced data is preserved.
Avoid having to perform manual clean up of old snapshots by using Snapshot Lifecycle management. This feature automates the creation and retention of snapshots so you don’t have to remember to manually delete old snapshots.
If you use RDS investigate deleting manual database snapshots that are no longer needed. Unlike automated snapshots, manual snapshots aren’t subject to the backup retention period for the instance and so aren’t automatically expired.
You can identify manual snapshots from the RDS snapshots section of the AWS console by selecting “Manual Snapshots” from the dropdown filter. Alternatively using the AWS CLI:
# Describe manual rds snapshots created in us-east-1 region before
# January 31st 2020. Note the date format is YYYY-MM-DD
aws rds describe-db-snapshots --region us-east-1 \
--snapshot-type manual \
--query 'DBSnapshots[?SnapshotCreateTime<=`2020-01-31`]'
The AWS documentation describes how to delete RDS snapshots.
Note that final snapshots taken prior to database deletion are classified as manual snapshots.
Hopefully these tips have given you some quick wins in reducing your AWS spend.
If you would like to discuss your infrastructure needs please feel free to contact me directly at anthony@fullbacksystems.com