- Amazon EC2 (Amazon Elastic Compute Cloud) – Provides secure, resizable compute capacity in cloud as Amazon EC2 instances.
How Amazon EC2 works – Launch , Connect and Use.
Amazon EC2 instance types
- General purpose instances – provides a balance of compute, memory and networking resources.
- Compute optimized instances – ideal for compute-bound applications that benefit from high performance processors.
- Memory optimized instances -designed to deliver fast performance for workloads that process large datasets in memory.
- Accelerated computing instances– Uses hardware accelerators or coprocessors to perform some functions more efficiently than possible with software running on CPU.
- Storage optimized instances – designed for workloads that require high sequential read and write access to large datasets on local storage.
Amazon EC2 Pricing
- On-demand Instances – are ideal for short term, irregular workloads that cannot be interrupted. Instances run continuously till you stop them and you only pay for what you use. Eg Instances for development and testing that have unpredictable usage patterns.
- Reserved Instances – Billing discount applied to on-demand instances. Can be purchased for 1-year or 3 year term. Two types ( Standard Reserved Instances and Convertible Reserved Instances)
- Standard Reserved Instances – Good fit if you know the instance type, size, platform, tenancy and region you want to run instance on.
- Convertible Reserved Instances – If you need to run your EC2 instances in different Availability Zones or different instance types, then Convertible Reserved Instances might be right for you.
- EC2 Instance Savings plan -AWS offers Savings plan on few AWS services including Amazon EC2. For 1- year or 3 year, offers up to 72% savings. Unlike Reserved Instances you do not need to specify upfront EC2 type, size and tenancy to get a discount.
- Spot Instances – They are ideal for workload with flexible start and end times and can withstand interruptions. They can use unused EC2 capacity and offer up to 90% savings. Eg Background processing job for customer survey.
- Dedicated Hosts – are physical servers with Amazon EC2 instance capacity that is fully dedicated to your use. These are most expensive option. You can use per-socket, per-core, per-VM software licenses to help maintain license compliance.
Amazon EC2 Auto Scaling enables you to automatically add or remove Amazon EC2 instances in response to changing application demand. Within Amazon EC2 Auto Scaling, you can use two approaches: Dynamic scaling and Predictive scaling.
2. Amazon EC2 AutoScaling
- Dynamic Scaling: Responds to changing demand.
- Predictive Scaling: Automatically schedules the right number of Amazon EC2 instances based on predicted demand.
Auto Scaling Group
- When you create an Auto Scaling group, you can set the minimum number of Amazon EC2 instances.The minimum capacity is the number of Amazon EC2 instances that launch immediately after you have created the Auto Scaling group.
- You can set the desired capacity at two Amazon EC2 instances even though your application needs a minimum of a single Amazon EC2 instance to run.
- The third configuration that you can set in an Auto Scaling group is the maximum capacity. You might configure the Auto Scaling group to scale out in response to increased demand, but only to a maximum of four Amazon EC2 instances.
3. Elastic Load Balancing is the AWS service that automatically distributes incoming application traffic across multiple resources, such as Amazon EC2 instances.
4. Amazon Simple Notification Service (Amazon SNS) is a publish/subscribe service. Using Amazon SNS topics, a publisher publishes messages to subscribers. In Amazon SNS, subscribers can be web servers, email addresses, AWS Lambda functions, or several other options.
5. Amazon Simple Queue Service (Amazon SQS) is a message queuing service.
Using Amazon SQS, you can send, store, and receive messages between software components, without losing messages or requiring other services to be available. In Amazon SQS, an application sends messages into a queue. A user or service retrieves a message from the queue, processes it, and then deletes it from the queue.
6. AWS Lambda is a service that lets you run code without needing to provision or manage servers.
How AWS Lambda works:
- You upload your code to Lambda.
- You set your code to trigger from an event source, such as AWS services, mobile applications, or HTTP endpoints.
- Lambda runs your code only when triggered.
- You pay only for the compute time that you use.
7. Amazon Elastic Container Service (Amazon ECS) is a highly scalable, high-performance container management system that enables you to run and scale containerized applications on AWS. Amazon ECS supports Docker containers.
8. Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed service that you can use to run Kubernetes on AWS.
9. AWS Fargate is a serverless compute engine for containers. It works with both Amazon ECS and Amazon EKS. When using AWS Fargate, you do not need to provision or manage servers.