Skip to main content

Command Palette

Search for a command to run...

Aws(amazon Web Services)

Updated
β€’12 min read
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