AWS Builder Center
9 AWS Beginner Mistakes That Can Cost You Money or Get You Hacked (And How to Avoid Them)

9 AWS Beginner Mistakes That Can Cost You Money or Get You Hacked (And How to Avoid Them)

Every AWS beginner makes some of these mistakes. Here are nine common ones, from using the root account to leaving resources running, with a simple fix for each and a 10-minute safety checklist you can do today.

Almost every AWS learner has a story: a surprise bill, a leaked key, or a forgotten resource still running weeks later. The good news is that most of these problems come from the same handful of mistakes, and each one has a simple fix.
Here are nine to avoid, roughly in the order you'll meet them.

1. Using the root account for everyday work

The root user has unrestricted access to everything in your account. If those credentials leak, the damage can be total.
Fix:
  • Turn on MFA for the root user right away.
  • Create a separate administrative identity for daily work (IAM Identity Center is the recommended approach for people).
  • Lock the root credentials away and use them only for the few tasks that require root.

2. Not setting a budget alert

Cloud billing is usage-based, so a mistake can quietly grow. Many people only notice when the invoice arrives.
Fix:
  • Open AWS Budgets and create a monthly cost budget with email alerts at a low threshold.
  • Check Cost Explorer now and then to see which services are costing you.

3. Forgetting to shut things down

Some resources bill for every hour they exist, even when you aren't using them. Common culprits include running EC2 instances, NAT gateways, load balancers, databases, and unattached Elastic IPs.
Fix:
  • Clean up after every tutorial. Write the delete steps into your own notes as you build.
  • Tag resources (for example  project=study-assistant ) so you can find and remove everything from one experiment.
  • Do a monthly sweep of your account.

4. Hardcoding access keys in code

Keys pasted into source files end up in Git history, and public repositories are scanned constantly by bots looking for exactly this.
Fix:
  • Use IAM roles wherever possible (Lambda execution roles, EC2 instance roles) so no keys are needed.
  • Keep local secrets in environment variables or a secrets manager, never in the repo.
  • Add  .env  to your  .gitignore  before your first commit.
  • If a key leaks, deactivate and rotate it immediately, then review your account activity.

5. Giving permissions that are far too broad

Attaching administrator access or writing  "Action": "*"  makes errors disappear fast, but it also means any bug or leaked credential can do anything.
Fix:
  • Start with the minimum permissions, then add only what's needed.
  • Scope  Resource  to specific ARNs once things work.
  • Use IAM Access Analyzer to spot overly permissive policies.

6. Making S3 buckets public by accident

Public buckets are a classic cause of data leaks, often from a setting someone changed to "just get it working."
Fix:
  • Keep S3 Block Public Access turned on.
  • Serve public websites through CloudFront instead of opening the bucket itself.
  • Never store personal or sensitive data in a bucket you haven't locked down.

7. Opening security groups to the whole internet

A rule allowing SSH or database ports from  0.0.0.0/0  invites constant scanning and attack attempts.
Fix:
  • Restrict access to your own IP address, or avoid SSH entirely and use AWS Systems Manager Session Manager.
  • Never expose databases directly to the internet.

8. Publishing an API that nobody protects

If you build an endpoint that calls a paid service, such as an AI model, and leave it open, anyone who finds the URL can run up your bill.
Fix:
  • Add authentication (API keys, IAM, or Amazon Cognito).
  • Turn on throttling in API Gateway.
  • Limit input size and cap the output tokens of model calls.
  • Keep your budget alert active as a backstop.

9. Losing track of Regions

AWS resources live in specific Regions. It's easy to create something in one Region, then check the console in another and think it was deleted.
Fix:
  • Note the Region you use in every project README.
  • Check other Regions during your monthly sweep (the Billing console and Cost Explorer show spend by Region).

Your 10-minute safety checklist

  • [ ] MFA enabled on the root user
  • [ ] Daily work done with a non-root identity
  • [ ] Budget alert created
  • [ ] No keys in any Git repository
  • [ ] S3 Block Public Access enabled
  • [ ] No  0.0.0.0/0  rules on sensitive ports
  • [ ] Throttling and auth on every public API
  • [ ] Unused resources deleted

Let AI help, but verify

Tools like Claude Code can help you write least-privilege IAM policies, review templates for risky settings, and draft cleanup scripts. Treat the output like a draft from a junior teammate: read it, understand it, and test it before applying it to your account. Never paste real credentials into a prompt.

Your turn

Which of these nine have you hit, or nearly hit? Share your story in the comments. Someone else is probably about to make the same mistake.

Resources

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