AWS Notes
AWS Notes
It is a cloud computing platform provided by Amazon that offers a wide range of services
including:
Compute power (e.g., EC2 virtual servers)
Storage (e.g., S3 object storage)
Databases (e.g., Amazon RDS, DynamoDB)
Networking (e.g., VPC, Route 53)
Machine learning (e.g., SageMaker)
Security & identity services (e.g., IAM)
AWS enables individuals, businesses, and governments to run applications and store data without
owning physical servers, using a pay-as-you-go model.
EBS stands for Elastic Block Store in Amazon Web Services (AWS).
What is EBS?
Amazon EBS provides block-level storage volumes that can be attached to EC2 (Elastic Compute
Cloud) instances. These volumes behave like hard drives and are used for storing data like:
Operating systems
Databases
Application data
Files requiring frequent read/write access
Key Features:
Durable and reliable: Automatically replicated within an Availability Zone (AZ).
Persistent: Data remains intact even if the EC2 instance is stopped or terminated (unless you
delete the volume).
Scalable: You can choose volume size and performance based on your workload.
Types: General Purpose SSD (gp3/gp2), Provisioned IOPS SSD (io2/io1), Throughput
Optimized HDD (st1), and Cold HDD (sc1).
Example of How EBS is Used:
Imagine you're running a web application on an EC2 instance — say a WordPress site.
You install WordPress on an EC2 instance.
You need a place to store:
o the operating system,
o WordPress files,
o and a MySQL database.
So, you attach an EBS volume to the EC2 instance, which acts like a hard drive. The web server
reads and writes data to that volume in real-time — just like a regular disk on a physical machine.
📌 If the EC2 instance stops or reboots, your data on EBS stays intact.
🔍 What is EC2?
EC2 provides resizable virtual servers in the cloud that allow you to run applications just like you
would on a physical computer — but with flexible scaling and without owning any hardware.
Think of it as renting a computer in the cloud, where you can choose:
The CPU, memory, and storage size
The operating system (Linux, Windows, etc.)
The region or availability zone
How long you need it (on-demand, spot, or reserved)
📌 Quick Example:
You want to host a Python web app:
1. Launch an EC2 instance running Ubuntu.
2. Install Python, Flask, and any other dependencies.
3. Upload your code.
4. Expose port 80 or 443 using a security group.
5. Your app is live!
Hands-On EC2 Example: Host a Simple Website
Let’s say you want to host a simple HTML website using EC2.
🔧 Steps:
1. Login to AWS Console.
2. Go to EC2 > Launch Instance.
3. Choose:
o AMI: Amazon Linux 2 or Ubuntu
o Instance Type: t2.micro (free tier eligible)
4. Create a new key pair (used for SSH access).
5. Set Security Group to allow:
o SSH (port 22) – for access
o HTTP (port 80) – to serve your website
6. Launch the instance.
7. SSH into the instance:
bash
CopyEdit
ssh -i "your-key.pem" ec2-user@<your-ec2-public-ip>
8. Install a web server (Apache):
bash
CopyEdit
sudo yum install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd
9. Add an HTML file:
bash
CopyEdit
echo "<h1>Hello from EC2!</h1>" | sudo tee /var/www/html/index.html
10. Visit http://<your-ec2-public-ip> in your browser — done!
📝 Summary:
Choose EC2 for full control and flexibility.
Choose Lambda for event-based, short-lived tasks where you don’t want to manage a server.
Choose Lightsail if you want something simple with predictable pricing and don’t need the
full complexity of EC2.
S3 stands for Amazon Simple Storage Service — a core service in AWS used for object storage.
🧱 How It Works
S3 stores data as objects inside buckets:
Bucket = Like a folder in the cloud
Object = A file (image, video, .zip, etc.) + metadata
Example:
plaintext
CopyEdit
Bucket: my-website-assets
Object: logo.png
You access files via a unique URL:
bash
CopyEdit
https://my-website-assets.s3.amazonaws.com/logo.png
🔐 Key Features
Feature Description
Scalable Handles billions of objects
Durable 99.999999999% (11 9s) durability
Secure IAM, encryption, access policies
Low-cost tiers S3 Standard, Intelligent-Tiering, Glacier (cold storage)
Feature Description
Static website hosting You can host an HTML/CSS/JS site directly from S3
🧭 Step-by-Step:
1. Sign in to AWS Console
Go to: https://console.aws.amazon.com/s3/
2. Click “Create bucket”
3. Configure Bucket Settings
Bucket name: Must be globally unique (e.g., my-app-files-2025)
AWS Region: Choose the region closest to your users (e.g., us-east-1)
4. Uncheck “Block all public access” (Optional)
Only do this if you want to host a static website or share files publicly
You'll get a warning — proceed only if you understand the risks
5. Enable versioning (Optional)
Helps you keep old versions of files
6. Default settings are fine for most cases
Logging, encryption, tags — skip unless you need them
7. Click “Create bucket”
🎉 Bucket Created!
You now have an empty S3 bucket.
4. Storage Settings
Default is 8 GB — you can leave it as-is or increase as needed.
✅ Instance is Running!
🎯 Benefits of ELB
High availability
Automatic failover
SSL termination (you can offload HTTPS at the load balancer)
Scalable and managed — no need to run your own load balancer
How to Create an Application Load Balancer (ALB) in AWS
🔑 Prerequisites:
At least 2 EC2 instances running in the same VPC and Availability Zone(s)
A target group (you’ll create this during setup)
EC2 instances must have a web server running (e.g., Apache or Nginx on port 80)
✅ ELB Is Created!
It may take 1–2 minutes to become active.
Breakdown:
Continuous Integration (CI):
Developers frequently merge their code changes into a shared repository. Each merge triggers
automatic builds and tests to catch errors early.
Continuous Deployment (CD):
After passing tests, the code is automatically deployed to production or a staging
environment, ensuring fast and reliable delivery.
(Sometimes, CD refers to Continuous Delivery, where deployment to production requires manual
approval.)
What Happens?
Code is checked out
Dependencies installed
Tests run
App is built
Built files are synced to your S3 bucket (acting as a static website host)
CloudWatch is an Amazon Web Services (AWS) tool for monitoring and observability.
Key Features:
Feature Description
Metrics Collects data like CPU usage, disk I/O, network traffic from EC2, RDS, Lambda, etc.
Logs Aggregates and stores log files from servers, apps, Lambda functions, etc.
Alarms Set thresholds to trigger notifications or automated actions when metrics cross limits
Dashboards Create customizable graphs and charts to visualize resource health
Events Respond automatically to system changes or operational issues
Example:
You can create a CloudWatch Alarm that watches your EC2 instance CPU usage. If it goes above
80% for 5 minutes, it can send you an email alert via SNS (Simple Notification Service).
Creating CloudWatch resources depends on what you want to monitor or achieve—like setting up
alarms, logs, or dashboards. I’ll guide you through the most common tasks:
What Next?
The alarm will monitor your EC2 instance CPU and notify you if CPU exceeds 80% for 5
minutes.
You can create similar alarms for other AWS resources (RDS, Lambda, etc.).
Key Features:
Feature Description
Global network of edge locations Fast content delivery to users worldwide
Caching static and dynamic content HTML, CSS, JS, images, videos, APIs, etc.
Supports HTTPS and custom SSL Secure delivery with your own certificates
Integration with AWS origins Works seamlessly with S3, EC2, Elastic Load Balancers
DDoS protection and security Built-in AWS Shield Standard for security
Common Use Cases:
Speeding up websites and web apps, Streaming video and media
Serving APIs globally with low latency, Delivering software downloads or game assets
Here's a straightforward guide to create a CloudFront distribution using the AWS Console —
typically to deliver content from an S3 bucket or a web server.
Jenkins is a popular open-source automation server widely used to build, test, and deploy software
projects automatically.
What is Jenkins?
It helps automate the Continuous Integration (CI) and Continuous Delivery (CD) process.
Jenkins runs tasks called jobs or pipelines that perform steps like compiling code, running
tests, and deploying applications.
It supports hundreds of plugins to integrate with different tools (e.g., Git, Docker, AWS).
Want a guide on how to install Jenkins or create your first Jenkins pipeline?
Absolutely! Let’s start with a simple guide to install Jenkins and then I’ll walk you through creating
your first Jenkins pipeline.
DevOps is a combination of Development (Dev) and Operations (Ops) — a culture, practice, and
set of tools aimed at improving collaboration between software developers and IT operations teams.
What is DevOps?
It breaks down the traditional silos between developers (who write code) and operations
(who deploy and maintain systems).
Focuses on automation, continuous integration, continuous delivery, and monitoring.
Goal: Deliver software faster, more reliably, and with higher quality.
Benefits of DevOps:
Faster software releases
Better software quality
Reduced downtime
Improved scalability and security
More efficient teams
GitHub is a web-based platform for version control and collaborative software development.
What is GitHub?
It uses Git, a version control system, to track changes in your code over time.
Developers use GitHub to store, manage, and share their code repositories.
It enables collaboration by allowing multiple people to work on the same project without
overwriting each other’s changes.
What is Docker?
A containerization technology that bundles your app, libraries, and environment into a single
container.
Containers are lightweight, portable, and isolated from the host system.
Unlike virtual machines, containers share the host OS kernel, making them faster and more
efficient.
Example:
You can create a Dockerfile for a Node.js app, build an image, and run it as a container anywhere
without worrying about the host setup.
Want me to help you write a simple Dockerfile or explain how to run containers?
Sure! Here’s a simple example of a Dockerfile for a basic Node.js app and how to build and run the
container.
Key Features:
Feature Description
Configuration
Automate setup and maintenance of systems
Management
Application Deployment Deploy apps consistently across environments
Orchestration Coordinate complex workflows across multiple servers
Running the same playbook multiple times leads to the same result
Idempotent
without errors
Would you like a step-by-step guide on setting up Ansible or writing your first playbook?
Absolutely! Here’s a quick step-by-step guide to set up Ansible and write your first playbook.
Step 5: Verify
Connect to your servers and check if Nginx is installed and running.
GitHub is a popular web-based platform that hosts Git repositories and helps developers collaborate
on code.
What is GitHub?
Built on top of Git (a version control system), GitHub allows you to store, manage, and
track changes in your code.
It makes it easy for teams to work together by providing tools for branching, merging, code
reviews, and issue tracking.
Supports both public (open source) and private repositories.
Key Features:
Feature Description
Repositories Storage for your project code and history
Branches Work on separate versions of your code
Pull Requests Propose and review code changes before merging
Issues Track bugs, feature requests, and tasks
GitHub Actions Automate workflows like CI/CD pipelines
Collaboration Commenting, team management, code review
Done!
Your code is now stored and version-controlled on GitHub.
YAML stands for "YAML Ain't Markup Language" — it’s a human-readable data serialization
format used for configuration files and data exchange.
What is YAML?
Designed to be easy to read and write by humans.
Commonly used to define configurations for applications, CI/CD pipelines, cloud
infrastructure (like Kubernetes), and more.
Uses indentation (spaces) to represent structure, similar to Python.
database:
user: admin
password: secret
tables:
- users
- orders
- products
Creating a YAML file is simple! Here’s a quick guide to help you write your own YAML file from
scratch.
Here’s a simple step-by-step guide to create an Amazon RDS instance using the AWS Management
Console:
| Service | Description |
| -------------------- | ---------------------------------------------------------- |
| **Azure Repos** | Git repositories for source code management |
| **Azure Pipelines** | Build, test, and deploy automation (CI/CD) |
| **Azure Boards** | Work tracking with Kanban boards, backlogs, and dashboards |
| **Azure Test Plans** | Manual and exploratory testing tools |
| **Azure Artifacts** | Package management for Maven, npm, NuGet, etc. |
Would you like a walkthrough on setting up a simple pipeline or using Azure Boards for project
tracking?
Here’s a simple step-by-step guide on how to get started with Azure DevOps and use its core
features like creating a project, setting up a repo, and creating a CI/CD pipeline.
Kubernetes (often called K8s) is an open-source platform for automating the deployment, scaling,
and management of containerized applications.
What is Kubernetes?
It helps you run and manage containers (like Docker containers) at scale.
Handles tasks like load balancing, scaling, rolling updates, and self-healing (restarting
failed containers).
Works across clusters of machines — whether on-premises or in the cloud.
Key Concepts:
Concept Description
Pod Smallest deployable unit, one or more containers
Node A physical or virtual machine that runs pods
Cluster Group of nodes managed by Kubernetes
Service Defines networking and load balancing for pods
Deployment Manages desired state and updates for pods
Creating a Kubernetes cluster can be done in multiple ways depending on your environment (local,
cloud, or on-premises). Here's a simple guide to get you started with a basic Kubernetes cluster:
Option 2: Create Kubernetes Cluster on Cloud (e.g., AWS EKS, Azure AKS, Google GKE)
Each cloud provider offers managed Kubernetes services:
AWS EKS (Elastic Kubernetes Service): Managed K8s on AWS
Azure AKS (Azure Kubernetes Service): Managed K8s on Azure
Google GKE (Google Kubernetes Engine): Managed K8s on GCP
What is Terraform?
Terraform is an open-source Infrastructure as Code (IaC) tool created by HashiCorp.
It lets you define, provision, and manage cloud infrastructure using simple, declarative
configuration files.
Supports many cloud providers like AWS, Azure, Google Cloud, and others, plus on-prem
systems.
Key Features:
Feature Description
Infrastructure as Code Write infrastructure in human-readable config files (.tf files)
Plan and Apply Preview changes before applying them to your infrastructure
Multi-Cloud Support Manage resources across different cloud providers
State Management Keeps track of current infrastructure state to apply updates safely
Simple Example:
Write a Lambda function in Python that returns "Hello, World!":
python
CopyEdit
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': 'Hello, World!'
}
Here’s a simple step-by-step guide to create an AWS Lambda function using the AWS
Management Console:
What is a VPC?
It’s a virtual network dedicated to your AWS account.
Allows you to launch AWS resources (like EC2 instances) in a logically isolated section of
the AWS cloud.
You control the network settings — IP addresses, subnets, route tables, gateways, and
security.
Key Features:
Feature Description
Isolation Network isolation from other AWS users
Subnets Divide your VPC into smaller networks (public/private)
Routing Control how traffic flows within and outside your VPC
Security Use security groups and network ACLs to control access
Great! Let’s start with creating a VPC from scratch using the AWS Management Console. Here’s a
simple step-by-step guide:
Types of Subnets:
Subnet Type Description
Public Subnet Resources have direct access to the internet (via Internet Gateway)
Resources are isolated from the internet, often accessed through NAT Gateway or
Private Subnet
VPN
Example:
You launch web servers in a public subnet so they can be accessed from the internet.
You launch databases in a private subnet for security, preventing direct internet access.
Security Group is like a virtual firewall for your AWS resources (such as EC2 instances).
What is a Security Group?
Controls inbound and outbound traffic to your resources.
Works at the instance level, filtering traffic based on rules you define.
Stateful — if you allow inbound traffic on a port, the response traffic is automatically
allowed.
Key Points:
Aspect Description
Inbound Rules Define what incoming traffic is allowed
Outbound Rules Define what outgoing traffic is allowed
Rule Types By protocol (TCP, UDP), port range, source/destination IP or security group
Default Behavior Denies all inbound traffic, allows all outbound traffic
Example Use:
Allow SSH (port 22) access only from your IP address
Allow HTTP (port 80) traffic from anywhere
Block all other traffic for security
Your security group is now ready and protecting your resources based on the rules you defined!
An instance in cloud computing usually refers to a virtual server running in a cloud environment.
What is an Instance?
It’s a virtual machine created from a template (an image) that runs applications or services.
In AWS, an instance typically means an EC2 instance (Elastic Compute Cloud) — a virtual
server you can use to run software, websites, databases, etc.