Technical Essentials - AWS Compute Flashcards
At a fundamental level, what are the three types of compute options are available?
virtual machines (VMs), container services, and serverless
A ____ is software or firmware that makes it possible to share physical hardware resources across one or more virtual machines. It provisions the resources to create and run your VMs.
hypervisor
In AWS, ____ is a web service that provides secure and resizable compute capacity in the cloud. You can provision virtual servers called EC2 instances.
Amazon Elastic Compute Cloud (Amazon EC2)
____ is a web service that provides secure, resizable compute capacity in the cloud. With this service, you can provision virtual servers called EC2 instances.
Amazon EC2
With ____, you can do the following:
Provision and launch one or more EC2 instances in minutes.
Stop or shut down EC2 instances when you finish running a workload.
Pay by the hour or second for each instance type (minimum of 60 seconds).
Amazon EC2
To create an EC2 instance, you must define the following:
Hardware specifications: CPU, memory, network, and storage Logical configurations: Networking location, firewall rules, authentication, and the operating system of your choice
When launching an EC2 instance, the first setting you configure is which operating system you want by selecting an ____.
Amazon Machine Image (AMI)
T/F: An AMI includes the operating system, storage mapping, architecture type, launch permissions, and any additional preinstalled software applications.
True
EC2 instances are live instantiations (or versions) of what is defined in an ____, as a cake is a live instantiation of a cake recipe.
AMI
When you launch a new instance, AWS allocates a virtual machine that runs on a hypervisor. Then the AMI that you selected is copied to the ____, which contains the image that is used to boot the volume.
root device volume
One advantage of using AMIs is that they are ____.
reusable
There are multiple ways to create AMI’s. Match the description with the method.
Quick Start AMIs, AWS Marketplace AMIs, My AMIs, Community AMIs, Custom Image
1) commonly used AMIs created by AWS that you can select to get started quickly.
2) created from your EC2 instances
3) build your own custom image with EC2 Image Builder
4) provide popular open-source and commercial software from third-party vendors
5) provided by the AWS user community
1) Quick Start AMIs
2) My AMIs
3) Custom image
4) AWS Marketplace AMIs
5) Community AMIs
Each AMI in the AWS Management Console has an AMI ID, which is prefixed by ami-, followed by a random hash of numbers and letters. The IDs are unique to each AWS ____.
Region
Which EC2 instance family is described:
Provides a balance of compute, memory, and networking resources, and can be used for a variety of workloads.
Use Case: Ideal for applications that use these resources in equal proportions, such as web servers and code repositories.
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
General purpose
Which EC2 instance family is described:
Ideal for compute-bound applications that benefit from high-performance processors.
Use Case: Well-suited for batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines, machine learning inference, and other compute intensive applications
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
Compute optimized
Which EC2 instance family is described:
Designed to deliver fast performance for workloads that process large datasets in memory.
Use Case: Memory-intensive applications, such as high-performance databases, distributed web-scale in-memory caches, mid-size in-memory databases, real-time big-data analytics, and other enterprise applications
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
Memory optimized
Which EC2 instance family is described:
Use hardware accelerators or co-processors to perform functions such as floating-point number calculations, graphics processing, or data pattern matching more efficiently than is possible in software running on CPUs.
Use Case: Machine learning, HPC, computational fluid dynamics, computational finance, seismic analysis, speech recognition, autonomous vehicles, and drug discovery
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
Accelerated computing
Which EC2 instance family is described:
Designed for workloads that require high sequential read and write access to large datasets on local storage. They are optimized to deliver tens of thousands of low-latency random I/O operations per second (IOPS) to applications that replicate their data across different instances.
Use Case: NoSQL databases (Cassandra, MongoDB and Redis), in-memory databases, scale-out transactional databases, data warehousing, Elasticsearch, and analytics
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
Storage optimized
Which EC2 instance family is described:
Purpose built to offer the best price performance for running HPC workloads at scale on AWS.
Use Case: Ideal for applications that benefit from high-performance processors, such as large, complex simulations and deep learning workloads
a) memory optimized
b) HPC optimized
c) General purpose
d) Compute optimized
e) Storage optimized
f) Accelerated computing
HPC optimized
Unless otherwise specified, when you launch EC2 instances, they are placed in a ____ virtual private cloud (VPC)
default
The ____ VPC is suitable for getting started quickly and launching public EC2 instances without having to create and configure your own VPC.
default
T/F: Any resource that you put inside the default VPC will be public and accessible by the internet, so you shouldn’t place any customer data or private information in it.
True
AWS services that are scoped at the Availability Zone level must be architected with high ____ in mind.
availability
When architecting any application for high availability, consider using at least two EC2 instances in two separate ____.
Availability Zones
An EC2 instance transitions between states from the moment you create it until its termination.
Pending Instance State:
When you launch an instance, it enters the pending state.
When an instance is pending, billing has not started.
At this stage, the instance is preparing to enter the running state.
Pending is where AWS performs all actions needed to set up an instance, such as copying the AMI content to the root device and allocating the necessary networking components.
Running Instance State:
When your instance is running, it’s ready to use.
This is also the stage where billing begins.
As soon as an instance is running, you can take other actions on the instance, such as reboot, terminate, stop, and stop-hibernate.
Rebooting Instance State:
When you reboot an instance, it’s different than performing a stop action and then a start action.
Rebooting an instance is equivalent to rebooting an operating system.
The instance keeps its public DNS name (IPv4) and private and public IPv4 addresses. An IPv6 address (if applicable) remains on the same host computer and maintains its public and private IP address, in addition to any data on its instance store volumes.
Stopping/Stopped Instance State:
When you stop your instance, it enters the stopping and then stopped state.
This is similar to when you shut down your laptop.
You can stop and start an instance if it has an Amazon Elastic Block Store (Amazon EBS) volume as its root device.
When you stop and start an instance, your instance can be placed on a new underlying physical server.
Your instance retains its private IPv4 addresses and if your instance has an IPv6 address, it retains its IPv6 address.
When you put the instance into stop-hibernate, the instance enters the stopped state, but saves the last information or content into memory, so that the start process is faster.
Terminated Instance State:
When you terminate an instance, the instance stores are erased, and you lose both the public IP address and private IP address of the machine.
Termination of an instance means that you can no longer access the machine.
As soon as the status of an instance changes to shutting down or terminated, you stop incurring charges for that instance.
Difference between stop and stop-hibernate:
When you stop an instance, it enters the stopping state until it reaches the stopped state. AWS does not charge usage or data transfer fees for your instance after you stop it. But storage for any Amazon EBS volumes is still charged. While your instance is in the stopped state, you can modify some attributes, like the instance type. When you stop your instance, the data from the instance memory (RAM) is lost.
When you stop-hibernate an instance, Amazon EC2 signals the operating system to perform hibernation (suspend-to-disk), which saves the contents from the instance memory (RAM) to the EBS root volume. You can hibernate an instance only if hibernation is turned on and the instance meets the hibernation prerequisites.
EC2 Pricing:
With ____ Instances, you pay for compute capacity per hour or per second, depending on which instances that you run. There are no long-term commitments or upfront payments required. Billing begins whenever the instance is running, and billing stops when the instance is in a stopped or terminated state. You can increase or decrease your compute capacity to meet the demands of your application and only pay the specified hourly rates for the instance that you use.
On-Demand
The following use cases are ideal for which EC2 pricing option?
- Users who prefer the low cost and flexibility of Amazon EC2 without upfront payment or long-term commitments
- Applications with short-term, spiky, or unpredictable workloads that cannot be interrupted
- Applications being developed or tested on Amazon EC2 for the first time
a) Savings Plans
b) Dedicated Hosts
c) On-Demand
d) Spot
e) Reserved
On-Demand
EC2 Pricing:
For applications that have flexible start and end times, Amazon EC2 offers the ____ Instances option. You can request spare Amazon EC2 computing capacity for up to 90 percent off the On-Demand price.
Spot
The following use cases are ideal for which EC2 pricing option?
- Applications that have flexible start and end times
- Applications that are only feasible at very low compute prices
- Users with fault-tolerant or stateless workloads
a) Savings Plans
b) Dedicated Hosts
c) On-Demand
d) Spot
e) Reserved
Spot
With Spot Instances, you set a limit on how much you want to pay for the instance hour. This is compared against the current Spot price that AWS determines. Spot Instance prices adjust gradually based on long-term trends in supply and demand for Spot Instance capacity. If the amount that you pay is more than the current Spot price and there is capacity, you will receive an instance.
EC2 Pricing:
____ are a flexible pricing model that offers low usage prices for a 1-year or 3-year term commitment to a consistent amount of usage.
Savings Plans
T/F: Savings Plans apply to Amazon EC2, AWS Lambda, and AWS Fargate usage.
True
For workloads that have predictable and consistent usage, ____ can provide significant savings compared to On-Demand Instances.
Savings Plans
The following use cases are ideal for which EC2 pricing option?
- Workloads with a consistent and steady-state usage
- Customers who want to use different instance types and compute solutions across different locations
- Customers who can make monetary commitment to use Amazon EC2 over a 1-year or 3-year term
a) Savings Plans
b) Dedicated Hosts
c) On-Demand
d) Spot
e) Reserved
Savings Plans
For applications with steady state usage that might require reserved capacity, Amazon EC2 offers the ____ Instances option. With this option, you save up to 72 percent compared to On-Demand Instance pricing. You can choose between three payment options: All Upfront, Partial Upfront, or No Upfront. You can select either a 1-year or 3-year term for each of these options.
Reserved
Identify the type of EC2 Reserved Instance described:
These provide the most significant discount (up to 72 percent off On-Demand pricing) and are best suited for steady-state usage.
a) Standard Reserved Instances
b) Convertible Reserved Instances
c) Scheduled Reserved Instances
Standard
Identify the type of EC2 Reserved Instance described:
These provide a discount (up to 54 percent off On-Demand pricing) and the capability to change the attributes of the Reserved Instance if the exchange results in the creation of Reserved Instances of equal or greater value. Best suited for steady-state usage.
a) Standard Reserved Instances
b) Convertible Reserved Instances
c) Scheduled Reserved Instances
Convertible
Identify the type of EC2 Reserved Instance described:
These are available to launch within the time windows that you reserve. With this option, you can match your capacity reservation to a predictable recurring schedule that only requires a fraction of a day, a week, or a month.
a) Standard Reserved Instances
b) Convertible Reserved Instances
c) Scheduled Reserved Instances
Scheduled
EC2 Pricing:
A ____ is a physical Amazon EC2 server that is dedicated for your use. This type can help you reduce costs because you can use your existing server-bound software licenses, such as Windows Server, SQL Server, and Oracle licenses. And they can also help you meet compliance requirements.
Dedicated Host
Amazon EC2 Dedicated Host is integrated with AWS ____, a service that helps you manage your software licenses, including Microsoft Windows Server and Microsoft SQL Server licenses.
License Manager
Dedicated Hosts can be purchased as a ____ for up to 70 percent off the On-Demand price.
Reservation
T/F: Dedicated Hosts can be purchased on demand (hourly).
True
A ____ is a standardized unit that packages your code and its dependencies. This package is designed to run reliably on any platform, because the container creates its own independent environment.
container
Difference between VMs and containers:
____ share the same operating system and kernel as the host that they exist on.
Containers
Difference between VMs and containers:
____ contain their own operating system. Each must maintain a copy of an operating system, which results in a degree of wasted resources.
Virtual machines
Difference between VMs and containers:
____ can provide speed, but ____ offer the full strength of an operating system and more resources, like package installation, dedicated kernel, and more.
Containers
virtual machines
T/F: Most companies and organizations run many containers on many EC2 instances across several Availability Zones.
True
AWS offers what two container orchestration services?
Amazon Elastic Container Service (Amazon ECS)
Amazon Elastic Kubernetes Service (Amazon EKS)
____ is an end-to-end container orchestration service that helps you spin up new containers. Your containers are defined in a task definition that you use to run an individual task or a task within a service.
Amazon ECS
Managing containers with Amazon ECS
What are the two methods you can use to run your ECS tasks and services?
AWS Fargate - serverless infrastructure
cluster of EC2 instances that you manage
Managing containers with Amazon ECS
If you choose to have more control by running and managing your containers on a cluster of Amazon EC2 instances, you will also need to install the Amazon ECS ____ on your EC2 instances.
container agent
An EC2 instance with the container agent installed is often called a ____.
This container agent is open source and responsible for communicating to the Amazon ECS service about cluster management details.
container instance
Identify the ECS core construct described below:
Logical grouping of services, tasks, capacity providers in a region.
a) Cluster
b) Service
c) Task
d) Compute
Cluster
Identify the ECS core construct described below:
One or more identical tasks. Check and replace unhealthy tasks.
a) Cluster
b) Service
c) Task
d) Compute
Service
Identify the ECS core construct described below:
One or more containers. Specify compute, networking, IAM, config.
a) Cluster
b) Service
c) Task
d) Compute
Task
Identify the ECS core construct described below:
Use EC2, EC2 Spot, Fargate, or Fargate Spot
a) Cluster
b) Service
c) Task
d) Compute
Compute
To prepare your application to run on Amazon ECS, you create a task ____.
definition
The ____ is a text file, in JSON format, that describes one or more containers. It is similar to a blueprint that describes the resources that you need to run a container, such as CPU, memory, ports, images, storage, and networking information.
task definition
____ is a portable, extensible, open-source platform for managing containerized workloads and services.
Kubernetes
____ is a managed service that you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes.
Amazon EKS
Difference between Amazon ECS and EKS:
Amazon ECS runs on AWS native technology. Amazon EKS runs on Kubernetes.
Difference between Amazon ECS and EKS:
An ECS container is called a ____.
An EKS container is called a ____.
task
pod
Difference between Amazon ECS and EKS:
In Amazon ECS, the machine that runs the containers is an EC2 instance that has an ECS agent installed and configured to run and manage your containers. This instance is called a ____.
In Amazon EKS, the machine that runs the containers is called a ____ node or ____ node.
container instance
worker / Kubernetes
If you have containers running on Kubernetes and want an advanced orchestration solution that can provide simplicity, high availability, and fine-grained control over your infrastructure, ____ could be the tool for you.
Amazon EKS
Every definition of serverless computing mentions the following four aspects:
There are no servers to provision or manage.
It scales with usage.
You never pay for idle resources.
Availability and fault tolerance are built in.
Exploring serverless containers with AWS Fargate
AWS Fargate abstracts the EC2 instance so that you’re not required to manage the underlying compute infrastructure.
____ is a purpose-built serverless compute engine for containers. It scales and manages the infrastructure.
AWS Fargate
T/F: Fargate supports both Amazon ECS and Amazon EKS architecture and provides workload isolation and improved security by design.
True
If you want to deploy your workloads and applications without having to manage any EC2 instances or containers, you can use ____.
Lambda
With ____, you can run code without provisioning or managing servers. You can run code for virtually any type of application or backend service. This includes data processing, real-time stream processing, machine learning, WebSockets, IoT backends, mobile backends, and web applications.
Lambda
A ____ is a resource that you can invoke to run your code in Lambda.
function
____ describe when a Lambda function should run.
A ____ integrates your Lambda function with other AWS services and event source mappings.
So you can run your Lambda function in response to certain API calls or by reading items from a stream or queue.
This increases your ability to respond to events in your console without having to perform manual actions.
Triggers
trigger
An ____ is a JSON-formatted document that contains data for a Lambda function to process.
The runtime converts the event to an object and passes it to your function code.
When you invoke a function, you determine the structure and contents of the event.
event
An ____ provides a secure and isolated runtime environment for your Lambda function.
It manages the processes and resources that are required to run the function.
application environment
You deploy your Lambda function code using a deployment package.
Lambda supports two types of deployment packages:
____ – This contains your function code and its dependencies. Lambda provides the operating system and runtime for your function.
____ – This is compatible with the Open Container Initiative (OCI) specification. You add your function code and dependencies to the image. You must also include the operating system and a Lambda runtime.
A .zip file archive
A container image
The runtime provides a language-specific environment that runs in an application environment.
When you create your Lambda function, you specify the ____ that you want your code to run in.
You can use built-in runtimes, such as Python, Node.js, Ruby, Go, Java, or .NET Core.
Or you can implement your Lambda functions to run on a custom runtime.
The AWS Lambda ____ is the method in your function code that processes events.
When your function is invoked, Lambda runs the handler method.
When the handler exits or returns a response, it becomes available to handle another event.
function handler
With AWS Lambda, you are charged for the number of times that your code is ____ (requests) and for the ____ that your code runs, rounded up to the nearest 1 millisecond (ms) of duration.
invoked
time
AWS rounds up duration to the nearest ms with no minimum run time.
With this pricing, it can be cost effective to run functions whose execution time is very low, such as functions with durations under ____ ms or low latency APIs.
100
Use Case: Consider a scenario where you are a developer who is tasked with creating a new feature for a web application being hosted on EC2. The web application is an online store. And right now, all the items being sold in the store are loaded into a database manually behind the scenes. By manually, I mean there is a person who adds a new row to a database for each new item to be sold in the store. This process takes a long time, isn’t very scalable, and is prone to error. You are tasked with automating the process of getting the new item information loaded into the inventory database. The goal is to have a person upload an inventory spreadsheet into Amazon S3, the object storage service, then have a process automatically load the data into the inventory database. New inventory gets updated once a quarter. What compute would you use to host the processing logic to load the items from the file into the database?
AWS Lambda is the correct answer for this one. There are a few reasons. First of all, to address your concern on cost, AWS Lambda only charges you for the compute you consume when the code is actually running. And code is only run in response to triggers or a direct invitation. So here’s my suggestion. You know that the goal is to have someone upload an inventory document to S3, which should kick off the process of updating the database. You also learned that AWS Lambda has triggers that run your Lambda functions code. AWS Lambda integrates with many AWS services to act as triggers, and Amazon S3 is one of them. So my suggestion would be to create an AWS Lambda function; configure a PutEvent as the trigger from Amazon S3; then when the inventory is uploaded, Amazon S3 will trigger the Lambda function to run and the code in the function will parse the inventory document and add each item to the database.
Use Case: Let’s say you have an application currently hosted in your on-premises data center, which needs to be migrated to AWS. It’s currently running on Linux servers in the data center, and you want to minimize the amount of refactoring needed to migrate to AWS. It’s important that this workload is elastic and can support varying demand. What compute option would you choose?
Considering the fact that minimizing refactoring is an important aspect of this workload, I would architect a solution using Amazon EC2 as the compute service. EC2 instances can be launched from Linux-based AMIs, and the application could be hosted on the EC2 instance the same way it would be hosted on a Linux server on premises. Amazon EC2 also has the ability to scale in or out based on demand, so I think EC2 is the best service for this one.
So AWS Lambda could work, but you can’t just upload the same code you would run on Amazon EC2 into a Lambda function. There would have to be a decent amount of refactoring in order to take advantage of that service. Same idea with any of the AWS container services, like ECS or EKS. Again, you’d have some amount of rework required to migrate to containers. Therefore, Amazon EC2 is the best option for this migration.
Use Case: Imagine a scenario where you are planning to write a brand-new application using a microservices or service-oriented design. And you want to architect the application where it can scale up or down quickly, and you want to lower the risk of deploying new changes to production. Which AWS compute service would you use?
The answer is either ECS or EKS for this one because using containers makes it easier to support microservice or service-oriented designs. Containers boot up quickly, so scaling is quicker than EC2 instances, and the use of containers helps with code portability. Meaning, if I write the code on my laptop and run it in a container, test it in QA in a container, I can then expect the same container to behave the same way once deployed to production, thus reducing the risk of deployments causing errors because of environmental issues.