Ravindra BagaleCourses & study guides मराठी Track your progress

AWS Cloud

AWS IAM User, Root User and MFA: Launch Your First EC2 Instance

Let's start. So far we learnt IP addresses, ports, and how AWS spreads its data centers across Regions and Availability Zones. In this chapter we open the AWS console for real. First we learn who should sign in and how: the root user, IAM users and MFA. Then we look at the free credits, the bill and the Region selector. And at the end we launch our first EC2 server in seven steps, and delete it again so it costs nothing. Read slowly, and try every step in your own account.

In this class

  • Why you must practise in your own AWS account
  • The console sign-in screen
  • Root user and IAM user: who is who
  • Least privilege: give each person only what they need
  • Accountability: why 1000 people must never share one login
  • Mark's setup: root once, then an admin IAM user, then one IAM user per employee
  • Why you don't use root every day, and the IAM safety net
  • Signing in as root or as an IAM user
  • MFA: passkeys and security keys, authenticator apps, hardware tokens
  • Lost MFA device: how to get back in
  • Your account ID
  • The Free plan and the $200 credits
  • Regions in the console, and enabling an opt-in Region
  • One global bill, paid later: set a budget alert
  • Why we practise in N. Virginia, and economy of scale
  • EC2 = Elastic Compute Cloud
  • The orange button: think before you click
  • The 7 launch steps, one by one
  • Launch, check, stop or terminate
  • Homework

1. Why practice matters

You can watch a hundred videos about AWS and still freeze when the console shows an error. Errors teach you. You only get errors when you do the steps yourself.

Classroom line

Until you practise yourself and hit errors, you will not understand the concept fully.

Every learner needs their own AWS account. Not a friend's account, not someone else's screen.

  1. Open an AWS account today, with your own email address.
  2. Keep a notebook. Every time you see an error, write the error and the fix.
  3. Do each step of this chapter in your account, the same day.

Worked example: why one demo is not enough.

  1. Suppose you only watch someone else launch 1 server.
  2. You launch the same server yourself 5 times, on 5 different days.
  3. On day 2 you forget the key pair. On day 4 you pick the wrong Region and can't find your server.
  4. That is 2 real errors you fixed yourself. In an interview, those 2 stories are worth more than the 1 demo you watched.

Which sign-up option?

In 2026 AWS started showing some new customers two ways to sign up: Sign up for AWS (new) and Sign up for AWS (advanced). For this course choose Sign up for AWS (advanced). Only that kind of account has a root user, IAM users who sign in to the console, a Region you choose yourself and opt-in Regions, which is everything we use below. If you only see one sign-up page, you are already on the normal path.

2. The console sign-in screen

Before any server, you must get into the AWS Management Console, the website where you click to create things.

Search "AWS management console sign in", or open https://console.aws.amazon.com/. The screen looks like this:

  1. A box for the IAM user name.
  2. A box for the Password.
  3. A Sign in button.
  4. A link: Sign in using root user email.

There is one more box: an IAM user also needs the account ID or account alias, so AWS knows which account the user name belongs to. Your browser often remembers it, which is why it may not appear. We see both screens in section 8.

How (first time, with a new account).

  1. Open the console sign-in page.
  2. Click Sign in using root user email (on some screens: choose Root user).
  3. Type the email you signed up with, then the password.
  4. Set up MFA when AWS asks (section 9). AWS now requires MFA for the root user.

3. Root user and IAM user: who is who

One AWS account is often used by many people. AWS needs a way to tell "the owner" apart from "people working inside the account".

Identify the login and the allowed action

The AWS account is the boundary that holds resources and usage records. The account root user is the owner sign-in created with its email. A person can also sign in with a named company identity and use an assigned role for that account. When they use an IAM role, AWS gives their session temporary credentials for the job.

Imagine a learner opens the EC2 page and sees yesterday’s server, but AWS denies a launch. Their sign-in succeeded. The missing permission is for the launch action. In your notebook, separate the answers to Who signed in? and What are they allowed to do? An AccessDenied response is a reason to check the selected account, role and permissions, then request the specific access you need.

  1. The root user is the identity created when someone opens the account with an email address and password (and, when AWS asks, a payment method). It has complete access to everything in the account, and nobody can limit it.
  2. An IAM user is a separate login that is created inside the account. IAM means Identity and Access Management. An IAM user can do only what it is allowed to do.
  3. An IAM user does not need its own email address. The admin chooses a user name, such as satish.

Classroom line

Whoever opens the account using their email ID and a credit card, debit card or UPI payment option, we call the root user.

An example (suppose). Suppose a big social media app runs on AWS. It has lakhs of servers and thousands of employees. Suppose its founder, Mark, opened the AWS account with the email r@b.com. (This is only a suppose example to learn with. We are not saying any real company runs this way.)

  1. r@b.com is the root user. That is Mark, the owner.
  2. Mark signs in as root, creates an IAM user called mark for himself with full admin rights, and signs out of root.
  3. Everyone else (developers, testers, support people) gets an IAM user. Nobody else ever gets the root email and password.

Classroom line

Apart from the owner, all the other people will each get an IAM user that we create for them.

Handwritten board: r@b.com arrow root user account; a line down to IAM user; Mark arrow Full Admin Access.

Whiteboard: r@b.com is the root user of the account. From it, Mark creates an IAM user "Mark" with full admin access, and uses that IAM user every day.

Suppose Mark opens an AWS account Root user: r@b.com email + password + MFA · only for root-only tasks signs in once, creates IAM user: mark AdministratorAccess · used every day satish 10 EC2, no delete mahesh S3 only ravi EC2 + EBS raja read-only rani database (RDS) Each person: own IAM user name + password + MFA. Only the permissionsthey need (suppose examples).

Figure 1. Suppose Mark opens an AWS account: the root user r@b.com is used once to create the admin IAM user mark, who then creates one IAM user per employee with only the permissions that person needs.

Use a long password from a password manager for every IAM user, never a simple one like 123456, and MFA on top.

4. Least privilege: give each person only what they need

The more power a login has, the more damage a mistake or a thief can do with it. So each person gets only the permissions they need for their job. This is called least privilege.

What can be controlled? AWS has more than 200 services. Here we use five of them:

Service What it is Simple meaning
Amazon EC2 virtual servers "server"
Amazon EBS disks attached to EC2 servers "hard disk"
Amazon S3 object storage for files "images and videos"
Amazon RDS managed databases "database"
Elastic IP a static public IPv4 address "static IP"

And one more word: an AMI (Amazon Machine Image) is the template a server is launched from: the operating system plus any software. It is not "a backup". The disk backups are called snapshots.

Worked example: one account (suppose numbers).

  1. Suppose the account has 100 EC2 servers, 20 S3 buckets and 10 databases.
  2. IAM user satish is allowed: start and stop up to 10 EC2 servers. Not allowed: delete servers, open any database.
  3. If satish tries to delete a server, AWS answers Access denied.
  4. Out of 100 + 20 + 10 = 130 resources, satish can touch only 10. That is 10 ÷ 130 ≈ 7.7% of the account.

Why data gets the strictest rules. For many companies the database is the most valuable thing they own: customers, orders, payments.

Classroom line

If he gets a thousand, it means nothing to him. But if someone says "I'll give you 10 crore rupees", he will take the risk.

  1. Suppose a competitor offers one employee 10 crore rupees for a copy of the customer database.
  2. If 500 employees can read the database, you have 500 chances of one bad decision.
  3. If only 3 trusted people can read it, you have 3 chances. That is 500 ÷ 3 ≈ 167 times fewer.
  4. So database access goes to 2 or 3 trusted people only.

