Skip to main content

Command Palette

Search for a command to run...

Aws(amazon Web Services)

Updated
•12 min read•View as Markdown
S

Hi! My name is Safia Khatoon. I am complete my Bachelors in Technology from RTC Institute Of Technology. My specialisation in Computer Science and Engineering.I love contributing to Open Source with the help of the skills I gain.

Also, I'm working on my YouTube Channel as well where I teach about DevOps tools and make technical content. You can have a look at it through my profile.

Feel free to reach out to me! I'd be happy to connect with you.

What is cloud ?

Anything that we can access from anywhere is the cloud. For example, when you upload your photo to Google Drive or WhatsApp, that photo is not on your phone; it's safely stored on someone else's computer (Google's server) — that's the cloud!

What is AWS?

AWS stands for Amazon Web Services.

IAM :

IAM stands for IDENTITY ACCESS MANAGEMENT.

IAM is the security system of AWS — it manages users and their permissions. 🔐

example :

Imagine you are the owner (Admin) of a factory —
factory = AWS
workers = Users
work area = EC2, S3, etc.

Now you have to decide:

  • Ram will only look after the warehouse (S3)

  • Shyam will only press the button in the machine room (EC2)

  • Lakhan will only watch the camera footage (CloudWatch)

So, this permission system is what IAM does!

What is entity ?

Entity means any real-world thing that we can store in a database.

example :

  • A student is an entity → We store name, roll number, class

  • A car is an entity → We store model, color, number

  • A mobile is an entity → We store brand, price, RAM

    Groups :

    Group is a collection of IAM users who have the same permissions.

  • 💌 IAM – Identity & Access Management

    Ek Love Story AWS ke Sheher Mein... 🌆


    🎬 Scene 1:

    IAM = Security Guard of the Colony

    There is an AWS City — very big, beautiful, above the clouds.
    The main gate guard here is named IAM.
    IAM's job is —
    "Who will come in, what they will do, how far they will go — it decides everything."
    Got it? This IAM is the whole system's bouncer/security friend.


    💑 Scene 2:

    User = Ram
    There is a guy, Ram, who wants a job in AWS City.
    IAM tells him:

    "You can come in, but tell me what work you will do?"

    A Policy is made for Ram, which says:

    "Ram can only view the S3 locker, but cannot delete it."

    IAM reads that policy, checks the permissions, and says:

    "Alright, Ram, come on in... but just look at the locker, don't mess with it!" 😎


    👨‍👨‍👧‍👦 Scene 3:

    Group = Developer Gang

    IAM thought:

    "Making separate rules for each person is tiring!" 🥱

    So IAM created a Group — 'Developer Gang'
    Now, all the developers like Ram, Shyam, and Laxman are put into the same group.

    IAM now says:

    "Everyone will get the same policy — copy-paste!" 🎉


    📜 Scene 4:

    policy(permission): The permission that we grant to users, groups, and roles is called a policy.

  • IAM policies are JSON formatted.

    Policy = Love Letter of Rules

    IAM's job is to read the rules, but where are those rules written?

    👉 Inside the Policy!
    A policy is like a love letter —
    where IAM finds written:

    "This person can read S3, can start EC2..."

    IAM reads the policy and grants permission — like getting approval! 😍


    🕵️‍♂️ Scene 5:

    Role = Guest Pass

    Sometimes a person is not a permanent user —
    like a mechanic who comes for temporary work.

    IAM gives them a Role — a temporary ID card, without a full-time job.

    IAM says:

    "You repair EC2 and then leave — no login needed!"
    Just gave a role, job done, ID gone!


    🔐 Scene 6:

    MFA = Trust in Love + OTP

    IAM says:

    "Don't just trust a password, life needs one more step — like trust in love!" 💖

    That's why it says:

    "After logging in, we'll send an OTP, only then can you come in!
    This is MFA — Multi-Factor Authentication!


    🎉 Climax:

    IAM manages the entire system:

    • Brings users in

    • Grants permissions to guests with roles

    • Saves time by creating groups

    • Reads policies to allow tasks

    • Maintains security with MFA

With IAM, everything is safe—otherwise, AWS's love would fall apart! 💔


🧠 Ek Line Me:

IAM is AWS ka love story manager — jo har relation (user, role, policy) ko permission aur security ke sath sambhalta hai. 💘

HOW TO CREATE USER :

  • GO TO INCOGNITO MODE :

  • console sign-in URL paste here

    HOW TO CREATE GROUP :

  • How to add user in a group :

    2nd method if u have already a group then how to add user

  • just double click on dev_team(means group name)

    How to add user in a group :

    What is Identity-based Policy?

    This is the rule that applies to a user, group, or role to determine what they are allowed to do on AWS.

    Example:

    Imagine Ram is an AWS user.

    You go to the IAM console and attach a policy to Ram:

      "Allow": "s3:GetObject"
    

    Meaning: Ram can only view files in the S3 bucket, he cannot delete them!

    This rule that was applied — this is an Identity-based Policy! 😎

    3 Major Types of Identity-Based Policies:

    1️⃣ Managed Policies

    A ready-made rule book by AWS or you can create your own.

    🔹 Two sub-types:

    • AWS Managed Policy:
      AWS has already created it. Example: AmazonS3ReadOnlyAccess

    • Customer Managed Policy:
      You write it yourself, according to your company's needs. Example: MyCustomEC2FullAccess


2️⃣ Inline Policies

A custom policy that is directly attached to a user/group/role.

This policy is only for that entity

  • If you delete the Ram user, the policy will also be removed! 😢

  • For example: A special rule was made just for Ram.


3️⃣ Permissions Boundaries (Bonus Type)

This is a boundary — outside of which the user cannot do anything!

  • It defines: "The maximum limit of what this user can ever do"

  • Even if the policy allows it, they cannot go beyond the boundary

  • Like: "You have a license for 40km/h, even if the car can go 100"

  • How i add a policy with a user :

go to user —> create user

paste it incognito tab(console-sign-in-details) :

(21-06-2025) - notes

ops_user

we created custom made policy (unable to delete bucket):

inline policies :

This user is only create the bucket not delete the bucket.

23-06-2025 - notes :

MFA :

DOWNLOAD THIS APP IN YOUR MOBILE

ENTER THE BOTH OTP :

What is EC2?

➡️ EC2 is like a virtual computer in the cloud that you can start, stop, and use just like your laptop.

➡️ EC2 stans for elastic compute cloud.

Region:

➡️ A Region is a physical location in the world (like Mumbai, Tokyo, etc.) where AWS has data centers.

📍 Example: Mumbai is one Region, London is another.

Availability Zone (AZ) :

➡️ An Availability Zone is a group of one or more data centers inside a Region that work together but are separate physically.

📦 Example: Mumbai Region may have 3 AZs: ap-south-1a, ap-south-1b, ap-south-1c.

Difference Between Region and AZ :

➡️ Region is the city; Availability Zones are like different buildings in that city to keep things safe and fast.

Why AZs Matter?

➡️ If one AZ fails (like power cut), AWS shifts your work to another AZ so your app never goes down.

Edge Location :

➡️ An Edge Location is a mini AWS data center close to users that delivers content super fast.

Where is it used?

➡️ Edge Locations are used in services like CloudFront, where website images, videos, or files are cached near users.

Why Edge Locations Matter?

➡️ They reduce lag and make your website feel super fast by bringing data closer to your users.

What is a Virtual Machine (VM)?

➡️ A VM is like an imaginary computer inside a real server that works just like your laptop — but it's created by software.

What is AMI (Amazon Machine Image)?

➡️ AMI is a ready-made template used to create a virtual machine (EC2 instance) in AWS.

How many instances we can create in each region?

➡️ Each Region by default 20 Instances we can create

TYPE OF ELASTIC COMPUTE CLOUD (EC2) :

Type Of Instances: Total 7 types we have

✅ General purpose Balance Memory and CPU

✅ Compute optimized - More CPU

✅ Memory optimized - More RAM

✅ Storage optimized - low latency - more Storage

✅ Accelerated Computing/GPU-Graphic Optimized

✅ High Memory - High RAM its running on nitro system (hyper-v)

✅ Previous Generation instance

✅ 1. On-Demand Instance

➡️ You pay for what you use — no commitment, no advance payment.

example :

Like Ola/Uber — use it anytime, pay per ride.

FeatureDetails
💸 CostHigh (per hour basis)
⏰ CommitmentNo commitment — anytime start/stop
🎯 Use CaseFor short tasks, testing, temporary use
⚡ BillingPay hourly/second-wise (depending on OS)

✅ 2. Reserved Instance (RI)

➡️ You reserve an EC2 instance for 1 or 3 years to get up to 75% discount.

example :

Like booking a PG room for 1 year — fixed rent, cheaper.

FeatureDetails
💸 CostLow (huge discount vs On-Demand)
⏰ Commitment1 or 3-year commitment
💳 Payment ModeNo upfront / Partial upfront / Full upfront
🎯 Use CaseLong-term apps (e.g. website, backend)

✅ 3. Spot Instance

➡️ AWS sells unused EC2 capacity at up to 90% discount, but can be interrupted anytime.

example :

Like last-minute cheap train ticket — cheap but can be cancelled anytime.

FeatureDetails
💸 CostVery low (cheapest option)
❗ RiskAWS can stop it anytime (with 2 min warning)
🎯 Use CaseFor flexible, fault-tolerant tasks (e.g. batch jobs, big data)
🔁 Auto RestartYou can automate replacement if interrupted

Comparison Table:

FeatureOn-DemandReserved InstanceSpot Instance
💰 CostHighMedium (discounted)Lowest (upto 90% off)
🕒 CommitmentNo1 or 3 yearsNo commitment
❗ ReliabilityVery highVery highCan be interrupted
🎯 Use CaseTesting, short-termLong-term appsFlexible workloads

practical :

24-06-2025 - notes

How to access a website from India to North Virginia :

Without Security Group HTTP Rule?

➡️How to install IIS:

Server Manager → Manage → Add Roles → Select Web Server (IIS) → Install → Done!

How to Deploy a Website in IIS (Windows EC2)

C:\ → inetpub → wwwroot → [ Paste your website files here ] —> go to ec2 instance —>copy public ip —> paste it incognito tab

25-06-2025 - notes

🟢 STEP 1: Open Browser and Go to Official Site

🔗 Website:

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

🟢 STEP 2: Scroll to Windows MSI Installer

Tu yeh file download kare:

👉 putty-64bit-0.81-installer.msi

🟢 STEP 3: Install PuTTY on Windows

  1. Double-click downloaded .msi file

  2. Click:

    • Next

    • Choose default folder (no need to change)

    • Install

    • Finish

✅ PuTTY, PuTTYgen, Pageant — sab install ho jayenge ek saath!

🟢 STEP 4: Open PuTTY and PuTTYgen

ssh :

Go to Your Local machine(cmd) :

26-06-2025 - notes

Create a VPC :

27-06-2025 - NOTES

IF U R ARE CONNECT

CONNECT THIS INSTANCE (public to private acces )

Types of Storage in AWS :

Storage TypeUse CaseOne-line Example
S3 (Simple Storage Service)File storageStore images/videos/backup files
EBS (Elastic Block Store)EC2 hard diskServer ka local C drive jaisa
EFS (Elastic File System)Shared folder across serversMultiple EC2 share same folder
GlacierLong-term backupOld data store for years at low cost

Types of EBS – One-Liner Style

  1. gp3 (General Purpose SSD) –
    👉 Ye ek balance wala SSD hai, jisme speed bhi theek hai aur price bhi.

  2. io2 (Provisioned IOPS SSD) –
    👉 Ye ek VIP SSD hai, super fast aur powerful – jaise databases ke liye bani ho.

  3. st1 (Throughput Optimized HDD) –
    👉 Ye ek tez truck hai, bade-bade files aur logs ko fast transfer karta hai.

  4. sc1 (Cold HDD) –
    👉 Ye ek thanda godown hai, jisme rarely used data sasta mein store hota hai.

29-06-2025 - notes

CREATE A WINDOW INSTANCE