Repository for the "Lab Project: Managing EC2 Instances on AWS" - DIO.
Part of the Bootcamp "TQI - Modernization with GenAI"
The ultimate toolkit for building modern applications, providing everything from servers to databases and AI Services.
The world's most comprehensive and widely adopted cloud platform, offering over 200 services.
The foundational infrastructure of AWS provides the platform's incredible scale, resilience, and reliability
Widespread network of data centers divided into Regions and Availability Zones.
Regions:
- A large, separated geographic area. Each region is completely isolated from the others.
- The highest level of geographic separation and disaster recovery.
- Every Region consists of at least 3 Availability Zones
- You choose a Region based on latency, legal/compliance requirements, and cost.
Availability Zones (AZ):
- One or more data centers within a Region
- Physically separated by a meaningful distance (miles). Have independent power, cooling, and networking.
- Enables High Availability and Fault Tolerance, by deploying applications across multiple AZs
Among the various services provided by AWS EC2, EBS, S3 and Lambda appear as building blocks of almost every application built on AWS.
EC2: Elastic Compute Cloud
- The Virtual Server (CPU, RAM).
- Provides secure, resizable virtual machines (VMs) in the cloud.
- The user has full control over the OS
- Payment based on uptime
EBS: Elastic Block Store
- The Persistent Hard Drive
- Provides block-level storage volumes, attached to a single EC2 instance
- Designed for system volumes, application files, and databases
- Persistent by default. They continue to exist even if the attached EC2 instance is terminated.
S3: Simple Storage Service
- The unlimited Storage Locker
- Provides Object Storage built to store and retrieve any amount of data from anywhere over the internet
EBS is for a single server. S3 is for shared, concurrent access from thousands of resources. Virtually unlimited, network-based scalability.
Lambda: AWS Lambda
- The Serverless Code Runner
- Serverless compute service that lets the user run code in response to events
- Payment based on the execution time
1. EC2/EBS
- A User initiates a request, which is sent over the HTTP protocol.
- The HTTP request is received by an EC2 (Elastic Compute Cloud) instance, which is configured to act as the Web Server.
- The EC2 instance is responsible for running the operating system and the server software needed to handle the user's request.
- To access the website's files (such as HTML, images, and scripts), the EC2 instance connects to an EBS (Elastic Block Store) volume.
Both the EC2 and EBS components are contained within the AWS cloud environment. The EBS volume provides persistent, block-level storage, ensuring the Website files remain available even if the EC2 instance is stopped or restarted.
2. S3/Lambda
- The User uploads files directly to an S3 Bucket through a web or mobile app
- The successful upload of a file to the S3 Bucket triggers a Lambda function.
- The Lambda function processes the uploaded file and writes the file's metadata to the Database
AMI is a template that contains the OS, application server, and applications needed to launch an instance. Used to quickly launch pre-configured EC2 instances, ensuring consistency
- Created from a running or stopped instance
- Public (shared by AWS/others) or Private
To launch an EC2 instance, initially choose the AMI. The AMI provides the information needed to launch an instance, such as volume and permissions. There are different types of AMIs, such as AWS Linux, Ubuntu, Windows, and others. Choose it based on the application and system requirements.
Instance Type: Defines the hardware resources (CPU, RAM, Network), choose it based on the application's workload and budget, e.g., t2.micro (burstable, low-cost), m5.large (fixed performance, balanced resources)
Security Essential
- Public/Private Key Pair. The private key is held by the user and required to securely connect to the instance, via SSH for Linux or to decrypt the Administrator password for Windows.
- DIO
- The instructor Alexsandro Lechner

