AWS Builder Center
Diwali Cleaning for Your AWS Account: A Year End Checklist

Diwali Cleaning for Your AWS Account: A Year End Checklist

A Diwali style cleanup for your AWS account: check root and IAM credentials, idle IPs and volumes, open ports, and log retention, step by step

Before Diwali, many families clean their homes from top to bottom. Old things get sorted, forgotten corners get attention, and the house is ready to welcome light into the new year.
Your AWS account deserves the same treatment. Over a year, most accounts quietly collect leftovers: access keys nobody uses, volumes with no server attached, log groups that never expire, and open doors that were meant to be temporary. None of it looks urgent, but it adds up in risk and in cost.
This checklist walks through what to look for, using AWS's own documentation as the reference. One rule comes first: don't delete anything you aren't sure about. List first, find the owner, and only then clean.

1. Start at the front door: the root user

The root user has full access to everything in your account, including billing. AWS recommends that you don't use it for everyday work and create an administrative user instead.
Check these two things:
Root user access keys. AWS strongly recommends not creating access keys for the root user, because the root user has full access to all services and resources, including billing information. If any exist, delete them.
MFA on the root user. AWS recommends enabling multi factor authentication for the root user, and suggests that using more than one MFA device can raise the security bar and simplify access management.

2. Sweep out unused credentials

Long lived credentials are one of the most common sources of risk, because they stay valid until someone removes them. AWS advises removing IAM user credentials, meaning passwords and access keys, that aren't needed.
You have three helpful tools:
The credential report. In the IAM console, choose Credential report to download details about your users' credentials.
Access key last used. In the IAM console's users table, you can add the Access key last used column, which shows the number of days since the key was used. AWS notes that this information is accurate for all dates, and that keys not used recently might be good candidates for removal. From the CLI, aws iam get-access-key-last-used returns the last used date, the Region, and the service that was last requested.
IAM Access Analyzer unused access findings. This is an optional extra. An unused access analyzer reports unused roles, unused access keys and passwords for IAM users, and unused permissions. It requires its own separate analyzer, service linked roles aren't analyzed, and AWS charges for it based on the number of roles and users analyzed, so check the pricing first.
A careful way to clean up, and this is my own suggestion rather than an AWS rule, is to deactivate a key first, watch for anything that breaks, and delete it after a safe waiting period.

3. Close doors you forgot to close

Open network rules are easy to forget. AWS Trusted Advisor has a check called Security Groups, Specific Ports Unrestricted, which looks for rules that allow unrestricted access from 0.0.0.0/0 to specific ports and flags the riskiest ports in red. AWS documents this check as available at all support levels, though you should confirm what your own account shows, since Trusted Advisor checks depend on your support plan.
If one of those open ports is SSH, my previous post on Session Manager is the natural fix. AWS says Session Manager provides secure node management without the need to open inbound ports, maintain bastion hosts, or manage SSH keys, so you can close port 22 for good.

4. Find the quiet costs

This is where cleaning pays for itself.

Elastic IP addresses

AWS announced that from February 1, 2024, there is a charge of $0.005 per IP per hour for all public IPv4 addresses, whether attached to a service or not. Idle Elastic IPs were already charged before that. Prices can change, so check the current pricing page.
To list Elastic IPs that aren't associated with anything:
aws ec2 describe-addresses \
--query 'Addresses[?AssociationId==`null`].{IP:PublicIp,Alloc:AllocationId}'
AWS also offers Public IP Insights, a free feature of VPC IP Address Manager, to monitor and audit your public IPv4 usage. It requires creating an IPAM, and AWS says using only Public IP Insights falls under the free tier.

Unattached EBS volumes

AWS states that EBS doesn't charge you when you detach a volume, but you still accrue charges for volume storage until you delete the volume. You're charged for provisioned storage, not for how much of it you actually use.
To list volumes that aren't attached to any instance:
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query 'Volumes[].{ID:VolumeId,Size:Size,Created:CreateTime}'
Two important details from AWS: snapshots are billed separately from volumes, so deleting a volume doesn't remove its snapshot charges. And if you're unsure about a volume, AWS suggests creating a snapshot of volumes you aren't actively using before removing them. If you delete a snapshot by mistake, the Recycle Bin can help you recover it.

Idle load balancers

Trusted Advisor includes a cost optimization check for idle load balancers, so it's worth looking at. Some Trusted Advisor checks require a Business or Enterprise support plan, so what you see depends on your plan.

Leftovers from deleted NAT gateways

If you removed a NAT gateway during an earlier cleanup, two things may remain. AWS says that after you delete a NAT gateway, its routes stay in blackhole status until you update or delete them, and that deleting the gateway doesn't release its Elastic IP address from your account. Check your route tables for routes marked blackhole, and release the address if you don't need it.

5. Put a lifespan on your logs

By default, CloudWatch Logs keeps data indefinitely. AWS documentation lists retention options from 1 day to 10 years, or never expire. When events pass their retention period, they're removed automatically, though AWS notes this typically takes up to 72 hours, and retention doesn't delete the log groups or streams themselves.
To find log groups with no retention setting:
aws logs describe-log-groups \
--query 'logGroups[?retentionInDays==`null`].logGroupName'
To set a 90 day retention on one of them:
aws logs put-retention-policy \
--log-group-name "/aws/lambda/my-function" \
--retention-in-days 90
Be thoughtful here. Shorter retention deletes data permanently, so keep whatever your audits or troubleshooting actually need.

6. Label what's left

After cleaning, make the next cleanup easier. Tag resources with an owner and a purpose. AWS also points out that cost allocation tags on the Billing and Cost Management console help you track cost changes, for example for snapshots.

A safe way to clean

Make a list first, and don't delete while you're still discovering.
Find the owner of each item. If nobody claims it, ask before you remove it.
Snapshot volumes you aren't sure about before deleting them.
Deactivate credentials before deleting them, when you can.
Change one thing at a time, and write down what you changed.

A quick printable checklist

Root user has MFA and no access keys.
Unused IAM users, keys, and roles reviewed.
Security groups checked for 0.0.0.0/0 on sensitive ports.
Idle Elastic IPs, unattached EBS volumes, and idle load balancers reviewed.
Old NAT gateway leftovers cleaned.
Log groups have retention settings.
Resources have owner and purpose tags.

Final thought

Cleaning isn't glamorous, but neither is finding a surprise on a bill, or an old access key in the wrong place. Just as a clean home feels lighter, a tidy AWS account is easier to understand, cheaper to run, and safer to hand to a teammate. Pick one section a week, and put a reminder on your calendar to do it again before next Diwali, or every quarter if you prefer.
Wishing you and your family a bright, safe, and joyful Diwali. If you try this checklist and find something surprising, I'd love to hear about it in the comments.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article