By the Director, TechWorld Solution
Cloud cost is often treated as "the finance team's problem". But developers make most of the decisions that drive the bill: instance sizes, storage choices, log settings and whether a test environment stays up all weekend.
Here are five practical AWS cost optimization techniques you can try this week, using tools you already have. None of them need a big project.
1. Find unattached EBS volumes
When an EC2 instance is terminated, its volumes don't always go with it. Unattached volumes keep costing money.
You can list them with the AWS CLI:
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query "Volumes[].{ID:VolumeId,Size:Size,Created:CreateTime}" \
--output table
Check each one with its owner, take a snapshot if you're unsure, then delete what isn't needed.
2. Set log retention on CloudWatch log groups
By default, CloudWatch log groups can keep logs indefinitely. For chatty services, that adds up.
Find log groups with no retention set:
aws logs describe-log-groups \
--query "logGroups[?!retentionInDays].logGroupName" \
--output text
Then set a sensible retention period for each, agreed with your team:
aws logs put-retention-policy \
--log-group-name /my/app/logs \
--retention-in-days 30
3. Stop non-production environments out of hours
Development and test environments rarely need to run at night or at weekends. Scheduling them to stop outside working hours is one of the simplest AWS cost optimization techniques there is.
Options include AWS Instance Scheduler, a small scheduled Lambda function, or EventBridge Scheduler calling the EC2 stop and start APIs. Start with one environment, confirm nobody is affected, then expand.
4. Right-size with real data
Instances are often chosen "to be safe" and never revisited. AWS Compute Optimizer looks at your actual usage and suggests better-fitting instance types.
You can pull recommendations from the CLI once Compute Optimizer is enabled for your account:
aws compute-optimizer get-ec2-instance-recommendations \
--query "instanceRecommendations[].{Instance:instanceArn,Finding:finding}" \
--output table
Treat the results as a starting point. Test the change in a non-production environment first, especially for memory-sensitive workloads.
5. Commit only after you've cleaned up
Savings Plans and Reserved Instances can lower the cost of steady workloads. But committing before you've cleaned up means locking in waste.
Do techniques 1 to 4 first. Then look at Cost Explorer's Savings Plans recommendations, and commit to a baseline you're confident will still be running. If you're weighing up the two options, this explanation of Savings Plans vs Reserved Instances covers the trade-offs.
Bonus: check for idle Elastic IPs and old snapshots
Two more quick checks. Public IPv4 addresses on AWS carry a charge, so look for Elastic IPs that aren't associated with anything:
aws ec2 describe-addresses \
--query "Addresses[?AssociationId==null].PublicIp" \
--output text
Also review old EBS snapshots. Snapshots are useful, but they pile up quietly, especially when automated backups have no expiry. Agree on a retention period with your team and use Amazon Data Lifecycle Manager or AWS Backup policies to enforce it automatically, rather than cleaning up by hand every few months.
Finally, check data transfer. Moving data between regions, or out to the internet, can add costs that are easy to miss. Keep chatty services close together where you can.
Make it a habit, not a one-off
A few habits keep costs from creeping back:
- Tag everything with an owner and environment, so every cost has a name attached.
- Set AWS Budgets alerts for each team or project.
- Add a cost check to code review for infrastructure changes. A quick "do we need this size?" catches a lot.
- Review the bill monthly with the people who build the systems.
A word of caution
Cost optimization should never break reliability. Don't delete volumes or snapshots without checking with their owners, and don't shrink production resources without testing. The goal is to remove waste, not resilience.
Conclusion
You don't need a FinOps team to make a difference. Clean up unattached volumes, set log retention, stop idle environments, right-size with Compute Optimizer and only then commit to discounts. These five AWS cost optimization techniques are quick wins any developer can run, and they build habits that keep your cloud bill under control.
TechWorld Solution is a New Delhi-based IT services company working on AWS, Azure, DevOps and managed IT.
Top comments (1)
Setting explicit retention is a strong baseline, especially when teams classify log groups by operational and compliance needs. Retention reduces stored-log charges, but it does not reduce ingestion charges; measure bytes by log group and remove noisy debug events at the source or filter them before ingestion. For incident investigations, keep high-value security and error events at full fidelity and validate that shorter retention still meets recovery and audit requirements.