Adding Compute With Ec2
Adding Compute with Amazon EC2
Section titled “Adding Compute with Amazon EC2”AWS Runtime Compute Choices
Section titled “AWS Runtime Compute Choices”AWS offers different compute services to meet the needs of different use cases:
- Virtual Machines (VMs): Amazon Elastic Compute Cloud (Amazon EC2)
- Containers:
- Amazon Elastic Container Service (Amazon ECS)
- Amazon Elastic Kubernetes Service (Amazon EKS)
- Virtual Private Servers (VPS): Amazon Lightsail
- Platform as a Service (PaaS): AWS Elastic Beanstalk
- Serverless:
- AWS Lambda
- AWS Fargate
Focus This module focuses on the Amazon EC2 service.
Compute Service Category Differentiators
Section titled “Compute Service Category Differentiators”Each service category offers different levels of infrastructure control and application deployment speed:
- VMs, containers, and VPS: Provide more control over your infrastructure and enable higher degrees of customization
- PaaS and serverless services: Enable you to focus more on your application and less on infrastructure, enabling quick deployment
Amazon EC2 Overview
Section titled “Amazon EC2 Overview”Amazon EC2:
- Provides VMs (servers) in the cloud
- Provisions servers in minutes
- Can automatically scale capacity up or down as needed
- Enables you to pay only for the capacity that you use
Amazon EC2 provides VMs in the cloud and supports a variety of operating systems including Microsoft Windows and many variants of Linux. The service also provides Mac instances, which natively support the macOS operating system.
Amazon EC2 Virtualization
Section titled “Amazon EC2 Virtualization”An EC2 instance is a VM that runs on a physical host:
- EC2 instances run as virtual machines on host computers located in AWS Availability Zones
- Each VM runs an operating system (OS), such as Amazon Linux or Microsoft Windows
- VMs run on top of a hypervisor layer maintained by AWS
- The hypervisor provides an EC2 instance with access to the actual physical hardware resources
Storage Options:
Section titled “Storage Options:”- Instance store: Temporary block-level storage (ephemeral storage) physically attached to the host computer
- Amazon EBS: Persistent block storage volumes that persist independently of the instance life
Network Connectivity:
Section titled “Network Connectivity:”EC2 instances can have network connectivity to other resources, such as other EC2 instances, AWS services, and the internet. Different instance types provide different levels of network performance.
Amazon EC2 Use Cases
Section titled “Amazon EC2 Use Cases”Use Amazon EC2 when you need:
- Complete control of your computing resources: Including operating system and processor type
- Options for optimizing your compute costs:
- On-Demand Instances, Reserved Instances, and Spot Instances
- Savings Plans
- Ability to run any type of workload:
- Simple websites
- Enterprise applications
- Generative artificial intelligence (generative AI) applications
Steps for Provisioning an EC2 Instance
Section titled “Steps for Provisioning an EC2 Instance”- Amazon Machine Image (AMI): Template that Amazon EC2 uses to launch an instance
- Instance type: Select from a range of instance types optimized for different use cases
- Key pair: Security credentials for SSH or RDP access (public key and private key)
- Network placement: Specify network placement within a VPC and addressing
- Security group: Set of firewall rules controlling traffic to and from the instance
- Storage options: Choose between instance store or EBS volume for root storage
- IAM role: If the instance makes API calls to AWS services, attach an IAM role via instance profile
- User data: Optional scripts for automating installations and configurations at launch
Amazon EC2 enables you to run VMs in the cloud and easily scale capacity up or down as needed. You can use an EC2 instance when you need complete control of your computing resources and want to run any type of workload. When launching an EC2 instance, you must choose an AMI and an instance type, along with specifying configuration parameters including network, security, storage, and user data settings.