More limits: time and place. Many companies also limit when and from where people can work:

  1. Time: allowed only from 9 AM to 6 PM.
  2. Place: allowed only from the office network (the office's public IP address) or a company laptop.

In AWS, IAM policies can do this with conditions, for example aws:SourceIp (which IP address the request comes from) and aws:CurrentTime (when the request is made).

AWS itself says it offers more than 200 fully featured services. Market-share numbers change every quarter and depend on who measures, so just remember that AWS is the largest cloud provider.

5. Accountability: why 1000 people must never share one login

One day something goes wrong. The company must be able to answer one question: who did it?

A question. Suppose 1000 people all sign in with the same root email and password. One morning, 1000 servers are deleted.

Classroom line

...then how will you find out who deleted it?

Try four ways to find out:

  1. Time. Everyone signs in between 9:00 and 9:15. The delete happened at 9:07. That fits all 1000 people.
  2. IP address. Everyone works from the same office, so AWS sees the same office public IP for all 1000.
  3. MAC address. This doesn't work at all. A MAC address stays inside your local network; it never reaches AWS over the internet.
  4. Logs. AWS keeps a record of actions (AWS CloudTrail). But every line says the same thing: root.

Result: 4 answers, 0 names.

Give every person their own IAM user. Now every action carries a name.

Worked example.

  1. Same 1000 people, but each has an own IAM user.
  2. The record shows: 09:07, user satish, terminate instances, ×1000.
  3. Time, IP and the log are not needed to guess any more. The name is in the record.
  4. 1000 suspects become 1 person who has to explain.
Someone deleted the servers. Who? 1000 people share the root login root same email + password 09:07  root  TerminateInstances ×1000 IP: office (same for all) Log says only "root". Nobody can prove who. Everyone has an own IAM user satish · ravi · rani 09:07  satish  TerminateInstances ×1000 every action is logged with the IAM user name Answer: satish. Accountability.

Figure 2. Left: 1000 people share the root login, and the record only says "root". Right: everyone has an own IAM user, and the record names satish.

6. Mark's setup: root once, then IAM users for everyone

Now we put sections 3 to 5 together into the real order of work.

How (step by step).

  1. Mark opens the account with r@b.com. That is the root user.
  2. Mark signs in as root, ideally only this once for daily work, and turns on MFA for root.
  3. Mark creates an IAM user mark with full admin rights (the AWS managed policy AdministratorAccess).
  4. Mark signs out of root and signs in as IAM user mark.
  5. As mark, he creates IAM users for the employees: satish, mahesh, ravi, raja, rani.
  6. For each one he sets a first password and ticks "User must create a new password at next sign-in".
  7. He sends each employee three things: the console sign-in link for the account, the user name, and the first password.
  8. At first sign-in each employee must choose a new password. Now only the employee knows it.

Classroom line

You must make them change the password; it is compulsory.

Why force the password change? Accountability again.

  1. Suppose Mark sets satish's password and satish never changes it.
  2. Now 2 people know satish's password: satish and Mark.
  3. If a server is deleted from the satish login, satish can say "maybe Mark did it". Nobody can prove otherwise.
  4. After the forced change, only 1 person knows the password. The login, and the action, belong to satish alone.

When is root still needed? AWS lists a few tasks that only root can do. For a normal account, for example: changing the root email or root password, closing the account, and restoring permissions if the only admin locked himself out. For everything else, use an IAM user.

7. Why you don't use root every day, and the IAM safety net

Root can do everything, including changing the account's email and phone. If a thief gets root, the account can stop being yours.

A story: one careless click.

  1. Mark uses root every day.
  2. One day the browser asks "Save password?" and he clicks Save by mistake.
  3. Later his laptop gets malware, a bad browser extension or a keylogger. It reads the saved password.
  4. The hacker signs in as root and changes the root password.
  5. The hacker deletes servers and databases.
  6. The hacker changes the account email and phone number.
  7. Like someone changing the nominee on your bank account, now the recovery messages go to the hacker. Proving that the account is yours becomes very hard and very slow.

The safety net. Now suppose Mark followed section 6 and works as IAM user mark every day.

  1. The same malware steals the IAM user mark password.
  2. The hacker signs in as mark and starts deleting.
  3. Mark signs in as root (email + password + MFA). The hacker doesn't have these.
  4. As root, Mark deletes or disables IAM user mark. The hacker is out at once.
  5. Mark creates a new admin IAM user and changes the passwords.

Classroom line

He will simply delete the IAM user whose account was hacked.

The IAM safety net: root removes a hacked IAMuser 1. Password stolen saved in the browser, malware takes it 2. Hacker signs in as IAM user mark, starts deleting 3. Owner uses root email + password + MFA mark 4. Root removes mark deletes or disables mark: hacker is out This works only because root is a separate login that nobody uses daily andthat is locked with MFA.

Figure 3. Animation: the IAM user password is stolen, the hacker signs in, the real owner signs in as root with MFA, and root deletes the hacked IAM user. This works only because root is kept separate and unused.

Worked example: count the keys.

  1. With root used daily: the thief needs 1 thing, the saved root password. Lose it, lose the account.
  2. With IAM daily and root locked away with MFA: the thief needs the root email + the root password + your MFA device. That is 3 things, and the root password was never saved in the browser.

Ravindra Bagale's Tip

Never click "Save password" for AWS root in any browser. Keep root details in a password manager, with MFA. Use an IAM user for daily work.

8. In a company you get IAM, not root; and how each one signs in

When you join a company, nobody will hand you the root login. You must know how to sign in as an IAM user.

Classroom line

The company belongs to someone else; you are an employee, so you will get only an IAM user name and password.

While you learn. In your own account, you will sign in as root for the first days, with MFA turned on. As soon as you are comfortable, create an admin IAM user for yourself and use that.

The two sign-in paths:

Root user IAM user
Who the account owner everyone else
Step 1 email address account ID (12 digits) or account alias
Step 2 password (sometimes a CAPTCHA) IAM user name + password
Step 3 MFA (always for root) MFA, if the admin set it (they should)

The sign-in link. Admins usually send IAM users a link that already contains the account, in this form: https://<account-ID-or-alias>.signin.aws.amazon.com/console. With that link the account ID box is filled in for you.

Two ways to sign in to the console Root user Root user email address r@b.com Password •••••••••• MFA (always for root) passkey, or 6-digit code Sometimes a CAPTCHA too. Use rarely. IAM user Account ID (12 digits) or alias 111122223333 IAM user name satish Password •••••••••• Then MFA, if the admin set it (they should).

Figure 4. Root user sign-in: email, password and MFA. IAM user sign-in: account ID or alias, user name and password, then MFA. 111122223333 is AWS's own example account ID.

9. MFA: three types

A password alone can be stolen (section 7). MFA (multi-factor authentication) adds a second proof: something you have, like your phone or a small key. A thief with only your password still can't sign in.

See where the second proof belongs

During sign-in, the password is the first proof. The registered MFA device gives the second proof, for example a code from a phone app or a confirmation by a registered passkey. AWS checks both. Giving someone your password and the current code gives away both proofs. Enter the code only on the genuine sign-in screen reached through the AWS console or the link your organization gave you.

After adding a device, keep your existing signed-in session open and try a fresh sign-in in a separate browser window. Confirm the new device works and record the account’s recovery instructions somewhere safe. For a team account, ask who can help with your work identity. Root-user recovery and recovery for an organization-managed identity follow different paths.

AWS now requires MFA for the root user. You can also turn it on for every IAM user. Each user can register up to 8 MFA devices. There are three types:

Type 1. Passkeys and security keys.

  1. A passkey lives in your phone's or laptop's password manager (Apple, Google, Microsoft and others). You unlock it with your fingerprint, face or PIN. You can also scan a QR code with your phone to sign in on a laptop.
  2. A security key is a small physical device, about the size of a pen drive, that you plug in or tap.
  3. AWS recommends these first: they are phishing-resistant, so a fake login page can't trick them.

Prices of security keys vary a lot by model and seller; check before you buy.

Type 2. Authenticator app (virtual MFA).

  1. Install an authenticator app, for example Google Authenticator or Microsoft Authenticator.
  2. In AWS, choose authenticator app, and scan the QR code with the app.
  3. The app now shows a 6-digit code that changes every 30 seconds. Type the current code at sign-in.

Type 3. Hardware TOTP token. A small device that looks like a digital watch or a key-ring tag. It shows a 6-digit code on its own screen. AWS accepts only tokens bought through the links on AWS's MFA page, because AWS must know each token's secret.

How does a code appear without internet?

  1. When you scan the QR code, the app and AWS both store the same secret seed. (A hardware token gets its seed at the factory, and AWS gets a copy.)
  2. Every 30 seconds, the app takes the seed + the current time and runs a fixed formula called TOTP (time-based one-time password).
  3. AWS runs the same formula with the same seed and the same time.
  4. Same seed + same time = same code. If your code matches, you are in.
  5. No satellite, no internet, no SMS. The token works fully offline.

Worked example: why guessing doesn't work.

  1. A 6-digit code has 10 × 10 × 10 × 10 × 10 × 10 = 1,000,000 possible values.
  2. A new code comes every 30 seconds, so a day has 24 × 60 × 60 ÷ 30 = 2,880 codes.
  3. A thief who guesses once has a 1 in 1,000,000 chance, and the code is useless 30 seconds later.
Authenticator code (TOTP): secret seed + clock,no internet needed Secret seed shared once, when you scan the QR code (or set in the token at the factory) Your phone app or token 492 039 → 715 284 → 360 917 new code every 30 seconds AWS has the same seed and clock, works out the same code Codes match sign-in allowed Animation is sped up. No satellite, no SMS: the code comes from the seedand the current time.

Figure 5. Animation: the app (or token) and AWS share one secret seed. Each works out the same 6-digit code from the seed and the current time, so the codes match. The real code changes every 30 seconds; the animation is sped up.

Why not SMS OTP?

  1. Other apps on a phone can sometimes read incoming SMS codes.
  2. In a SIM swap, a criminal gets your number moved to a new SIM and receives your SMS.
  3. AWS no longer lets you turn on SMS MFA at all. Use one of the three types above.

A hardware token has a secret seed and a clock inside, and computes each code itself with the TOTP formula. AWS has the same seed and checks the code.

10. Which MFA to choose, and keeping a backup

MFA protects you only if you don't lose it. A lost phone with no backup can lock you out.

Comparing the three:

Type Phishing-resistant Needs a battery Lost or stolen risk
Passkey / security key yes security key: no keep a second one
Authenticator app no phone turn on backup or sync
Hardware TOTP token no yes physical theft

How (the safe way).

  1. For your practice account, an authenticator app is fine and free.
  2. Turn on the app's backup or sync (for example, Google Authenticator signed in to your Google account), so codes come back on a new phone.
  3. Better: register 2 devices, for example the app on your phone + a passkey on your laptop. If one is lost, you sign in with the other.
  4. A hardware token is very safe from online attacks, but it can be physically stolen. Keep it locked away.

11. Lost your MFA device? How to get back in

Phones break and get lost. You need a plan before it happens.

Root user (AWS's own steps).

  1. Sign in as root with your email and password.
  2. On the MFA page choose Troubleshoot MFA (it may say "Troubleshoot your authentication device").
  3. Choose Sign in using alternative factors.
  4. Verify your email: AWS sends a message; click the link in it.
  5. Verify your phone: AWS calls your account's primary contact number; type the 6-digit number shown on the screen into your phone's keypad.
  6. You are in. Remove the old MFA device and add a new one.
  7. If the device was stolen, also change the root password.

If you can't get the email or the phone call, then you contact AWS Support.

IAM user.

  1. You can't reset your own MFA.
  2. Ask your admin (the person who gave you the user name). The admin deactivates your old device.
  3. Sign in and register a new device.

Worked example: why 2 devices save the day.

  1. You registered 2 MFA devices: phone app + laptop passkey.
  2. Your phone is lost. You sign in with the passkey: 1 minute.
  3. With only 1 device you would need the email check + the phone call, and if the phone number is the lost phone's SIM, you would wait for a new SIM first.

If an MFA device is lost, the first step for root is Sign in using alternative factors (email check + phone call); for an IAM user, it is the admin. AWS Support is the last step, when both checks fail.

12. Your account ID

Every AWS account has a unique number. IAM users need it to sign in, and AWS Support asks for it.

  1. The account ID is a 12-digit number, for example AWS's own sample 111122223333.
  2. You see it in the account menu at the top right of the console.
  3. An account alias is a friendly name you can set instead, used in the sign-in link.

Worked example. 12 digits give 10¹² = 1,000,000,000,000 possible IDs. That is room for a lot of accounts.

Ravindra Bagale's Tip

Your account ID is not a password, but don't post screenshots that show it (top right of the console, or in the browser address bar). Together with a user name it makes guessing easier. Crop it out before you share.

13. The Free plan and the $200 credits

You want to learn without a surprise bill. AWS's Free Tier changed in July 2025, so old blog posts and videos are wrong. Here is what AWS's own pages say today (checked October 2026).

What (accounts created on or after 15 July 2025).

  1. $100 in credits as soon as you sign up.
  2. Up to $100 more: $20 for each of 5 activities in the "Explore AWS" box on the Console Home page:
    1. Launch an instance using Amazon EC2.
    2. Set up a cost budget using AWS Budgets.
    3. Use a foundation model in the Amazon Bedrock playground.
    4. Create a web app using AWS Lambda.
    5. Create an Amazon RDS database.
  3. You choose a Free plan or a Paid plan at sign-up.
  4. On the Free plan you are not charged. It lasts up to 6 months, or until the credits are used up, whichever comes first. Then the account closes; AWS keeps your data for 90 days, and you can upgrade to the Paid plan in that time to continue.
  5. Credits pay for usage. You can't withdraw them as cash or move them to another account.
  6. Only new customers get the credits. If you already have, or ever had, an AWS account, you are not eligible. Each AWS account also needs its own email address.
New account credits: up to $200 (accounts from 15July 2025) $100 at sign-up +$20 launch an EC2 instance +$20 create a budget +$20 Bedrock playground +$20 Lambda web app +$20 RDS database 5 activities × $20 = up to $100 more Total: $100 + $100 = $200 Free plan: up to 6 months, or until the credits are used up,whichever comes first 0 · 1 · 2 · 3 · 4 · 5 · 6 months Then the account closes; AWS keeps your data for 90 days. Upgrade to thePaid plan to keep going. Credits pay for usage. They cannot be withdrawn or moved to anotheraccount.

Figure 6. Credits for new accounts: $100 at sign-up plus up to five $20 activities, up to $200. The Free plan runs up to 6 months or until the credits are used up.

Worked example 1: adding up the credits.

  1. Sign-up credit: $100.
  2. You finish 3 activities (EC2, budget, RDS): 3 × $20 = $60.
  3. Total so far: $100 + $60 = $160.
  4. Finish the other 2: + 2 × $20 = $40. Total $200.

Worked example 2: how long does $100 last for one small server? (AWS's on-demand Linux price for t3.micro in N. Virginia, October 2026: $0.0104 per hour.)

  1. One month ≈ 30 days × 24 hours = 720 hours.
  2. 720 × $0.0104 = $7.488 per month for the server, if it runs all the time.
  3. Six months: 6 × $7.488 = $44.93.
  4. So $100 covers one small server for the whole 6 months, with room left for disks and practice. (Disks and other services cost extra, so always check the Billing console.)

How the credits work: $100 at sign-up, and the next $100 is earned by completing the 5 activities, $20 each. It doesn't unlock by spending. AWS says the credits are for new customers; it doesn't publish how it checks that.

14. Regions in the console, and enabling an opt-in Region

Your server is launched in whatever Region is selected at the top right of the console. Pick the wrong one and you "lose" your server.

An isolation demo:

  1. The Region menu showed US West (Oregon). A server launched now would sit in an Oregon data center.
  2. Switch to Asia Pacific (Mumbai) ap-south-1: the Instances page lists only the Mumbai servers.
  3. Switch to US East (N. Virginia) us-east-1: a different list.
  4. The servers didn't vanish. Each Region shows only its own resources. Regions are isolated.

Worked example.

  1. You launch 2 servers in Mumbai and 1 in N. Virginia.
  2. Region = Mumbai: the list shows 2.
  3. Region = N. Virginia: the list shows 1.
  4. The bill counts all 3 (section 15).

Default and opt-in Regions. Regions that AWS launched after 20 March 2019 are opt-in: they are off until you enable them. In the console's Regions list, opt-in Regions such as Cape Town, Hyderabad and Melbourne show Disabled until you enable them, and older Regions show Enabled by default.

How to enable one.

  1. Click your account name at the top right.
  2. Choose Account (it opens in Billing and Cost Management).
  3. Scroll to AWS Regions.
  4. Select the Region, for example Asia Pacific (Hyderabad), and choose Enable.
  5. Wait: usually minutes, sometimes a few hours. Enabling is free.

Why some Regions need enabling: AWS made every Region launched after 20 March 2019 opt-in, so accounts don't get new Regions switched on without asking. The number of Regions changes as AWS adds more.

15. One global bill, paid later: set a budget alert

AWS is post-paid: you use first and pay later. A forgotten server keeps adding to the bill every hour.

  1. The Billing console shows Global: one bill for all Regions together.
  2. AWS bills monthly. The bill goes to your payment method.
  3. If a bill stays unpaid, AWS can suspend the account: you lose access to your servers and data. AWS's own help page says you must clear the dues within 30 days of suspension, or AWS closes the account; after a post-closure period the content is deleted. The agreement also allows interest on late payments. You still owe the money.

Create a budget alert (this is also one of the $20 activities).

  1. Open Billing and Cost Management → Budgets → Create budget.
  2. Choose Use a template (simplified) → Monthly cost budget.
  3. Enter an amount, for example $5.
  4. Enter your email address.
  5. Choose Create budget. AWS emails you when your costs cross the limits the template sets.

Worked example: how fast a forgotten server adds up.

  1. You forget one t3.micro running in N. Virginia: $0.0104 per hour.
  2. One day: 24 × $0.0104 = $0.2496.
  3. One month: 720 × $0.0104 = $7.488.
  4. Forget 10 of them for a month: 10 × $7.488 = $74.88. A $5 budget alert would warn you in the first few days.

Unpaid bills lead to suspension, then closure and deletion, and the debt stays. Always set a budget alert and delete what you don't use.

16. Why we practise in N. Virginia, and economy of scale

For practice you want the Region with the most capacity and usually low prices.

US East (N. Virginia), us-east-1:

  1. It is AWS's first Region, launched in 2006.
  2. It has 6 Availability Zones, more than most Regions.
  3. Its prices are usually among the lowest. Prices are per Region, so always check the EC2 pricing page.

Worked example: real prices, October 2026 (on-demand Linux t3.micro, AWS's published price data).

Region Price per hour 720 hours (1 month)
US East (N. Virginia) $0.0104 720 × 0.0104 = $7.488
Asia Pacific (Mumbai) $0.0112 720 × 0.0112 = $8.064
  1. Difference per server per month: $8.064 − $7.488 = $0.576.
  2. For 100 servers: 100 × $0.576 = $57.60 per month.
  3. For learning, $0.58 is small. For a company with thousands of servers, it adds up. But a company with users in India may still choose Mumbai for speed (remember latency from the last chapter).

Economy of scale. The bigger the operation, the lower the cost of each unit. AWS buys hardware, power and network in huge amounts, so each server-hour costs it less, and AWS has cut its prices many times over the years.

Some analogies (all suppose examples to understand the idea, not real price history):

  1. Biscuit packet. Suppose a 10-rupee biscuit packet had 100 g. The company grows and makes much more, so its cost per gram falls. Now 10 rupees gets you 120 g.
  2. Toothpaste. Suppose a 20-rupee tube had 50 g, and at bigger scale it gives 70 g for the same 20 rupees.
  3. Dividend. When a company earns more, it shares some of the profit with its shareholders as a dividend. When a cloud grows, it can share some of the saving with customers as lower prices.
  4. Simple numbers. Suppose a server cost $1.00 per hour. At bigger scale it costs $0.70. Saving per hour: $0.30. For 720 hours: 720 × $0.30 = $216 per month, per server.

AWS doesn't publish why prices differ by Region. Just compare them on the pricing page.

17. EC2 = Elastic Compute Cloud

Every service name in AWS is a short form. Once you can read the name, you know what the service does.

Reading the name like a film title. You know how Kabhi Khushi Kabhie Gham is written as K3G, because "K" comes three times? AWS does the same:

  1. Elastic Compute Cloud: E + C + C. The C comes twice, so EC2.
  2. Simple Storage Service: S three times, so S3.

Each word:

  1. Elastic = like a rubber band. It stretches and comes back. Traffic goes up, you add capacity. Traffic goes down, you remove it.
  2. Compute = processing, the work a CPU does: adding 2 + 3 = 5, resizing an image, running an app.
  3. Cloud = the machine is in an AWS data center, not on your desk. You use it over the internet.

Classroom line

Traffic went up? Increase capacity. Traffic went down? Reduce capacity.

Worked example: elastic in numbers (suppose).

  1. On a normal day your site needs 2 servers.
  2. During a big sale, traffic is 5 times higher: 2 × 5 = 10 servers.
  3. After the sale you go back to 2.
  4. Suppose each server costs $0.0104 per hour, and the sale lasts 48 hours. Extra cost: 8 extra servers × 48 hours × $0.0104 = $3.99. You pay for the extra 8 only during those 48 hours.

18. The orange button: think before you click

In the EC2 console the main action is an orange button: Launch instance. Launching starts something that may cost money.

How to reach it.

  1. In the console search bar type ec2, and open EC2.
  2. The EC2 dashboard opens. Look for the orange Launch instance button.

The traffic signal analogy. Red means stop. Green means go. Orange means: slow down, look, think. Treat every orange button in AWS like that.

Classroom line

Click the button only after thinking it through; there may be charges after that.

Classroom line

Red means stop... orange means look, and green means go.

19. The 7 launch steps

Before you look at the screen, ask yourself: what do you need to start a server? A Region, RAM, an operating system, storage, a security group and a key pair. That is almost the whole launch page. AWS groups it into 7 parts (plus the Region you choose first).

Read the launch screen as a set of decisions

Start the lab with one task: open a terminal on a small Linux machine. The AMI supplies the starting operating system and its boot data. The instance type supplies the amount of virtual CPU and RAM. The storage field supplies a disk for the system and your files. Network settings decide where the instance sits and which traffic may enter. The key pair lets your SSH client prove who is logging in.

Write those five choices down before you click Launch. After launch, match each choice against the instance details. If you accidentally pick a Windows image, the SSH username and Linux steps will not match. If the subnet has no way for your chosen connection method to reach it, changing the key will not make the network path work. Determine which choice a symptom belongs to before changing anything.

Launch an instance: the 7 steps 1. Name and tags my-first-server 2. AMI (operating system) Amazon Linux 2023 · Free tier eligible 3. Instance type (CPU + RAM) t3.micro · 2 vCPU · 1 GiB 4. Key pair (login) RSA · .pem · download once 5. Network settings: security group SSH 22 (My IP), HTTP 80, HTTPS 443 6. Storage 1 × 8 GiB gp3 7. Number of instances 1 Launch instance orange button: think, then click Region first (top right of the console). For practice we use US East (N.Virginia) us-east-1.

Figure 7. Animation: the highlight moves through the 7 parts of the launch page, then the orange Launch instance button.

  1. Name and tags
  2. AMI: the operating system image
  3. Instance type: how many CPUs and how much RAM
  4. Key pair: how you will log in
  5. Network settings: the security group (firewall)
  6. Storage: the disk
  7. Number of instances

Then: Launch instance. The next sections take one step at a time.

20. Step 1: Name and tags

AWS gives every server an ID like i-0123456789abcdef0. Nobody remembers which app runs on i-0123… and which on i-0fed….

The name is optional, but always give one. The name is really a tag: a label with a key Name and a value you choose.

  1. In Name and tags type a name that says what the server does, for example my-first-server.
  2. Any clear name works.

Worked example.

  1. Suppose a company runs 30 servers: 10 web, 10 app, 10 database.
  2. Without names: 30 random IDs. To find the database servers you open all 30.
  3. With names like web-1 … web-10, app-1 … app-10, db-1 … db-10, you filter by db and see the 10 at once.

21. Step 2: AMI, the operating system image

A server needs an operating system before it can do anything.

AMI = Amazon Machine Image. It is a ready-made image that AWS copies onto your new server's disk: the operating system, and sometimes software too.

The group-photo analogy. A group photo captures everyone at one moment. An AMI captures a machine at one moment: the OS, the folders and the files, packed like a zip. Every server launched from it starts exactly like that photo.

What you see in the console (Quick Start): Amazon Linux, macOS, Ubuntu, Windows, Red Hat, SUSE Linux, Debian. Some AMIs carry a Free tier eligible label.

  1. Keep the default: Amazon Linux 2023 AMI, marked Free tier eligible.
  2. Leave the architecture at the default (64-bit x86).

Worked example.

  1. Suppose you prepare 1 server with your website installed and save it as your own AMI.
  2. Tomorrow you need 5 more web servers. You launch 5 from that AMI.
  3. All 5 start with the website already installed. Setup time: once, not 6 times.

The common disk-image file type is .iso. And remember: macOS servers are never part of the free offer; they run only on dedicated Mac hosts (section 25).

22. Step 3: Instance type (CPU and RAM)

Different apps need different power. A small blog needs a little; a big database needs a lot. The instance type decides CPU and RAM, and also the price.

Reading a name: t3.micro.

  1. t = the family (here: burstable general purpose).
  2. 3 = the generation.
  3. micro = the size.

Other families: c (compute-heavy work), r (memory-heavy work), i (storage-heavy work), f (special FPGA hardware). A vCPU is a virtual CPU. Think of a quad-core or octa-core phone: more cores, more work at the same time.

The T2 table (correct values, from AWS's T2 page):

Type vCPU RAM (GiB)
t2.nano 1 0.5
t2.micro 1 1
t2.small 1 2
t2.medium 2 4
t2.large 2 8
t2.xlarge 4 16
t2.2xlarge 8 32

There is no t2.3xlarge. Look at the RAM column: each step doubles it. 0.5 → 1 → 2 → 4 → 8 → 16 → 32.

T2 sizes: each step up doubles the RAM vCPU RAM (GiB), bar to scale t2.nano  1 0.5 t2.micro  1 1 t2.small  1 2 t2.medium  2 4 t2.large  2 8 t2.xlarge  4 16 t2.2xlarge  8 32 There is no t2.3xlarge. Sizes go nano, micro, small, medium, large, xlarge,2xlarge.

Figure 8. T2 sizes: RAM doubles at each step, from 0.5 GiB (nano) to 32 GiB (2xlarge). The bars are to scale.

Which types are "free"? It depends on when the account was created:

Account created Instance types marked Free tier eligible
before 15 July 2025 t2.micro, t3.micro
on or after 15 July 2025 t3.micro, t3.small, t4g.micro, t4g.small, c7i-flex.large, m7i-flex.large

So in a new account the default is t3.micro: 2 vCPU, 1 GiB. That is what a new account's console shows.

EC2 launch page, Instance type section: t3.micro, Family t3, 2 vCPU, 1 GiB Memory, Current generation true, followed by on-demand prices per hour for Linux 0.0104, Windows 0.0196, Ubuntu Pro 0.0139, SUSE 0.0104 and RHEL 0.0392 USD.

Console: The launch page picked t3.micro: family t3, 2 vCPU, 1 GiB memory. On-demand Linux price 0.0104 USD per hour (N. Virginia).

Worked example 1: RAM doubling.

  1. t2.micro has 1 GiB. Go up 3 sizes: micro → small → medium → large.
  2. 1 × 2 × 2 × 2 = 8 GiB. Check the table: t2.large = 8. ✓

Worked example 2: price of one month (N. Virginia, Linux, on-demand).

  1. t2.micro: $0.0116 per hour × 720 = $8.352.
  2. t3.micro: $0.0104 per hour × 720 = $7.488.
  3. The newer t3.micro gives 2 vCPU instead of 1, and costs $0.864 less per month.

Use the table above for the t2 sizes. Also, t2.micro is no longer on the free list for accounts created on or after 15 July 2025; use t3.micro.

23. Step 4: Key pair (login)

Why not just a password? Passwords can be guessed. Automated bots keep trying common passwords against servers on the internet. So for Linux servers AWS uses a key pair instead.

Classroom line

If I put a password on the server, anyone can try to crack that password.

A key pair is two matching keys:

  1. The public key: AWS puts it on the server when it launches.
  2. The private key: a file that downloads to your laptop. Only you keep it.

What the key pair does, exactly.

  1. Authentication. When you connect with SSH, the server sends a challenge. Only the matching private key can answer it. The private key itself never travels over the network.
  2. Encryption. After you are let in, SSH and the server agree on a temporary session key, and every command and reply is encrypted with it.
Key pair: prove who you are, then talk in secret Your laptop private key file (.pem) never leaves your laptop Step 1: authentication The server sends a challenge. Only the matching private key can answerit. The key itself is never sent. Step 2: encrypted session Both sides agree on a temporary session key. Every command and replyis encrypted with it. EC2 server public key, put there by AWS at launch RSA key size: 2048 bits (bits, not characters). Lose the .pem file and youcannot log in with that key pair.

Figure 9. Step 1: the private key on your laptop proves who you are by answering the server's challenge. Step 2: a temporary session key encrypts everything you send. The private key never leaves your laptop.

Choices in the Create key pair window.

Field Options What to pick
Key pair type RSA or ED25519 (two key-making algorithms) RSA (works for Linux and Windows; ED25519 is Linux only)
Private key file format .pem (for OpenSSH) or .ppk (for PuTTY) .pem

Which file for which laptop?

  1. Windows + PowerShell (newer than the old CMD): .pem. Windows 10 (from version 1809, in 2018) and Windows 11 have Microsoft's OpenSSH client; if ssh is missing, add OpenSSH Client under Settings → Optional features.
  2. Windows + PuTTY: .ppk. In the past Windows had no good built-in SSH, so PuTTY was common. PuTTYgen can convert .pem ↔ .ppk.
  3. Mac (Terminal): .pem.
  4. Linux (terminal): .pem.

So in most cases today: RSA + .pem.

Create key pair dialog: Key pair name pehliwali1; Key pair type RSA selected, ED25519 not selected; Private key file format .pem for use with OpenSSH selected, .ppk for use with PuTTY not selected; a warning to store the private key in a secure place; Cancel and Create key pair buttons.

Console: Create key pair: name pehliwali1, type RSA, file format .pem (for OpenSSH). .ppk is for PuTTY. AWS warns to store the private key safely because you need it later.

  1. In Key pair (login) choose Create new key pair.
  2. Name it the same as the server, for example my-first-server. (If a key pair with that name already exists, AWS says "Key pair already exists"; pick another name, such as my-first-server-1.)
  3. Type: RSA. Format: .pem.
  4. Choose Create key pair. The file my-first-server.pem downloads, usually to your Downloads folder, and is selected for the server.
  5. This is the only download. AWS gives you the private key file only this once. Move the file to a safe folder.
  6. On Mac or Linux, lock the file so only you can read it: chmod 400 my-first-server.pem. SSH refuses keys that others can read.

Classroom line

Whatever name we give the server, we give the key pair the same name.

Classroom line

Without the key pair file we cannot log in to the server.

Worked example: 2048 bits.

  1. An RSA key from AWS is 2048 bits long. 2048 ÷ 8 = 256 bytes.
  2. A 2048-bit number can have about 2²⁰⁴⁸ values, a number with 617 digits.
  3. A 12-character password, even from 95 keyboard characters, has 95¹² ≈ 5.4 × 10²³ possibilities, a number with only 24 digits.

AWS creates 2048-bit RSA keys (the size is in bits). The key pair is mainly for proving who you are; the encryption of the session uses a separate temporary session key.

24. Step 5: Network settings and the security group

Ports are the doors of a server (remember ports from the IP chapter). Attackers try open doors all day. A security group is the firewall that decides which doors are open, and for whom.

Set the port for your connection, then verify the path

For SSH from your own laptop in this lab, the server needs to accept TCP 22 from the public address your connection uses. In an IPv4 rule, /32 means exactly one address. The console’s My IP option fills in that address for you. If you switch Wi-Fi or turn on a VPN before testing, the address seen by AWS can change. Look at the actual source before adding a replacement rule.

This rule allows traffic addressed to the instance. The subnet route, instance address and SSH service still have to work. Test SSH from the network you used to set the rule. When the SSH service responds but refuses the login, you have moved past the basic incoming port check. Look at the username and key next.

Classroom line

If you go to sleep leaving your house door open, anyone can come in and steal.

  1. Inbound rules = traffic coming into the server. A new security group has no inbound rules, so everything is blocked until you add a rule.
  2. Outbound rules = traffic going out. A new security group allows all outbound traffic.
  3. Each inbound rule has a type, a port and a source (who may connect).

The rules:

Type Port Source Meaning
HTTP 80 0.0.0.0/0 anyone can open your website
HTTPS 443 0.0.0.0/0 anyone can open your website securely
SSH 22 0.0.0.0/0 while practising; My IP in real work log in to manage the server

What does 0.0.0.0/0 mean? "Every IPv4 address in the world". From the first chapter: 256 × 256 × 256 × 256 = 4,294,967,296 addresses. All of them may knock on that port.

How (for practice).

  1. In Network settings, keep Create security group.
  2. Select Allow SSH traffic from, then choose My IP. SSH uses TCP port 22. We will test it from the same network in the next chapter.
  3. A source of 0.0.0.0/0 allows every IPv4 address. Keep My IP for this lab and update the rule if your public address changes.
  4. (Later, for a web server, tick Allow HTTP and Allow HTTPS.)

With SSH open to Anywhere, only someone with your private key can log in, but bots will still try all day. My IP shuts them out at the door.

Firewall (security groups) section: Create security group selected; Allow SSH traffic from Anywhere 0.0.0.0/0 ticked; Allow HTTPS and Allow HTTP not ticked; a yellow warning that rules with source 0.0.0.0/0 allow all IP addresses to access the instance and recommending known IP addresses only.

Console: The screenshot shows the warning for Anywhere. In your lab choose My IP as the source.

Security group = firewall in front of your server Internet :22 ✓ :80 ✓ :443 ✓ :3306 ✗ port 3306 has no rule: dropped security group Inbound rules SSH   22   My IP HTTP  80   0.0.0.0/0 HTTPS 443  0.0.0.0/0 EC2 server outbound: all allowed

Figure 10. Animation: packets for ports 22, 80 and 443 have matching inbound rules and reach the server. A packet for port 3306 has no rule and is dropped. Outbound traffic is allowed by default.

Worked example: Anywhere vs My IP.

  1. Source 0.0.0.0/0: 4,294,967,296 possible addresses can reach port 22.
  2. Source My IP, for example 203.0.113.25/32: exactly 1 address.
  3. That is 4,294,967,296 times fewer addresses that can even try.

25. Step 6: Storage (the disk)

RAM forgets everything when the power goes. The OS, your files and your database must live on a disk.

The server's main disk is an EBS root volume.

  1. Amazon Linux 2023: the default is 1 × 8 GiB gp3. Linux without a desktop is small, so 8 GiB is enough to start.
  2. Windows Server base AMIs: 30 GB root volume.
  3. macOS: runs only on EC2 Mac dedicated hosts (real Mac minis), with a 24-hour minimum. Not part of any free offer.

Keep 1 × 8 GiB gp3.

Worked example: how many such disks fit in 30 GB?

  1. Suppose you have 30 GB to use for disks.
  2. One Linux server needs 8 GiB.
  3. 30 ÷ 8 = 3.75, so 3 Linux servers.
  4. One Windows server needs 30 GB alone: 1 Windows server.

Windows Server base AMIs use 30 GB, and macOS needs a dedicated Mac host.

26. Step 7: Number of instances

Sometimes you need many identical servers at once.

Type a number, and AWS launches that many servers with exactly the same settings. 10 means 10 identical servers.

But there is a limit. New accounts have service quotas. For on-demand servers the quota is counted in vCPUs per Region, not in number of servers. If you need more, request an increase in the Service Quotas console.

Worked example (suppose quota).

  1. Suppose your quota is 16 vCPUs in N. Virginia.
  2. t3.micro has 2 vCPUs.
  3. 16 ÷ 2 = 8 servers at most.
  4. Ask for 10: AWS refuses the launch. Ask for 8: it works.

How (for practice). Keep 1.

Account limits are AWS service quotas. You can see and raise them in the Service Quotas console.

27. Launch, view, and check the Region

  1. Check the Summary box on the right: 1 instance, Amazon Linux 2023, t3.micro, new security group, 1 volume of 8 GiB.
  2. Click the orange Launch instance. Think first (section 18).
  3. A green success message appears. Click View all instances.
  4. Your server shows Instance state: Running. The Status check shows Initializing for a few minutes, then "checks passed".
  5. Look at the top right: N. Virginia, us-east-1. You are sitting in India, and your server is running in a data center in the USA.

Worked example: billing starts at Running.

  1. Billing is per second, with a 1-minute minimum each time the server starts.
  2. Suppose you keep it running for 10 minutes: 10 ÷ 60 × $0.0104 = $0.0017.
  3. Suppose you keep it for 30 seconds: you still pay for 1 minute: 1 ÷ 60 × $0.0104 = $0.00017.

28. Stop or terminate?

When you finish practice, you must decide: switch it off, or delete it.

  1. Stop = power off. You can Start it again later. You don't pay for server time while it's stopped, but you still pay for its EBS disk. (After a start it usually gets a new public IP address, the dynamic IP from the first chapter.)
  2. Terminate = delete. The server is gone for good, and by default its root disk is deleted too. You stop paying for it as soon as it starts shutting down.

Classroom line

After you stop it, there are no server charges, only the hard disk charges.

Running, stopped, terminated: what you pay for Running $ server time (compute) $ EBS disk server works Stop ↓ · ↑ Start Stopped 0 server time (compute) $ EBS disk can Start again later Terminate Terminated 0 server time (compute) 0 root EBS disk deleted gone, cannot start Terminate also works directly from Running $ = billed. Running time is billed per second (1 minute minimum each start).Stopped: only the disk is billed.

Figure 11. Running: server time and disk are billed. Stopped: only the EBS disk is billed, and you can start again. Terminated: the server and its root disk are deleted, nothing more is billed.

How to terminate.

  1. Select the server (tick the box).
  2. Instance state → Terminate (delete) instance.
  3. Confirm.
  4. The state changes to Shutting-down, then Terminated. After a while it disappears from the list.

Worked example: what does a stopped server cost? (AWS's EBS pricing page uses $0.08 per GB-month for gp3 as its example rate; check your Region.)

  1. Stopped for a month, 8 GiB disk: 8 × $0.08 = $0.64.
  2. Running for a month: $7.488 (server) + $0.64 (disk) = $8.128.
  3. Terminated: $0.
  4. So: stop if you will use it again soon; terminate if you're done.

Hands-on lab: IAM, MFA, and your first EC2 server

Class walked through every console screen. Here the same path is one numbered list: exact clicks, expected screens, and the errors students hit. Use the Free plan / credits. Prefer N. Virginia (us-east-1) for this practice (same as class), then stop or terminate when done.

What you will finish with. Root MFA on, one IAM admin user, a budget alert, and one Amazon Linux EC2 instance in Running with status checks passed — then you stop it so it does not keep billing.

  1. Open the console sign-in page
    • Do: In the browser go to the AWS Management Console sign-in page (search “AWS management console sign in”).
    • You should see: Boxes for IAM user name and Password, a Sign in button, and a link Sign in using root user email.
    • Check: If you are already signed in, open a private window so you practise the full path.
    • Why: Root and IAM use different sign-in paths. Mixing them up is the first support ticket most beginners open.
  2. Sign in as root (first-time / rare use)
    • Do: Click Sign in using root user email → choose Root user → enter the account email and password → Sign in. Complete MFA if AWS asks (next steps).
    • You should see: The AWS console home (service search bar at the top).
    • Check: Top-right account menu shows your root email / account name.
    • Why: Root can close the account and change billing. Class rule: use root to turn on MFA, create one admin IAM user, then lock root away.
  3. Turn on MFA for root
    • Do: Top-right account menu → Security credentials (or IAM → Dashboard → “Add MFA” for root). Under Multi-factor authentication → Assign MFA device → device name e.g. root-phone → Authenticator app → show QR → scan with Google Authenticator or Microsoft Authenticator → enter two consecutive 6-digit codes → Add.
    • You should see: MFA device listed as assigned / enabled for root.
    • Check: Sign out and sign in again as root — after password, AWS asks for the 6-digit code that changes every 30 seconds.
    • Why: Password alone is not enough. SMS is weaker (SIM-swap); class uses an authenticator app. Keep a backup/sync on the app so a lost phone is recoverable.
  4. Create the admin IAM user (Mark pattern)
    • Do: Search IAM → Users → Create user → User name mark (or your name, one word) → tick Provide user access to the AWS Management Console → create password (custom or auto) → tick Users must create a new password at next sign-in → Next → Attach policies directly → tick AdministratorAccess → Next → Create user.
    • You should see: Success page with console sign-in URL and the user name. Copy the sign-in URL / account ID.
    • Check: Users list shows mark. Open the user → Permissions tab shows AdministratorAccess.
    • Why: Least privilege later; for class the owner’s IAM user needs full admin so you never need root daily. Forced password change means only that person knows the password (accountability).
  5. Sign out of root; sign in as the IAM user
    • Do: Sign out. Open the console sign-in URL (needs Account ID or alias + IAM user name + password). Complete MFA if you assigned MFA to the IAM user too.
    • You should see: Console home. Top-right shows the IAM user name, not only the email.
    • Check: Account ID (12 digits) matches the ID from the root account menu.
    • Why: In a company you never get root. Daily work is always IAM. Account ID is how IAM sign-in finds your account.
  6. Set a budget alert (one global bill)
    • Do: Search Billing / Budgets → Create budget → Cost budget → e.g. amount 5 USD → alert at 80% → your email → Create.
    • You should see: Budget listed with alert configured.
    • Check: Confirm the email gets an “SNS / budgets subscription” style confirmation if AWS sends one, and accept it.
    • Why: Regions share one bill. A forgotten server in another Region still charges you. Alerts catch surprises early.
  7. Pick the practice Region
    • Do: Top-right Region menu → US East (N. Virginia) us-east-1 (class default for this lesson). Confirm the label before every launch.
    • You should see: Top-right shows N. Virginia.
    • Check: If you meant Mumbai, switch to ap-south-1 now — do not launch first and switch later.
    • Why: Wrong Region = empty instance list later, and higher latency for Indian users if you leave production there.
  8. Start the EC2 launch wizard
    • Do: Search EC2 → orange Launch instance.
    • You should see: The multi-step launch form (Name, AMI, Instance type, Key pair, Network, Storage, …).
    • Check: Pause on the orange button — think first; launching can use credits.
    • Why: Orange = main action in the AWS console. Habit: read Region + type + storage before you click.
  9. Step 1 — Name and tags
    • Do: Name my-first-server (clear, no spaces if you like; spaces work but are harder in scripts).
    • You should see: Name field filled.
    • Check: Name describes the job of the server, not a joke string you will forget in a week.
    • Why: Filtering 30 servers by web or db saves time on the job.
  10. Step 2 — AMI
    • Do: Under Application and OS Images, choose Amazon Linux → Amazon Linux 2023 AMI marked Free tier eligible. Leave architecture 64-bit (x86).
    • You should see: AMI id like ami-… selected.
    • Check: Free tier eligible badge is visible if you are on the Free plan path class used.
    • Why: AMI = the disk image (OS + starter software). Same AMI later = identical servers for scaling.
  11. Step 3 — Instance type
    • Do: Choose t2.micro or t3.micro — whichever your console marks Free tier eligible in this Region.
    • You should see: Type shows 1 vCPU / 1 GiB (t2.micro) or 2 vCPU / 1 GiB (t3.micro).
    • Check: You did not pick large/xlarge by accident.
    • Why: Type sets CPU and RAM price. Micro is enough for SSH practice.
  12. Step 4 — Key pair (login)
    • Do: Key pair → Create new key pair → name my-first-server (single word preferred) → Key pair type RSA → Private key format .pem (PowerShell, Mac, Linux) → Create key pair. File downloads once.
    • You should see: Browser downloaded my-first-server.pem; the form now shows that key selected.
    • Check: If “Key pair already exists”, pick my-first-server-1. Move the .pem to a safe folder (Downloads is fine for class).
    • Why: Private key never leaves your laptop again. Lose the file = you cannot SSH (you would need a new key + repair access).
  13. Step 5 — Network and security group
    • Do: Network settings → Create security group → tick Allow SSH traffic from, set the source to My IP (port 22), and leave HTTP/HTTPS unticked for this lab.
    • You should see: Inbound rule SSH / 22 / Anywhere.
    • Check: For real work later, change source to My IP. Class uses Anywhere so home Wi-Fi changes do not lock you out.
    • Why: New SG blocks all inbound until you add a rule. No port 22 = SSH times out (next chapter).
  14. Step 6 — Storage
    • Do: Keep default root volume 8 GiB gp3 (Free tier friendly).
    • You should see: 8 GiB listed.
    • Check: You did not bump to 100 GiB by mistake.
    • Why: You pay for provisioned GB. 8 GiB is enough for Amazon Linux practice.
  15. Step 7 — Number of instances, then launch
    • Do: Number of instances 1 → orange Launch instance → wait for green success → View all instances.
    • You should see: Instance state moves Pending → Running. Status checks go to 2/2 or 3/3 passed (gives it 1–2 minutes).
    • Check: Instance id i-…, Public IPv4 filled, Private IPv4 like 172.31.x.x, correct Region still selected.
    • Why: Pending = AWS is attaching compute + disk + ENI. Running + passed checks = ready to SSH in the next lesson.
  16. Stop when practice is done (do not leave it running overnight)
    • Do: Select instance → Instance state → Stop instance. Confirm.
    • You should see: Stopping → Stopped. Public IP disappears (auto-assigned). EBS disk remains.
    • Check: Stopped instances still cost a little for the EBS volume; Terminate deletes the disk too — use Terminate only when you are finished with the lab forever.
    • Why: Billing for compute stops when Stopped; disk storage continues. Habit from day one.

29. Homework

Classroom line

From tomorrow I am starting Linux. Everyone needs an AWS account.

Try at home

Task 1: your account, safely

  1. Create your own AWS account (Sign up for AWS (advanced)) with your own email.
  2. Turn on MFA for root, with 2 devices if you can (authenticator app + passkey).
  3. Write your 12-digit account ID in your notebook, not in any screenshot.

Task 2: credits and budget

  1. On Console Home, find the Explore AWS box and your credit balance.
  2. Create a monthly cost budget of $5 with your email. (That is $20 of credits earned.)
  3. Write: how many months are left on your Free plan?

Task 3: launch and delete

  1. Region: US East (N. Virginia).
  2. Launch 1 server: Amazon Linux 2023, t3.micro, new RSA .pem key pair named like the server, SSH from My IP, 8 GiB gp3.
  3. Wait for Running, then terminate it.
  4. Calculate: if you had forgotten it for 3 days, what would it cost at $0.0104 per hour? (Answer: 3 × 24 × 0.0104 = $0.7488.)

Task 4: tables from memory

  1. Write the T2 table (vCPU and RAM) from nano to 2xlarge.
  2. Write the 7 launch steps in order.

Next chapter: Linux. Keep your AWS account ready and your .pem file safe.

Ravindra Bagale's Tip

In interviews, when they ask "how do you secure an AWS account?", answer in this order: "I lock the root user with MFA and don't use it daily, I give each person an own IAM user with least privilege and MFA, I set a budget alert, and I never open SSH to 0.0.0.0/0 in production." Four lines, and each one shows you know why.

Common errors and fixes

Real mistakes from this class and junior tickets.

Error / symptomFix
Cannot find the instance you just launchedWrong Region selected (top right). Switch back to the Region you launched in.
“Key pair already exists”Choose a new name (my-first-server-1) or select the existing key if you still have its .pem.
Downloaded .pem deleted / lostYou cannot download it again. Create a new key pair and launch a new instance (or use SSM / instance connect recovery later).
IAM sign-in page rejects the userUse Account ID (12 digits) or account alias, not only the user name. Root email will not work on the IAM path.
MFA code “invalid”Phone clock must be automatic/network time. Wait for the next 30s code. Enter the code from the account you enrolled, not another.
Lost MFA device (root)Sign-in → Troubleshoot MFA / alternative factors (email + phone). Then remove old MFA and assign a new device. Also change the password if the phone was stolen.
Launch succeeds but status checks fail for many minutesWait 2–5 minutes. If still failing, stop/start once; confirm you used a current Amazon Linux 2023 AMI.
Bill surprise with no “running” serversCheck other Regions; check unused Elastic IPs and leftover EBS volumes from terminated instances that had “delete on terminate” off.

FAQ

Q. Should I use root every day in class?

Class may allow root while you learn the first weeks. The habit to build now: MFA on root, admin IAM user, daily IAM. Companies give you IAM only.

Q. t2.micro or t3.micro?

Pick whichever the console marks Free tier eligible in your Region. Both are fine for SSH practice.

Q. .pem or .ppk?

Use .pem with Windows PowerShell, Mac Terminal, and Linux. Use .ppk only if you still use PuTTY.

Q. Stop or Terminate?

Stop = keep the disk, lose auto public IP, no compute charge. Terminate = delete the instance (and usually the root disk). Prefer Stop between class days.

Q. Why N. Virginia in class?

Oldest Region, many features first, often cheaper for tiny practice. For a real site for Maharashtra users, prefer Mumbai (ap-south-1).

Recap

In short

  1. Practise in your own account; errors teach you.
  2. Root user = the owner's email login, full access, MFA required. Use it only for root-only tasks.
  3. IAM users = one per person, least privilege, own password (forced change at first sign-in), MFA.
  4. Shared logins kill accountability; with own IAM users the record names the person.
  5. If an IAM user is hacked, root deletes or disables it. Never save the root password in a browser.
  6. IAM sign-in needs the account ID (12 digits) or alias + user name + password.
  7. MFA types: passkey or security key (best), authenticator app, hardware TOTP token. TOTP = secret seed + clock, a new 6-digit code every 30 s. No SMS.
  8. Lost MFA: root uses alternative factors (email + phone call); an IAM user asks the admin.
  9. New accounts: $100 + up to $100 from 5 activities of $20; Free plan up to 6 months.
  10. Regions are isolated; opt-in Regions (after 20 March 2019) are enabled from Account → AWS Regions.
  11. One global, post-paid bill. Set a budget alert. Unpaid bills lead to suspension.
  12. N. Virginia: first Region (2006), 6 AZs, usually low prices: t3.micro $0.0104/h vs Mumbai $0.0112/h.
  13. EC2 = Elastic Compute Cloud. 7 steps: name, AMI, instance type, key pair, security group, storage, count.
  14. T2: nano 1/0.5, micro 1/1, small 1/2, medium 2/4, large 2/8, xlarge 4/16, 2xlarge 8/32. New free types include t3.micro.
  15. Key pair: RSA 2048-bit, .pem (OpenSSH) or .ppk (PuTTY), download once, chmod 400.
  16. Security group: inbound closed by default; 80, 443, 22; SSH from My IP in real work.
  17. Stop = only disk billed; terminate = deleted.

Samjla ka? Aaj ratri account banva, MFA lava, ani ek server launch karun terminate kara. Pudhe Linux.


Ravindra Bagale, trainer: linkedin.com/in/ravindra-bagale. Mark, the social media app, the employee names, the 10 crore offer, the biscuit and toothpaste numbers and the $1 to $0.70 server are "suppose" examples for learning. AWS facts, prices and Free Tier rules are from AWS's own pages as of October 2026 and change often, so check the live AWS pages before you rely on them.

Worked example: sign in, launch and find the instance again

Two students can see an empty EC2 list for very different reasons. One is in the wrong Region. The other is signed in to the wrong account. Check both before clicking Launch again.

  1. Read the account menu and Region selector. Record the last few digits of the account ID, the Region code and the instance Name tag in your notebook. Never record passwords, private keys or MFA codes there.
  2. After launching, record the instance ID and wait for the status checks to pass. Switch to a different Region and see that the same list appears empty. Switch back and find the instance by its ID.
  3. Once you finish, terminate your disposable instance and check whether its EBS volumes, snapshots or public IPv4 allocations remain. Terminating an instance removes its compute, but it does not promise that every related resource is gone.

Which identity for real work? Protect the root identity with MFA and keep it for root-only tasks. AWS recommends temporary credentials and federation for people, for example through IAM Identity Center. For the IAM-user exercise above, use a disposable learner account, avoid creating unnecessary access keys and remove permissions you no longer need.

Interview question: does MFA allow an IAM user to launch EC2?

MFA helps prove who is signing in. IAM permissions decide whether that identity can launch EC2. A user can pass MFA and still get AccessDenied if the launch actions are outside its permissions.

Reference 1 · Reference 2 · Reference 3 · Reference 4 · Reference 5

Practise this chapter

Interview questions and answers

How would you give a teammate enough AWS access to review EC2 without letting them launch instances?

Give them a named identity or a role-backed session with permission for the needed describe operations. Exclude launch, modification and termination permissions. Have the teammate show the expected resources and confirm a launch is denied in the lab account.

Why do you need an SSH key even after you got into AWS with a password and MFA?

The AWS identity lets you call AWS APIs and use the console. Direct SSH asks the operating system on the instance to authenticate a Linux username separately. The laptop proves it holds the private key for an authorized public key on that system.

Check your understanding

Choose an answer, then compare your reasoning with the explanation.

0 of 3 answered correctly
1. A colleague can sign in to the AWS account and list EC2 instances. Their attempted launch returns AccessDenied. What does the result point to?

Answer and explanation

B. Their session lacks an effective allow for the launch or is subject to a deny

Sign-in worked. AWS evaluated the separate permission for launching, so inspect the active account, role and policies.

2. Your lab should accept SSH from only your current public IPv4 address. Which inbound rule best matches that goal?

Answer and explanation

C. TCP 22 with that source address followed by /32

SSH normally listens on TCP 22. A /32 source covers one IPv4 address, and the single-port rule grants only the connection needed for the lab.

3. You need the same Linux environment on a server with more RAM. Which launch decision controls the amount of RAM?

Answer and explanation

B. Instance type

The AMI supplies the starting operating system and boot image. Instance type supplies the CPU and RAM capacity.

Apply the concepts

  1. In a practice AWS account, record which identity signed in and which Region EC2 is showing. Leave any account-owner sign-in separate from your learner session.

    Check your result

    You can identify the account, named session or role, and Region without writing down a password or MFA value.

  2. Before submitting your first lab launch, list the Linux image, instance type, disk, subnet and login key. Say what each one controls.

    Check your result

    You can tell which choice controls Linux, CPU and RAM, persistent files, network placement and SSH identity.

  3. Review the practice security group for SSH. Write which protocol, port and source make sense for your own IPv4 connection.

    Check your result

    You identify TCP 22 and a narrow source such as a single appropriate /32, then check that the lab uses the expected connection path.

Practice Tasks

Practice checks run in your browser. They check the answer for this exercise; they do not create resources or connect to your AWS account.

About this scenario

Milan Furniture is a furniture business in Milan. Giulia Rossi looks after its IT and cloud work. They count money in EUR and run their AWS resources in the eu-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.

0 / 12

Easy Create an IAM user

Every person should have their own user, never the root user.

Create an IAM user named giulia.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Add a user to a group

The user gets all the group's permissions at once.

Add giulia to the Developers group.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Create a group

Give permissions to groups, then add people to groups.

Create an IAM group named Developers.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Create a team group

Groups let you give the same access to many users at once.

Create a group named milanfurniture-dev.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Create a key pair

You need a key pair to SSH into new Linux instances.

Create a key pair named milanfurniture-key.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium List a user's MFA devices

Auditors check that every user with console access has MFA.

List the MFA devices of user giulia.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Attach a managed policy to a group

AWS managed policies are ready-made and kept up to date by AWS.

Attach the AWS managed policy arn:aws:iam::aws:policy/ReadOnlyAccess to the group Auditors.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Attach a policy to a role

The role needs permissions: attach a policy to say what it may do.

Attach arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess to role milanfurniture-ec2-role.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Create a customer managed policy

Your own managed policy can be reused on many users, groups and roles.

Create a policy named milanfurniture-s3-read from the document in policy.json.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Give a folder to the web server user

If nginx does not own the upload folder, uploads fail with "permission denied".

Make user nginx and group nginx the owners of /var/www/milanfurniture/uploads and everything inside.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Require MFA to delete

Risky actions should need MFA, so a stolen password is not enough.

Deny s3:DeleteObject on arn:aws:s3:::milanfurniture-data/* when MFA is not present (aws:MultiFactorAuthPresent is false).

  1. Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
  2. In each statement write Effect, Action and Resource.
  3. Give only what the task needs (least privilege).
  4. Use double quotes and commas correctly. Click Check answer.

Hard Put the role in the instance profile

The profile is empty until you add the role to it.

Add role milanfurniture-ec2-role to instance profile milanfurniture-ec2-profile.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Quick revision cards

Revise this lesson in two minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens its lesson.

Comparison card: Anywhere (0.0.0.0/0) vs My IP. Anywhere (0.0.0.0/0): Security group source that allows every IP. My IP: Security group source that allows only your current IP.
Comparison: Anywhere (0.0.0.0/0) vs My IP · Download PNG
Revision card: Root user vs IAM user. Root can do everything, including closing the account. A leak is a disaster. Root = the email that created the account. IAM users = named logins with chosen permissions. Use root once to make an admin IAM user, add MFA, then lock root away. Sign in as IAM user with account ID 123456789012.
Revision card: Root user vs IAM user · Download PNG
Revision card: Least privilege. Extra permissions turn small mistakes into big outages. Give each person only what their job needs, nothing more. Use IAM groups with policies; one user per person. Tester: EC2 read-only. Admin: AdministratorAccess.
Revision card: Least privilege · Download PNG
Revision card: MFA on AWS. A stolen password alone should not open your account. MFA = a second proof: a passkey, security key or authenticator app code. Security credentials › Assign MFA device. Do it for root first. Login: password + 6-digit code 482913.
Revision card: MFA on AWS · Download PNG
Revision card: Set a budget alert. AWS bills later. A forgotten server can surprise you at month end. A budget emails you when spend crosses a limit. Billing › Budgets › Create › monthly cost budget. Budget $5, alert at 80% = $4.
Revision card: Set a budget alert · Download PNG
Comparison: Root user vs IAM user. Root user: The email login that created the AWS account. IAM user: A named login created inside the account.
Comparison: Root user vs IAM user · Download PNG
Interview card: Why should you not use the root user every day?. Root has unlimited power and cannot be restricted by IAM policies. A leak or mistake can delete everything or close the account. Daily work: admin IAM user with MFA.
Interview card: Why should you not use the root user every day? · Download PNG
Interview card: Why must 1000 employees never share one login?. No accountability: you cannot tell who did what. Removing one person means changing the password for all. One IAM user each; CloudTrail shows who did it.
Interview card: Why must 1000 employees never share one login? · Download PNG
Interview card: You lost your MFA device. How do you get back in?. Use another registered MFA device, or the root recovery with email and phone. AWS verifies you through the account email and phone. Register 2 MFA devices for root to avoid this.
Interview card: You lost your MFA device. How do you get back in? · Download PNG
Interview card: How do you avoid a surprise AWS bill?. Set a budget alert and delete or stop resources after use. AWS bills after use, so you learn of costs late. Monthly budget $5 with email at 80%.
Interview card: How do you avoid a surprise AWS bill? · Download PNG

More cards: Ravi Sir's Cards.