← All posts
3 min read

AWS safety habits: cost, regions, and cleanup

#aws#billing#cloud#cli
📑 On this page

Part 5 of AWS from Zero. Before we create S3 buckets, EC2 instances, or VPC resources, we need safety habits.

AWS is not dangerous because one command is scary. It is dangerous because resources can be forgotten.

Always know your region

Many AWS services are regional. If you create something in us-east-1 and search in ap-south-1, it can look like the resource disappeared.

Check your configured region:

aws configure get region

Check it for a named profile:

aws configure get region --profile aws-zero

Pass a region explicitly when learning:

aws ec2 describe-instances --region ap-south-1

List before and after

Before creating a resource, list what exists.

After creating it, list again.

Before deleting it, list again.

That sounds repetitive because it is. Repetition is how you avoid deleting the wrong thing.

Example with EC2 regions:

aws ec2 describe-regions \
  --query "Regions[].RegionName" \
  --output table

Use tags

Tags are key-value labels attached to resources. They help with searching, cost allocation, automation, and cleanup.

For this series, use a consistent tag:

Project=aws-from-zero

When a service supports tags during creation, add them immediately. When it does not, tag right after creation.

Billing and budgets

Billing is not fully regional like EC2 or Lambda. It is account-level.

Use the billing console when needed, but keep CLI awareness too. AWS Budgets has CLI commands:

aws budgets help

Budget setup can be verbose because it needs account IDs, time periods, notifications, and subscriber details. We will give it a dedicated lesson later. For now, the habit is:

  • Check billing regularly.
  • Prefer free-tier-safe examples.
  • Delete resources after every lesson.
  • Avoid large instances, NAT gateways, provisioned databases, and always-on services until you understand the cost.

A cleanup mindset

Every lesson should answer:

How do I list it?
How do I inspect it?
How do I delete it?
How do I confirm it is gone?

For example, an EC2 instance cleanup flow eventually looks like:

aws ec2 describe-instances
aws ec2 terminate-instances --instance-ids i-...
aws ec2 wait instance-terminated --instance-ids i-...
aws ec2 describe-instances --instance-ids i-...

Do not memorize that yet. Just notice the shape.

In part 6, we start with S3 because it is one of the best AWS services for learning the CLI pattern safely.