Aws Academy 6-10 Modules Notes
Aws Academy 6-10 Modules Notes
COMPUTE
Topics
. Amazon EC2
. Container services
1.Compute Services
2.AMAZON EC2
Nine Steps to consider while creating EC2 Instance
Part 3
3.EC2 Cost Optimization
1. On-Demand Instances
Description: Pay for compute capacity by the hour or second (minimum of 1 minute) with no
long-term commitments.
Use Case: Ideal for short-term workloads, unpredictable traffic, or applications being developed
or tested.
Description: Commit to using EC2 instances for 1 or 3 years in exchange for significant discounts
(up to 75%) compared to On-Demand prices.
Types:
o Convertible Reserved Instances: Flexible; allows exchanging for different instance types
or sizes.
Use Case: Best for steady-state or predictable usage (e.g., always-on databases).
3. Savings Plans
Description: A flexible pricing model offering lower rates on EC2 and Fargate usage in exchange
for a commitment to a consistent amount of usage (measured in $/hour) for 1 or 3 years.
Use Case: Good for consistent workloads across different instance families, regions, or AWS
services.
4. Spot Instances
Description: Utilize unused EC2 capacity at discounts of up to 90% off On-Demand prices. Prices
fluctuate based on supply and demand.
Use Case: Suitable for fault-tolerant and flexible workloads like batch jobs, big data analysis, or
CI/CD pipelines.
5. Dedicated Hosts
Description: Physical servers fully dedicated to your use. You pay for the entire host.
Use Case: Ideal for regulatory compliance or licensing that requires physical hardware
separation.
6. Dedicated Instances
Description: Instances that run on hardware dedicated to a single customer but priced based on
instance usage, not the host.
What is a Container?
A container is a lightweight, portable, and self-contained unit that includes an application and all its
dependencies (libraries, binaries, and configuration files) packaged together. Containers run consistently
across different environments, whether it’s a developer’s local machine, a test environment, or a
production server.
Key Features:
o Isolation: Containers isolate the application and its dependencies from the host system
and other containers.
o Lightweight: Containers share the host OS kernel, making them faster to start and less
resource-intensive than virtual machines (VMs).
o Portability: They work the same way across different systems (e.g., development,
testing, production).
o All containers share the same EC2 instance guest OS (operating system).
o Each container is isolated and contains its own application (e.g., App 1, App 2, App 3)
along with its required binaries and libraries (Bins/Libs).
o The Docker engine (or another container runtime) runs on the EC2 instance and
manages container creation, execution, and resource allocation.
o Advantages:
Efficient resource utilization since multiple containers can run on a single EC2
instance without requiring a separate OS for each application.
o Each VM has its own copy of the guest OS, along with its binaries, libraries, and the
application.
o The hypervisor manages the virtualization layer, enabling multiple VMs to run on the
same physical server.
o Disadvantages:
VMs are heavier than containers because each VM includes a full operating
system.
Imagine you’re running a restaurant. Here's how Docker, ECS, Kubernetes, and Fargate fit into the
picture:
1. Docker:
o It’s like the kitchen staff who prepare and package the food.
o It’s responsible for creating and running containers (small, lightweight packages that
include everything needed to run your application, like the ingredients and recipe for a
dish).
o ECS is like a restaurant manager who tells the kitchen staff (Docker) which dishes to
prepare, when, and how many.
o It’s a container orchestration tool that manages the deployment and scaling of
containers. It works specifically with AWS infrastructure.
3. Kubernetes:
o It’s a container orchestration tool like ECS but works across multiple environments
(AWS, Google Cloud, on-premises). It’s more complex but more powerful for large,
distributed systems.
4. AWS Fargate:
o Fargate is like a delivery service that takes care of the kitchen (containers) and delivery
(infrastructure) without you worrying about hiring delivery drivers (servers).
o It’s serverless—you don’t manage the underlying infrastructure for running your
containers.
1. Docker:
Key feature: It’s lightweight and portable. You can run a container on your laptop, in AWS, or
anywhere.
Example: You create a container with your app and all its dependencies. Think of it as a "ready-
to-eat meal in a box."
2. Amazon ECS:
What it does: Manages the deployment of your Docker containers on AWS infrastructure.
Key feature: It’s AWS-native and works well with other AWS services like IAM, CloudWatch, and
ELB.
Example: ECS decides how many containers to run (scaling) and which EC2 instances (servers) to
run them on. Think of it as a manager assigning jobs to staff in your restaurant.
3. Kubernetes:
What it does: Like ECS, it manages and orchestrates containers, but it’s more flexible and not
tied to AWS.
Key feature: Works across multiple cloud providers and even on-premises systems.
Example: If your business operates across multiple locations (AWS, Google Cloud, or even on
your own servers), Kubernetes ensures consistency across all locations. It handles scaling, load
balancing, and failover.
4. AWS Fargate:
What it does: Runs your Docker containers without you managing the servers.
Key feature: Serverless—AWS takes care of the infrastructure, so you only focus on the
containers.
Example: Instead of buying and managing delivery trucks (servers), you just tell AWS how many
containers to run, and Fargate handles the rest.
1. Docker:
2. Amazon ECS:
o Use when you’re all-in on AWS and want an easy way to manage and scale your
containers.
3. Kubernetes:
o Use when you need advanced orchestration across multiple clouds or hybrid
environments.
o Example: Managing a global app that needs to run on AWS, Google Cloud, and on-
premises servers.
4. AWS Fargate:
o Use when you don’t want to manage servers at all and prefer a serverless container
solution.
Fargate: The delivery service (runs containers without worrying about servers).
Amazon Elastic Container Registry (ECR) is a fully managed container image registry provided by AWS. It
simplifies the process of storing, managing, and deploying Docker container images. Think of it as a
private storage service specifically designed for your container images.
When you work with containers, you need a place to store the container images (the "blueprints" of your
containers). ECR acts as this storage, ensuring your images are:
1. Securely Stored: All images are encrypted at rest and during transit.
2. Easily Accessible: Fully integrated with AWS services like ECS, EKS, and Fargate.
3. Highly Available: Images are stored in a highly available and scalable environment.
5.AWS Lambda
6.AWS Elastic Beanstalk