AWS Account and Free Tier
Before you can use any AWS service, you need an AWS account, and you should protect it from day one.
Creating an AWS Account
To sign up you need:
- An email address that you check often
- A phone number for verification
- A debit or credit card (many Pakistani bank cards work if online international payments are turned on)
The steps are:
- Go to the AWS website and click Create an AWS Account
- Enter your email and an account name, for example
ayesha-learning - Verify your email and choose a strong password
- Enter your contact details and card details
- Verify your phone number with an SMS code
- Choose the Basic support plan, which is free
AWS may charge a very small amount (about 1 US dollar) to check the card, and then return it.
The Root User
The email and password you signed up with belong to the root user. The root user can do everything, including closing the account and changing payment details.
Because it is so powerful:
- Turn on multi-factor authentication (MFA) for the root user straight away
- Do not use the root user for daily work
- Create a normal IAM user for yourself instead (you will learn this in the IAM chapter)
Never create access keys for the root user. If those keys leak, an attacker controls your whole account.
The AWS Free Tier
AWS offers a Free Tier so you can learn without paying. It has three kinds of offers:
| Kind | What it means | Example |
|---|---|---|
| Free trials | Short trials of some services | A free trial of a monitoring service |
| 12 months free | Limited free use for the first year | Small EC2 server hours each month |
| Always free | Small free limits that never end | 1 million Lambda requests per month |
The exact limits change over time, so always check the Free Tier page before you start a service. Use the smallest options (for example t2.micro or t3.micro servers) when learning.
Setting a Budget Alert
The most important thing a beginner can do is create a budget. AWS will email you when your spending goes over a limit.
In the console: Billing and Cost Management then Budgets then Create budget, and choose the Zero spend budget template. You get an email as soon as you spend even one cent.
You can also create a budget from the CLI. First save this as budget.json:
Example
{
"BudgetName": "monthly-5-dollars",
"BudgetLimit": { "Amount": "5", "Unit": "USD" },
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}Then run:
Example
aws budgets create-budget --account-id 123456789012 --budget file://budget.jsonInstalling and Configuring the AWS CLI
The AWS CLI lets you control AWS from your terminal. After installing it from the AWS website, check the version:
Example
aws --versionaws-cli/2.17.0 Python/3.11.8 Windows/10 exe/AMD64
Then connect it to your account with an IAM user's access key:
Example
aws configureAWS Access Key ID [None]: AKIAEXAMPLEKEY AWS Secret Access Key [None]: **************** Default region name [None]: ap-south-1 Default output format [None]: json
Keep your access keys secret. Never put them in code that you upload to GitHub. Bots scan GitHub for leaked AWS keys within minutes.
Cleaning Up
When you finish a lesson, delete what you created: stop or terminate servers, delete databases and empty buckets you do not need. Many surprise bills come from a forgotten server running for a month.
Exercise
Exercise
What is the best way to avoid a surprise AWS bill while learning?
