EC2 runs virtual servers called instances. Use Amazon Machine Images (AMIs) to launch their software, instance store for temporary local data, and automatic recovery to restore supported instances after an underlying host failure.
Instance types
An EC2 instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities. sets the CPU, memory, storage and networking of a virtual server. Types are grouped into categories by what they’re good at, so the first choice is the category that matches the workload.
How it works
- Identify the workload’s bottleneck: CPU, memory, local disk, or specialized math such as graphics.
- Pick the matching category, then the family and size inside it.
- Measure and resize as usage changes (right-sizing).
| Category | Strength | Example workloads |
|---|---|---|
| General purpose | Balanced compute, memory and network | Web servers, code repositories |
| Compute optimized | High-performance processors | Batch processing, media transcoding, gaming servers, ML inference |
| Memory optimized | Large data sets in memory | In-memory databases, real-time analytics |
| Storage optimized | High sequential I/O on local storageTemporary instance storage provided by disks physically attached to its host. | Data warehousing, large data sets on local disks |
| Accelerated computing | Hardware accelerators such as GPUs | Graphics, ML training, pattern matching |
| High-performance computing | Price performance for HPC at scale | Large simulations, deep learning |
Exam cues
- If the question says balanced or general web workload, think general purpose.
- If the question says CPU-bound processing, think compute optimized.
- If the question says large in-memory data sets, think memory optimized.
- If the question says high I/O on local storage, think storage optimized.
- If the question says GPUs or graphics, think accelerated computing.
Remember
- Six categories: general purpose, compute, memory, storage, accelerated computing, HPC.
Trap: “Storage optimized” is about fast local instance storage, not about the most EBS capacity. Large EBS volumes attach to any category.
Da documentação da AWS (17)
- An EC2 instance type determines the hardware of the host computer; each type offers different compute, memory and storage capabilities and belongs to an instance family grouped by those capabilities.
- General purpose instances balance compute, memory and networking, which suits applications that use them in equal proportions, such as web servers and code repositories.
- Compute optimized instances suit compute-intensive applications that benefit from high-performance processors, such as batch processing, media transcoding, high-performance web servers, scientific modeling, dedicated gaming servers and machine learning inference.
- Memory optimized instances deliver fast performance for workloads that process large data sets in memory.
- Storage optimized instances suit workloads that need high, sequential read and write access to very large data sets on local storage, delivering tens of thousands of low-latency random IOPS.
- Accelerated computing instances use hardware accelerators, or co-processors, for functions such as floating point calculations, graphics processing or data pattern matching more efficiently than CPUs.
- High-performance computing instances offer the best price performance for HPC workloads at scale, such as large, complex simulations and deep learning.
- Amazon EC2 provides scalable compute capacity in the AWS Cloud as virtual servers (instances) that you configure and manage, including the operating system.
- EC2 Mac instances run macOS on Apple hardware for building, testing and signing apps for Apple platforms such as iPhone, iPad and Mac; they run only on Dedicated Hosts with a 24-hour minimum allocation.
- On Linux, EC2 user data scripts run as root on the first boot by default; the instance can be configured to run them again on later restarts.
- Stopping, hibernating or terminating an instance erases its instance store data.
- Instance store suits temporary data such as caches, buffers and scratch files.
- To preserve instance store data beyond the instance lifetime, copy it to persistent storage such as EBS, S3 or EFS.
- Instance store is temporary block storage on disks physically attached to the host computer, suited to buffers, caches and scratch data.
- Instance store volumes have no additional charge; they are included in the instance usage cost.
- An Amazon Machine Image (AMI) supplies the software used to set up and boot an EC2 instance.
- An AMI must be compatible with the instance type selected for launch.
Purchasing options
Amazon EC2 charges the same instance in different ways depending on how much you commit and how much interruption you accept. Choosing well can cut compute costs sharply.
How it works
| Option | You commit to | Best for |
|---|---|---|
| On-Demand | Nothing; pay per second | Short, unpredictable or new workloads |
| Savings Plans | USD per hour of usage for 1 or 3 years | Steady usage that may change shape; up to 72% off |
| Reserved Instances | An instance configuration for 1 or 3 years | Steady usage of one configuration; up to 72% off |
| Spot Instances | Nothing, but instances can be interrupted | Fault-tolerant, flexible jobs; steepest discounts |
| Dedicated HostsThe physical computer on which an EC2 instance runs. | A physical server | Server-bound licenses, compliance |
| Dedicated Instances | Single-tenant hardware | Hardware isolation without host control |
| Capacity Reservations | Capacity in one AZAn isolated location within an AWS Region. | Guaranteed capacity |
- Start with On-Demand while usage is unknown.
- Cover steady usage with Savings Plans; AWS recommends them over Reserved Instances.
- Move fault-tolerant work to Spot. Notices are best effort; stop and termination notices give two minutes, while hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later. begins immediately.
- Use Dedicated Hosts when licenses are tied to sockets or cores.
Exam cues
- If the question says steady usage for one or three years, think Savings Plans or Reserved Instances.
- If the question says can be interrupted or flexible start times, think Spot.
- If the question says short-term, unpredictable, no commitment, think On-Demand.
- If the question says bring per-core licenses or physical server, think Dedicated Hosts.
- If the question says guaranteed capacity in a specific AZ, think Capacity Reservations (or zonal RIs).
Remember
- Savings Plans and RIs: 1 or 3 years, up to 72% off.
- Spot notices: best effort; two minutes for stop or termination, immediate hibernation.
- Savings Plans payment: All Upfront, Partial Upfront or No Upfront.
- On-Demand: per second, 60-second minimum.
- Spot: up to 90% off.
- EC2 Instance Savings Plans up to 72%; Compute Savings Plans up to 66%.
Trap: A Reserved Instance is a billing discount, not a server. It applies automatically to matching On-Demand usage.
Da documentação da AWS (22)
- EC2 purchasing options are On-Demand Instances, Savings Plans, Reserved Instances, Spot Instances, Dedicated Hosts, Dedicated Instances and Capacity Reservations.
- On-Demand Instances are paid by the second for the instances you launch, with no commitment.
- Savings Plans give lower prices in exchange for a commitment to a consistent amount of usage, in USD per hour, for 1 or 3 years.
- Savings Plans can save up to 72% on compute; Compute Savings Plans apply regardless of instance family, size, OS, tenancy or Region, and also to AWS Fargate and AWS Lambda.
- Reserved Instances lower costs in exchange for a commitment to a consistent instance configuration, including instance type and Region, for 1 or 3 years; they are a billing discount, not physical instances.
- AWS recommends Savings Plans over Reserved Instances; both offer up to 72% off On-Demand, but Savings Plans don't tie you to an instance configuration.
- Spot Instances use spare EC2 capacity at steep discounts and suit applications that are flexible about when they run and can be interrupted, such as batch jobs, data analysis and background processing.
- EC2 Spot interruption notices are best effort: stop and termination notices give two minutes of warning, while a hibernation notice arrives as hibernation begins.
- A Dedicated Host is a physical server fully dedicated to your instances, which lets you bring per-socket, per-core or per-VM software licenses.
- Dedicated Instances run on single-tenant hardware; they don't give the host-level visibility, placement control or per-core licensing of Dedicated Hosts.
- Capacity Reservations reserve capacity for EC2 instances in a specific Availability Zone.
- Savings Plans can be paid All Upfront, Partial Upfront or No Upfront.
- On-Demand Instances are billed per second while running, with a 60-second minimum.
- Spot Instances are available at up to a 90% discount compared with On-Demand prices.
- There are four Savings Plans types: Compute, EC2 Instance, Database and SageMaker AI Savings Plans.
- EC2 Instance Savings Plans save up to 72% for a commitment to one instance family in one Region; Compute Savings Plans save up to 66% but apply across instance families, Regions, Fargate and Lambda.
- A stopped EC2 instance is not billed for usage or data transfer, but its attached EBS volumes keep being charged.
- EC2 instances can run Microsoft SQL Server with the license included from AWS, launched from license-included Windows AMIs, or with licenses you bring yourself.
- On-Demand Instance quotas are counted in vCPUs per account per Region, whatever the instance types; launches that would exceed the quota fail until you request an increase.
- A Capacity Reservation is billed at the On-Demand rate whether or not instances run in it; Savings Plans and Regional Reserved Instances can apply their discount to it.
- An open Capacity Reservation is used automatically by any running or new instance with matching type, platform and Availability Zone; a targeted one only by instances that name it, and future-dated reservations start as targeted.
- Savings Plans are a commitment to a set amount of compute usage per hour for one or three years, in exchange for lower prices than On-Demand; they are a pricing model, not reserved capacity.
Reserved Instance flexibility and sharing
Reserved Instances are discounts on EC2 usage that matches their attributes. Their scope decides how flexible the discount is and whether it reserves capacity. In AWS Organizations, the discount can be shared across accounts.
How it works
- Buy for one or three years; three years saves more.
- Pick the class: Standard (biggest discount, modify only) or Convertible (exchangeable).
- Pick the scope: regional for flexibility, zonal for a capacity reservation.
- In an organization, the management account decides how discounts are shared among accounts.
| Scope | Reserves capacity | AZAn isolated location within an AWS Region. flexibility | Size flexibility |
|---|---|---|---|
| Regional | No | Any AZ in the RegionA separate geographic area containing AWS infrastructure. | Within the family (Linux/Unix, default tenancy) |
| Zonal | Yes, in one AZ | No | No |
Exam cues
- If the question says RI discount across instance sizes, think regional RI size flexibility.
- If the question says reserve capacity in an AZ, think zonal RI or Capacity Reservation.
- If the question says share RI discounts across accounts, think AWS Organizations consolidated billing.
- If the question says change instance family during the term, think Convertible RIs or Savings Plans.
Remember
- Scope doesn’t change the price.
- Standard: modify only; Convertible: exchange.
- RI payment: All Upfront, Partial Upfront, No Upfront.
Trap: Size flexibility applies only to regional RIs on Linux/Unix with default tenancy, not to Windows or zonal RIs.
Da documentação da AWS (8)
- A Reserved Instance's scope is regional or zonal, and the scope doesn't change its price.
- A regional Reserved Instance doesn't reserve capacity, but its discount applies in any Availability Zone of the Region and, for Linux/Unix with default tenancy, to any size within the instance family.
- A zonal Reserved Instance reserves capacity in a specific Availability Zone, and its discount applies only to that AZ, instance family and size.
- Reserved Instances are bought for one or three years; the three-year term gives a bigger discount.
- Standard Reserved Instances give the biggest discount and can only be modified; Convertible Reserved Instances give a lower discount and can be exchanged.
- The management account of an organization controls Reserved Instance and Savings Plans discount sharing across its accounts, organization-wide, by account group or per account.
- Reserved Instances can be paid All Upfront, Partial Upfront or No Upfront; with Partial or No Upfront the rest is billed monthly over the term.
- A Convertible Reserved Instance can be exchanged any number of times for a different instance family, operating system or tenancy, as long as the new reservation is of equal or higher value.
Accelerated computing for AI
Training and serving large models needs accelerators. AWS offers its own chips (Trainium for training, Inferentia for inference) next to NVIDIA GPU instances.
How it works
| Accelerator | Instances | Main job |
|---|---|---|
| AWS Trainium | Trn2, Trn3 | Training (and serving) |
| AWS Inferentia | Inf2 | Cost-efficient inference |
| NVIDIA GPUs | P5, P6, G6e | Training and inference, graphics |
Exam cues
- If the question says cost-efficient training on AWS-designed chips, think Trainium.
- If the question says cost-efficient inference on AWS-designed chips, think Inferentia.
Remember
- Trainium and Inferentia use the AWS Neuron SDK.
Trap: Trainium is for training, Inferentia for inference. The names give it away.
Da documentação da AWS (4)
- AWS Trainium is an AWS-designed AI chip for training and serving models; Amazon EC2 Trn2 and Trn3 UltraServers use it for large-scale training and inference.
- AWS Inferentia is an AWS-designed AI chip for inference; Amazon EC2 Inf2 instances use it for high-performance, cost-efficient deep learning and generative AI inference.
- NVIDIA GPU instances such as Amazon EC2 P5 and P6 serve demanding training and inference, and G6e instances serve cost-efficient inference and graphics workloads.
- AWS Trainium and AWS Inferentia use the AWS Neuron SDK, which supports PyTorch, JAX and vLLM.
AMI scope and sharing
An Amazon Machine ImageA software image used to set up and boot an EC2 instance. (AMI) is a software template for setting up and booting EC2 instances. Sharing lets another account launch from your template; copying creates a separate image. An EBS-backed AMIA launch image whose disk data comes from EBS snapshots. uses EBS snapshotsA backup of an EBS volume's data at a particular point in time., point-in-time backups of disk volumes.
How it works
- Select an AMI in the launch RegionA separate geographic area containing AWS infrastructure. that supports the chosen instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities., the instance’s hardware configuration. A Region is a separate geographic area containing isolated locations called Availability Zones.
- To let another account launch from your AMI, grant it launch permissionPermission to launch EC2 instances from an AMI without owning that image.. The source AMI remains yours.
- For encrypted snapshots, grant access to their KMS encryption keys too. Use a customer managed keyAn encryption key that you create and control in AWS KMS., which you create and control. An AWS managed keyA KMS key whose lifecycle and permissions AWS controls for use with its designated service in your account., whose permissions AWS controls, cannot support cross-account AMI sharing.
- To give the recipient its own image, let it copy the shared AMI.
- For another Region, copy the AMI there and set launch permissions on the copy. Copying does not carry over those permissions. To select a different encryption key for the copy, set
EncryptedandKmsKeyIdonCopyImage. - For another Availability ZoneAn isolated location within an AWS Region. in the same Region, create an AMI and launch a replacement in the destination subnetA range of IP addresses in a VPC that lies within one Availability Zone.. A subnet is a range of addresses in your virtual private cloud (VPC) within one zone.
AWSSupport-CopyEC2Instanceautomates this procedure. Update references to changed addresses.
| Requirement | Mechanism | Ownership or scope |
|---|---|---|
| Another account needs to launch | Share the AMI and any required encryption keys | Source account owns the image |
| Another account needs its own image | Copy the shared AMI | Recipient owns the copy |
| Instances must run in another Region | Copy the AMI into that Region | Launch from the destination image |
| Instance must run in another zone | Launch a replacement from an AMI in the destination subnet | New instance and changed addresses |
Exam cues
- If the question says an encrypted shared AMI cannot launch, think KMS key access, because image permission alone does not authorize use of the encryption keys.
- If the question says relocate an instance to another Availability Zone, think an AMI and a replacement launch, because the target subnet determines the zone.
Remember
- AMIs are Regional; sharing does not extend their launch scope.
- The source account pays for shared-image storage; the recipient owns an AMI it copies.
aws/ebsis an AWS managed key. An AMI encrypted with the default AWS managed key cannot be shared.- Copies need their own launch permissions. Encrypted snapshots cannot become unencrypted through copying.
- Paid AMIs: the owner’s software rate plus standard EC2 fees.
Trap: A shared AMI is permission to use the owner’s image. It does not create an image owned by the recipient.
Create an AMI from the source instance.
Launch a new instance in the destination subnet and update references to changed addresses.
Da documentação da AWS (24)
- An EC2 instance type determines the host hardware configuration used for an instance.
- An AWS Region is a separate geographic area containing isolated locations called Availability Zones.
- An AMI can launch instances only in its own AWS Region.
- Sharing an AMI grants another account launch permission without transferring ownership of the source AMI.
- The source account continues paying for the storage of a shared AMI.
- A recipient of an encrypted AMI needs permission to use the KMS keys that encrypt its backing snapshots.
- An AMI backed by snapshots encrypted with the default AWS managed key cannot be shared.
- A customer managed key is a KMS key that the customer creates and controls.
- AWS manages the lifecycle and permissions of an AWS managed KMS key such as aws/ebs.
- Copying a shared AMI creates a target AMI owned by the recipient account.
- To share an AMI in another Region, copy it to that Region and share the copy there.
- AMI copying does not copy the source AMI launch permissions to the target AMI.
- Setting Encrypted and KmsKeyId on CopyImage encrypts the target EBS snapshots with the specified KMS key.
- An encrypted AMI snapshot cannot become unencrypted through AMI copying.
- A subnet is an IP address range in a VPC that lies entirely within one Availability Zone.
- AWSSupport-CopyEC2Instance can create an AMI and launch a new instance in a specified subnet to relocate an instance to another Availability Zone.
- The replacement created by AWSSupport-CopyEC2Instance gets different private IPv4 or public IPv6 addresses and requires references to the old addresses to be updated.
- An EBS snapshot is a point-in-time backup of an EBS volume.
- An EBS-backed AMI uses EBS snapshots for its disk image data.
- Copying an EBS-backed AMI to another Region creates copies of its backing snapshots there, billed as additional snapshot storage.
- Block public access for AMIs is on by default for new accounts and for existing accounts that never had public AMIs; it is off by default for accounts that had public AMIs.
- Turning on block public access for AMIs stops new attempts to make an AMI public, but AMIs that are already public stay public.
- An AMI can be shared with a whole AWS organization or with organizational units instead of listing account IDs.
- An instance launched from a paid AMI is charged at the rate the AMI owner sets plus the standard EC2 usage fees; AWS Marketplace is where such software is sold.
Instance store lifecycle
Instance storeTemporary instance storage provided by disks physically attached to its host. is temporary disk storage on the physical computer, or hostThe physical computer on which an EC2 instance runs., running an EC2 instance. It suits caches, which hold replaceable copies of data, and scratch filesTemporary working data that does not need permanent storage., which hold temporary working data. Think of it as storage tied to that instance’s local disks.
How it works
- Choose an instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities. and size that provide the required instance store capacity. Not every type includes it.
- Attach instance store volumes at launch. A volumeA storage device that an instance can use like a disk. is a disk device the instance can use; you cannot attach these volumes later or move them to another instance.
- Use the volumes for temporary data. A reboot restarts the instance without erasing this data.
- Copy data that must survive to persistent storage such as EBS, S3 or EFS before stopping or replacing the instance. An EBS-backed AMIA launch image whose disk data comes from EBS snapshots., a launch imageA software image used to set up and boot an EC2 instance. built from EBS storage, does not capture instance store data.
- Rebuild temporary data after a stop, hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later., termination, disk failure or CloudWatch recovery. Hibernation saves working memoryThe instance's working memory, whose contents are lost during automatic recovery. to the EBS root volume before stopping; it still erases instance store data. Changing the instance type also does not carry the data over.
| Event | Instance store data |
|---|---|
| Normal instance reboot | Retained |
| Stop, hibernation or termination | Erased |
| Underlying disk failure | Lost on the failed disk |
| Change instance type | Does not transfer |
| Create an EBS-backed AMI | Not included in the image |
| CloudWatch action based recovery | Lost |
Exam cues
- If the question says replaceable cache or temporary working files, think instance store, because its disks provide temporary storage on the instance’s host.
- If the question says local files must survive a stop or replacement, think copying to persistent storage, because instance store cannot preserve them through those events.
- If the question says an AMI will back up every attached disk, think instance store exclusion, because an EBS-backed AMI does not include local instance store data.
Remember
- Attach at launch only; you cannot detach and reattach instance store volumes elsewhere.
- Reboot preserves the data. Stop, hibernation and termination erase it.
- Instance store capacity depends on the instance type and size.
- Instance store: host-attached disks, included in the instance price.
- Instance store also fits temporary data replicated across a fleet.
Trap: Automatic recovery can look like a reboot to the operating system, but CloudWatch action based recovery loses instance store data. Ordinary reboot persistence does not imply recovery persistence.
Da documentação da AWS (15)
- Instance store provides temporary disk storage physically attached to the EC2 host computer.
- Instance store availability and capacity depend on the EC2 instance type and size.
- Instance store volumes can be attached only when an instance launches.
- An instance store volume cannot be detached and attached to a different instance.
- Instance store data survives an instance reboot.
- Stopping, hibernating or terminating an instance erases its instance store data.
- Failure of an underlying instance store disk loses the data on that disk.
- Changing an EC2 instance type does not transfer instance store data to the new instance configuration.
- Creating an EBS-backed AMI does not include the source instance's instance store data.
- To preserve instance store data beyond the instance lifetime, copy it to persistent storage such as EBS, S3 or EFS.
- CloudWatch action based EC2 recovery loses data on attached instance store volumes.
- Successful automatic EC2 recovery appears to the instance as an unplanned reboot.
- EC2 hibernation saves the instance's working memory to its EBS root volume before stopping.
- An EBS-backed AMI uses EBS snapshots for its disk image data.
- Instance store also suits temporary data replicated across a fleet of instances, such as a load-balanced pool of web servers.
Automatic instance recovery
EC2 automatic instance recovery attempts to restore an instance after a problem in its underlying hostThe physical computer on which an EC2 instance runs., the computer running it. The successful operation looks like an unplanned reboot while retaining the instance’s identity. It also retains the Availability ZoneAn isolated location within an AWS Region., an isolated location within an AWS RegionA separate geographic area containing AWS infrastructure., which is a separate geographic area.
How it works
- Distinguish the checks. A system status checkAn EC2 check for problems in the AWS infrastructure running an instance. tests AWS infrastructure; an instance status checkAn EC2 check of an individual instance's software and network connectivity. tests the individual instance’s software and network connectivity.
- For a supported standalone instance, simplified automatic recovery is enabled at launch by default. For alarm-controlled recovery, configure a CloudWatch alarmA monitor that evaluates a metric against a threshold over a period and can trigger an action. on
StatusCheckFailed_Systemwith the recover action. A metricA series of measurements recorded over time. records measurements over time; an alarm evaluates them against a threshold. - After a system failure, AWS attempts to move the instance to another host. Recovery requires a running instance, available capacity and no service events listed in the AWS Health Dashboard.
- Successful recovery retains the instance ID, IP addresses, attached EBS disk volumes and zone. It also retains metadataInformation about an instance used to configure or manage it., the information used to configure or manage the instance. An Elastic IPA static public IPv4 address allocated to your AWS account. is a static public IPv4 address allocated to your account; it is retained too.
- Expect to lose RAMThe instance's working memory, whose contents are lost during automatic recovery., the instance’s working memory. Operating system uptime resets to zero. CloudWatch recovery also loses instance storeTemporary instance storage provided by disks physically attached to its host. data; simplified recovery excludes instances with instance store volumes.
- If recovery fails and the instance remains unreachable or keeps failing system checks, stop and start it manually. This can change its public IPv4 address unless it uses an Elastic IP.
| Situation | Mechanism | Deciding limitation |
|---|---|---|
| Supported standalone instance, default recovery | Simplified automatic recovery | No instance store volumes |
| Supported standalone instance, alarm-controlled recovery | CloudWatch recover action | Selected instance store configurations supported, with data loss |
| Instance software failure, system check passes | CloudWatch reboot action | Recover cannot use StatusCheckFailed_Instance |
| Unhealthy Auto Scaling group member | Auto Scaling replacement | Neither individual-instance recovery mechanism supports group members |
For a separate failover approach, a network interface is a virtual network card. A primary interface cannot be detached, but a secondary interface and its private IP addresses can move between EC2 instances within one Availability Zone.
Exam cues
- If the question says host failure while preserving instance ID and addresses, think recover, because it attempts to restore the same instance on other hardware.
- If the question says only the instance status check fails, think reboot or instance repair, because the recover action cannot use
StatusCheckFailed_Instance. - If the question says an instance belongs to an Auto Scaling group, think group health-based replacement, because individual-instance recovery excludes group members.
- If the question says fail over to another Availability Zone, think a separate replacement strategy, because automatic recovery retains the zone.
- If the question says transfer private addresses to another instance in the same zone, think a secondary network interface, because its attributes move with it.
Remember
StatusCheckFailed_System: 0 means passed; 1 means failed.- Simplified recovery is enabled by default only on supported instances. CloudWatch recovery needs an alarm action.
- With instance store volumes attached at launch, CloudWatch recovery supports M3, C3, R3, X1, X1e, X2idn and X2iedn. It loses their local data.
- Stop and start an EBS-backed instance to move it to a new host; its public IPv4 address changes.
Trap: Recovery preserves instance identity, addresses and EBS volumes, but not RAM or instance store contents. It is not a guarantee of recovery when capacity is unavailable.
- EC2 auto recovery handles standalone instances (
StatusCheckFailed_System). In an ASG the group replaces the instance.
A configured alarm evaluates StatusCheckFailed_System and triggers its recovery action.
AWS attempts recovery on another host; success preserves identity and EBS volumes but loses RAM and instance store data.
Da documentação da AWS (32)
- EC2 system status checks detect problems in the AWS infrastructure hosting an instance.
- EC2 instance status checks monitor the individual instance's software and network connectivity.
- StatusCheckFailed_System is 0 for a passed system check and 1 for a failed system check.
- Automatic instance recovery attempts to move an impaired instance to another host after an underlying hardware or software failure.
- Successful automatic recovery appears to the instance as an unplanned reboot.
- Automatic recovery retains the instance ID.
- Automatic recovery retains public, private and Elastic IP addresses.
- Automatic recovery retains instance metadata.
- Automatic recovery retains attached EBS volumes.
- Automatic recovery retains the instance's Availability Zone.
- An Availability Zone is an isolated location within an AWS Region, a separate geographic area.
- Automatic recovery loses volatile memory (RAM) contents.
- Automatic recovery resets operating system uptime to zero.
- Simplified automatic recovery is enabled by default at launch on supported EC2 instances.
- Simplified automatic recovery does not support instances with instance store volumes.
- CloudWatch action based recovery requires configuring an alarm recovery action and works with StatusCheckFailed_System.
- An alarm on StatusCheckFailed_Instance can reboot an instance but cannot use the recover action.
- With instance store volumes attached at launch, CloudWatch action based recovery supports only M3, C3, R3, X1, X1e, X2idn and X2iedn instance types.
- CloudWatch action based recovery loses instance store data.
- An Elastic Fabric Adapter (EFA) is an EC2 network device for workloads such as machine learning and high performance computing.
- Simplified automatic recovery and CloudWatch action based recovery do not support instances in Auto Scaling groups.
- EC2 Auto Scaling replaces instances it determines are unhealthy.
- Automatic recovery requires a running instance, available instance-type capacity and no service events listed in the AWS Health Dashboard.
- If recovery fails and an instance remains unreachable or keeps failing system checks, AWS recommends manually stopping and starting it.
- Unlike automatic recovery, a manual stop and start assigns a new public IPv4 address unless the instance has an Elastic IP address.
- A CloudWatch metric records measurements over time.
- A CloudWatch alarm evaluates a metric against a threshold over a period.
- Instance metadata is information about an instance used to configure or manage it.
- An Elastic IP address is a static public IPv4 address allocated to an AWS account.
- An EC2 instance's primary network interface cannot be detached from the instance.
- A secondary network interface retains its attributes, including private IP addresses, when moved between EC2 instances in the same Availability Zone.
- Starting a stopped EBS-backed instance typically migrates it to a new underlying host and assigns a new public IPv4 address.
Placement groups and EFA
Placement groups tell EC2 how to place instances on hardware: close together for speed, apart for resilience.
How it works
- Choose a placement strategy: cluster for proximity, partition or spread for hardware separation.
- Launch instances into it; EC2 places them on hardware that follows the strategy. For a partition group, EC2 attempts an even distribution.
- For HPC and ML traffic between instances, attach an Elastic Fabric AdapterAn EC2 network device for workloads such as machine learning and high performance computing. (EFA).
| Strategy | Placement | Fits |
|---|---|---|
| Cluster | Close together in one AZAn isolated location within an AWS Region. | HPC, low-latency node-to-node traffic |
| Partition | Groups of racks, up to 7 partitions per AZ | HDFS, HBase, Cassandra, Kafka |
| Spread | Each instance on distinct hardware, max 7 per AZ per group | A few critical instances |
Exam cues
- If the question says lowest latency or highest throughput between instances, think a cluster placement group (and EFA).
- If the question says large distributed or replicated data store, rack-aware, think partition placement group.
- If the question says a handful of critical instances that must not fail together, think spread placement group.
Remember
- Cluster: one AZ only; launch in one request with one instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities..
- Partition: up to 7 partitions per AZ; can span AZs.
- Spread: up to 7 running instances per AZ per group.
Trap: A cluster placement group improves speed, not availability. It sits in one AZ, so an AZ outage takes all of it down.
Da documentação da AWS (9)
- A cluster placement group places instances close together in one Availability Zone for low latency and high throughput; it can include instances in peered VPCs in the same Region.
- A cluster placement group can't span Availability Zones; AWS recommends launching all its instances in one request with one instance type to avoid insufficient capacity errors.
- With enhanced networking, instances in a cluster placement group can use up to 10 Gbps for a single flow, versus 5 Gbps outside one.
- A partition placement group gives partitions separate racks, network and power for distributed workloads such as HDFS, HBase and Cassandra; EC2 attempts even distribution unless a launch selects a particular partition.
- A partition placement group can span Availability Zones in a Region with up to seven partitions per zone, and shows which instance is in which partition for topology-aware applications.
- A spread placement group puts each instance on distinct hardware, for a small number of critical instances that must not fail together.
- A rack-level spread placement group supports seven running instances per Availability Zone in a Region; multiple groups can hold more, but hardware separation is guaranteed only within each group.
- An Elastic Fabric Adapter (EFA) is a network device for EC2 instances that gives lower, more consistent latency and higher throughput for inter-instance communication in AI, ML and HPC workloads, with support for MPI and NCCL.
- Dedicated Hosts cannot be launched in placement groups.
Hibernation, user data and Instance Connect
Three EC2 features that change how an instance starts and how you reach it: hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later. keeps memory across a stop, user data configures the first boot, and Instance Connect replaces long-lived SSH keys.
How it works
- Hibernation: enable it at launch; on hibernate, the OS writes RAMThe instance's working memory, whose contents are lost during automatic recovery. to the encrypted EBS root volumeA storage device that an instance can use like a disk. and the instance stops.
- On start, the root volume is restored, RAM reloads and processes continue where they were.
- User data: on Linux, shell scripts and cloud-init directives automate setup; scripts run as root on first boot by default. Configure repeated execution for later restarts. Windows uses launch agents to handle scripts.
- Instance Connect: an IAM-authorized API call pushes a temporary public key; you SSH in within 60 seconds. When using a key pair created in the EC2 console, save its private key at creation.
- Set metadataInformation about an instance used to configure or manage it. options to require IMDSv2 tokens or disable the metadata service entirely.
| Action | Memory | Instance ID | Instance charges |
|---|---|---|---|
| Stop | Lost | Kept | None while stopped |
| Hibernate | Saved to EBS root | Kept | None while stopped |
| Terminate | Lost | Gone | None |
Exam cues
- If the question says long warm-up time and instances stopped on a schedule, think hibernation.
- If the question says install software at launch, think user data; for fixed, slow installs, bake them into a golden AMIA software image used to set up and boot an EC2 instance..
- If the question says SSH with IAM control and no shared keys, think EC2 Instance Connect (or Session Manager with no open port).
Remember
- Hibernation: enable at launch, encrypted EBS root, Linux RAM under 150 GiB.
- User data: 16 KB; Linux scripts run as root, first boot only by default, with repeated execution configurable.
- Instance Connect key lives 60 seconds in instance metadata.
Trap: Hibernation can’t be added to a running instance that was launched without it. It must be enabled at launch.
Da documentação da AWS (14)
- Hibernating an EC2 instance saves RAM to the encrypted EBS root volume; on start, RAM is reloaded, processes resume, data volumes reattach and the instance keeps its ID.
- Hibernation can pre-warm instances that take a long time to bootstrap or build a memory footprint, so they resume ready to work.
- A hibernated instance isn't charged for instance usage while stopped; you pay for its EBS volumes, including the stored RAM contents.
- Hibernation needs an encrypted EBS root volume (not instance store) large enough for the RAM, and Linux instances need less than 150 GiB of RAM.
- Hibernation can't be enabled or disabled after an instance is launched.
- EC2 user data is limited to 16 KB before base64 encoding, and for an EBS-backed instance you can stop it to change the user data.
- EC2 Instance Connect authorizes SSH with IAM policies; the API pushes a temporary SSH public key to the instance metadata, where it stays for 60 seconds.
- An EC2 key pair is a public key that EC2 stores on the instance and a private key you keep; it proves identity for SSH on Linux and decrypts the administrator password on Windows.
- Software on an instance reads instance metadata and user data from the Instance Metadata Service at 169.254.169.254 (or fd00:ec2::254 over IPv6); requests are free.
- IMDSv2 requires session tokens, and instance metadata options can require IMDSv2 only or disable the metadata service entirely.
- Instance metadata and user data are not protected by authentication or encryption inside the instance, so they should not hold passwords or other secrets.
- Browser-based EC2 Instance Connect to a public address needs the security group to allow port 22 from the Region EC2 Instance Connect prefix list (com.amazonaws.<region>.ec2-instance-connect).
- EC2 Instance Connect Endpoint lets users connect from the internet to instances that have no public IP address, without a bastion host and without an internet gateway in the VPC.
- When the EC2 console creates a key pair, its private key is downloaded at creation; that is the only opportunity to save that private key file.
Fleets and Spot requests
Fleets and Spot request types control how EC2 keeps cheap capacity running when Spot Instances come and go.
How it works
- Define a target capacity, a launch template and several instance types and AZs.
- The fleet launches a mix of On-Demand and Spot Instances to reach the target.
- When Spot Instances are interrupted, the fleet requests replacements.
- Handle interruption signals from Amazon EventBridge or instance metadataInformation about an instance used to configure or manage it.. Delivery is best effort; hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later. begins immediately rather than allowing two minutes to prepare.
- Single Spot requests are one-time (default) or persistent (resubmitted after interruption).
Exam cues
- If the question says keep a target capacity with Spot across many instance types, think EC2 Fleet or Spot Fleet (or an Auto Scaling group with mixed instances).
- If the question says relaunch after each Spot interruption for one request, think a persistent Spot request.
- If the question says instances keep running after canceling a request, remember canceling doesn’t terminate.
Remember
- Interruption notices are best effort; a hibernation notice has no two-minute lead time.
- Diversify instance types and AZs to lower interruption impact.
- One-time is the default Spot request; persistent requests resubmit.
- Cancel request and terminate instance are two separate steps.
Trap: A persistent Spot request keeps relaunching instances. To stop it for good, cancel the request and then terminate the instances.
Da documentação da AWS (11)
- EC2 Fleet and Spot Fleet launch tens to thousands of instances in one operation from a launch template or launch parameters.
- A fleet can mix instance types and Availability Zones, so it doesn't depend on one instance type's capacity, and picks zones for Spot based on price and interruption preferences.
- A fleet that includes Spot Instances can automatically request replacements when Spot Instances are interrupted.
- A one-time Spot request isn't resubmitted after its instance is interrupted, and it is the default request type.
- A persistent Spot request is resubmitted after an interruption to replace the instance, and stays active until it expires or you cancel it.
- Canceling an active Spot request doesn't terminate its running Spot Instance; you terminate the instance separately.
- The price-capacity-optimized Spot allocation strategy is the recommended one: it picks the pools with the most spare capacity, then the cheapest of those.
- capacity-optimized picks only the pools with the most spare capacity (fewest interruptions), diversified spreads Spot Instances across all pools, and lowest-price, the CLI default, carries the highest interruption risk.
- A Spot capacity pool is the unused EC2 capacity for one instance type in one Availability Zone.
- An EC2 rebalance recommendation signals that a Spot Instance is at elevated interruption risk; it can arrive before the two-minute interruption notice, but sometimes arrives with it.
- EC2 sends Spot interruption notices through Amazon EventBridge and instance metadata on a best-effort basis; stop and termination notices give two minutes, but hibernation begins immediately.
IP addresses and network interfaces
An EC2 instance’s network identity is its network interfaces and their addresses. Knowing which addresses stay and which can move answers most failover and licensing questions.
How it works
- Each instance has a primary network interface with a private IPv4 address from its subnetA range of IP addresses in a VPC that lies within one Availability Zone..
- It can also get a public IPv4 address, or an Elastic IP addressA static public IPv4 address allocated to your AWS account. you own and can move. The operating system uses the private address; the internet gateway translates IPv4 traffic for the public address.
- Extra network interfaces can be attached in the same AZAn isolated location within an AWS Region. and moved between instances with their addresses.
- Enhanced networking and EBS optimization raise network and storage performance.
| Need | Feature |
|---|---|
| Fixed public IPv4 that can move to another instance | Elastic IP address |
| Network identity (IP, MAC) that survives an instance swap | Secondary network interface |
| Prevent accidental termination from the console or API | Termination protection |
| High packets per second, low latency | Enhanced networking |
| EBS I/O not slowed by other traffic | EBS-optimized instance |
Exam cues
- If the question says keep the same public IP across instance replacement, think Elastic IP.
- If the question says MAC-bound license or a management network, think a secondary network interface.
- If the question says prevent accidental termination, think termination protection (and check shutdown behavior).
Remember
- Private IPv4 always; public IPv4 and IPv6 optional. Public IPv4 translation takes place at the internet gateway.
- Network interfaces stay within one AZ.
- Termination protection doesn’t stop an OS-initiated terminate.
- Enhanced networking: no additional charge.
Trap: A network interface can’t move to an instance in another AZ, so it’s not a cross-AZ failover tool. Use an Elastic IP, a load balancer or DNS for that.
Da documentação da AWS (14)
- Every EC2 instance gets a private IPv4 address from its subnet's range, and can optionally have a public IPv4 address and IPv6 addresses.
- An Elastic IP address is a static public IPv4 address allocated to your account until you release it; remapping it to another instance masks an instance failure.
- An elastic network interface is a virtual network card in a VPC; it attaches to instances in the same Availability Zone, and its attributes move with it when it is detached and attached elsewhere.
- Termination protection (the DisableApiTermination attribute) blocks terminating an instance through the EC2 API or console, but not a shutdown from inside the OS when shutdown behavior is set to terminate.
- Enhanced networking uses SR-IOV for higher network performance and lower CPU use than traditional virtualized network interfaces on supported instance types.
- An EBS-optimized instance has dedicated bandwidth for Amazon EBS I/O, so EBS traffic doesn't compete with the instance's other network traffic.
- Each AWS account has a default quota of five Elastic IP addresses per Region; addresses from a BYOIP pool do not count toward it.
- Each network interface attached to an instance has a delete-on-termination setting that decides whether the interface is deleted or kept when the instance terminates.
- A Connection timed out error when connecting to an instance points at the network path: a security group or network ACL that blocks the port, or a subnet route table with no route to the internet gateway.
- By default an OS shutdown of an EBS-backed instance stops it; setting InstanceInitiatedShutdownBehavior to terminate makes it terminate instead.
- Stop protection blocks accidental stop and termination through EC2, but not a shutdown run inside the operating system or Auto Scaling terminations.
- EC2 hostnames use split-horizon DNS: queried from inside the VPC they resolve to the private IP address, and a public DNS name resolves to the public IPv4 address from outside.
- For EC2 internet access over IPv4, the instance uses its private address internally and the internet gateway translates traffic for its public IPv4 address.
- Enhanced networking uses SR-IOV for higher bandwidth, higher packets per second and lower latency between instances, at no additional charge.
EC2 configuration and cost details
EC2 design choices include the instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities., tenancy and how capacity is paid for. Reading the instance name and understanding charges across its lifecycle helps you choose and operate instances.
How it works
- Read an instance type name as family and size. In
c7gn.4xlarge,cis the series,7the generation,gnthe options and4xlargethe size. - Choose tenancy for the VPC and instance. A dedicated-tenancy VPC runs all instances as Dedicated Instances. In a default-tenancy VPC, an instance or launch template can still request dedicated tenancy.
- Account for instance state and reserved capacity. Instance usage is billed while running and while stopping for hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later.. A Capacity Reservation is billed at the On-Demand rate even when unused, with applicable Savings Plans or Regional Reserved Instance discounts.
- Use Instance Scheduler on AWS to start and stop tagged EC2 and RDS instances on custom schedules across accounts and RegionsA separate geographic area containing AWS infrastructure..
- Consider the Reserved Instance Marketplace when a Standard Reserved Instance is no longer needed, such as after a move to another Region.
- Plan capacity separately from price: On-Demand launches and restarts can fail for insufficient capacity. A Capacity Reservation defines the zoneAn isolated location within an AWS Region., instance type, platform and tenancy.
- Use Dedicated HostThe physical computer on which an EC2 instance runs. affinity when placement must stay tied to a physical host. Budget for the allocated host even when its instances are stopped.
- Schedule downtime for vertical resizing: an EBS-backed instance must stop before its type changes and start again afterward.
Exam cues
-
If the question says
m5.2xlarge, think seriesm, generation5and size2xlarge, because the name separates the family from the size. -
If the question says a default-tenancy VPC and a dedicated launch template, think Dedicated Instances, because the template can request dedicated tenancy.
-
If the question says stop development instances outside business hours across accounts, think Instance Scheduler on AWS, because it uses tags and schedules.
-
If the question says an unused Standard Reserved Instance after a Region move, think Reserved Instance Marketplace, because customers can sell unused Standard reservations there.
-
If the question says resize an EBS-backed EC2 instance without downtime, think a different scaling design, because changing its type requires a stop and start.
-
If the question says an empty Dedicated Host still incurs charges, think host allocation, because billing does not depend on the number of running instances.
Remember
- Spot notices are best effort: two minutes for stop or termination, with no preparation interval for hibernation.
- EBS volumes and Elastic IP addressesA static public IPv4 address allocated to your AWS account. can incur charges regardless of instance state. A Reserved Instance continues billing through its term after its instance is terminated.
- A Capacity Reservation incurs the On-Demand rate even when no instances use it.
Trap: Stopping an instance does not stop every charge. EBS volumes and Elastic IP addresses can still incur charges, and a Capacity Reservation is billed even when unused.
Da documentação da AWS (12)
- An instance type name is the instance family then the size: in c7gn.4xlarge, c is the series, 7 the generation, gn the options and 4xlarge the size.
- EC2 Spot interruption notices are best effort: stop and termination notices give two minutes of warning, while a hibernation notice arrives as hibernation begins.
- Instances in a VPC with dedicated tenancy always run as Dedicated Instances; in a VPC with default tenancy, an instance or launch template can still request dedicated tenancy.
- EC2 bills instance usage only in the running state, plus the stopping state when hibernating; EBS volumes and Elastic IP addresses bill whatever the instance state, and a Reserved Instance keeps billing to the end of its term after its instance is terminated.
- A Capacity Reservation is billed at the On-Demand rate whether or not instances run in it; Savings Plans and Regional Reserved Instances can apply their discount to it.
- Instance Scheduler on AWS is a deployable solution that uses resource tags and Lambda to stop and start EC2 and RDS instances on custom schedules across accounts and Regions.
- The EC2 Reserved Instance Marketplace lets customers sell unused Standard Reserved Instances, for example after moving Regions or changing instance types.
- An EC2 On-Demand launch or restart can fail with InsufficientInstanceCapacity when AWS lacks capacity for the request.
- Dedicated Host affinity lets an EC2 instance remain associated with a particular physical host across deployments over time.
- An EC2 Capacity Reservation defines its capacity by Availability Zone, instance type, operating system platform and tenancy.
- Changing the instance type of an EBS-backed EC2 instance requires stopping it and starting it again, so the workload needs planned downtime.
- An active On-Demand Dedicated Host is billed for the host regardless of the number or sizes of instances running on it; releasing the host stops those charges.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 113 flashcards em lista
A company runs a web server that uses CPU, memory and network in roughly equal amounts. Which EC2 instance category fits?
General purpose.
A media company transcodes video and needs fast processors. Which EC2 instance category fits?
Compute optimized.
An in-memory database processes very large data sets in RAM. Which EC2 instance category fits?
Memory optimized.
A data warehouse needs very high sequential read and write throughput on local disks. Which EC2 instance category fits?
Storage optimized.
A team trains machine learning models and renders graphics on GPUs. Which EC2 instance category fits?
Accelerated computing, which uses hardware accelerators such as GPUs.
Does choosing a bigger general purpose EC2 instance give the same result as choosing a memory optimized one for a large in-memory data set?
No. Memory optimized instances are built for large in-memory data sets; the category, not only the size, should match the workload.
A company needs virtual servers in AWS where it controls the operating system and installed software. Which service fits?
Amazon EC2, which provides virtual servers (instances) that you configure and manage.
A team needs cloud machines to build and sign its iOS app. Which EC2 option fits?
EC2 Mac instances, which run macOS on Apple hardware. They run on Dedicated Hosts, billed per host with a 24-hour minimum.
A user data script on an EC2 instance uses sudo, and an admin expects it to run on every reboot. What is wrong with both assumptions?
On Linux, user data runs as root and only on first boot by default. Configure repeated execution if it must run on later restarts.
What happens to EC2 instance store data when its instance stops, hibernates or terminates?
It is erased. Use instance store for temporary data, and copy anything that must survive to persistent storage.
An application needs very fast temporary block storage for scratch data, at no extra storage cost. Which EC2 storage option fits?
Instance store.
Its disks are attached to the host and are included in the instance price, but data is lost when the instance stops or terminates.
What does an EC2 AMI provide, and what compatibility must a launch satisfy?
The software to set up and boot an instance. The AMI must support the chosen instance type.
A company runs a steady workload on EC2 for the next three years but may change instance families. Which purchasing option saves the most while staying flexible?
A Compute Savings Plan, which applies across instance family, size, OS, tenancy and Region, plus Fargate and Lambda.
A batch job can stop and restart at any time. Which EC2 purchasing option is cheapest?
Spot Instances, which use spare capacity at steep discounts and can be interrupted.
A developer needs an EC2 instance for a short test of unknown length with no commitment. Which purchasing option fits?
On-Demand Instances, billed by the second with no commitment.
A company must use its existing per-core SQL Server licenses on EC2. Which purchasing option supports this?
Dedicated Hosts, which give a physical server and support per-socket, per-core and per-VM licenses.
A company needs guaranteed EC2 capacity in one Availability Zone for a launch event, without a long-term commitment. Which option fits?
On-Demand Capacity Reservations, which reserve capacity in a specific AZ.
Should a production database that must never stop run on Spot Instances to save money?
No. Spot capacity can be interrupted, and interruption notices are best effort. Use On-Demand capacity with a suitable discount if needed.
Which is AWS's recommended commitment-based discount for EC2 today, Savings Plans or Reserved Instances?
Savings Plans. Both offer up to 72% off On-Demand, but Savings Plans don't lock you into an instance configuration.
What is the minimum billing period when an EC2 On-Demand Instance starts?
60 seconds. After that, On-Demand Instances are billed per second.
Which EC2 purchasing option can give up to a 90% discount compared with On-Demand?
Spot Instances.
Which Savings Plans type gives the largest EC2 discount, and what does it tie you to?
EC2 Instance Savings Plans, up to 72%. They tie you to one instance family in one Region; Compute Savings Plans (up to 66%) are more flexible.
Which four Savings Plans types does AWS offer?
Compute, EC2 Instance, Database and SageMaker AI Savings Plans.
In which instance state is only EBS storage billed, not the instance itself?
Stopped. Instance usage stops being billed, but attached EBS volumes are still charged.
A DBA needs SQL Server Standard on a server reachable by RDP, must not buy a license separately, and is unsure about sizing. What fits?
An EC2 instance from a Windows Server AMI with SQL Server Standard license included. AWS bills the license with the instance, and the instance type can be changed later.
A script launching many On-Demand instances in one Region fails after a few dozen succeed. What limit is likely involved?
The On-Demand Instance quota, measured in vCPUs per account per Region. Request an increase through Service Quotas.
A team buys a Compute Savings Plan to be sure capacity exists for a big launch. Is that enough?
No. Savings Plans only lower prices for committed hourly usage; to hold capacity in an Availability Zone, use an On-Demand Capacity Reservation.
What is the difference between a regional and a zonal EC2 Reserved Instance?
- Regional: no capacity reservation; discount applies in any AZ and, for Linux, any size in the family
- Zonal: reserves capacity in one AZ; discount only for that AZ, family and size
A company bought a regional Linux Reserved Instance for m5.xlarge and now runs two m5.large instances in the same Region. Does the discount still apply?
Yes. Regional Linux/Unix Reserved Instances with default tenancy have instance size flexibility within the family.
Which EC2 Reserved Instance class can be exchanged for a different configuration?
Convertible. Standard RIs give a bigger discount but can only be modified, not exchanged.
A company has Reserved Instances in one account of an AWS Organization. Can other accounts in the organization benefit from the discount?
Yes. The management account controls RI and Savings Plans discount sharing across the organization's accounts.
Does a regional Reserved Instance guarantee EC2 capacity?
No. Only a zonal Reserved Instance (or a Capacity Reservation) reserves capacity, in one AZ.
What payment options can a company choose when it buys EC2 Reserved Instances?
All Upfront, Partial Upfront or No Upfront.
With Partial or No Upfront, the remaining balance is billed monthly over the term.
What limits an exchange of a Convertible Reserved Instance?
The new reservation must be of equal or higher value. Family, operating system and tenancy can change, with no limit on the number of exchanges.
A company wants the most cost-efficient AWS-designed chips to train its own large models. Which option fits?
AWS Trainium (Amazon EC2 Trn2 or Trn3 instances).
A company wants low-cost, high-throughput inference for a deep learning model on AWS-designed chips. Which EC2 instances fit?
Amazon EC2 Inf2 instances, powered by AWS Inferentia.
A graphics application needs NVIDIA acceleration on Amazon EC2. Which type of compute should the company choose?
NVIDIA GPU instances, such as Amazon EC2 G6e.
Is AWS Inferentia meant for training large models?
No. Inferentia targets inference; Trainium targets training (and also serves models).
Does sharing an EC2 AMI create a copy owned by the recipient account?
No. It grants launch permission; the source account retains ownership and storage charges. Copying the AMI creates a recipient-owned image.
An EC2 AMI is shared with an account that needs instances in another Region. What must happen before launch?
Copy the AMI to the destination Region and grant launch permission there. Sharing the source image does not make it available in another Region.
An EC2 AMI uses EBS snapshots encrypted with aws/ebs. How can its owner make an image available to another account?
Copy the AMI using a customer managed KMS key, then share the copy and grant the recipient key access. The default AWS managed key cannot support this sharing.
A team must relocate an EC2 instance to another Availability Zone in its current Region. What image-based procedure fits?
Create an AMI and launch a replacement in a subnet in the destination zone. AWSSupport-CopyEC2Instance can automate this. Update references to changed IP addresses.
Can EC2 CopyImage turn an encrypted EBS-backed AMI into an unencrypted AMI?
No. Copying can encrypt or re-encrypt the backing snapshots, but cannot remove their encryption.
An AMI made from a snapshot in Region A is copied to Region B, and one instance is launched from it in Region B. What exists in Region B?
One instance, one AMI and one snapshot. Copying an EBS-backed AMI also copies its backing snapshot into the destination Region.
A disaster recovery plan needs to launch EC2 instances from an AMI in a different AWS Region. What must the team do?
Copy the AMI to the recovery Region. AMIs can launch instances only in their own Region.
An EC2 instance needs a replacement in another Availability Zone for recovery. How can an AMI help?
Create an AMI from the instance and launch a replacement in a subnet in the target Availability Zone.
A team launches EC2 instances from an AWS Marketplace AMI that includes commercial software. What does it pay?
The software rate set by the AMI owner plus the standard EC2 usage fees.
An EC2 application keeps disposable cache files on instance store. Does a normal instance reboot erase the files?
No. Instance store data survives a reboot. Stopping, hibernating or terminating the instance erases it.
A team creates an EBS-backed AMI from an EC2 instance with instance store data. Will a replacement launched from the AMI contain that data?
No. The AMI excludes instance store data. Copy required data to persistent storage before replacing the instance.
Can an operator detach an EC2 instance store volume and attach it to a replacement instance?
No. Instance store volumes are attached only at launch and cannot move between instances.
An EC2 instance changes to another instance type that also has instance store. Does the previous local disk data transfer?
No. Changing the instance type does not transfer instance store data. Copy required data to persistent storage first.
A supported EC2 instance with instance store undergoes CloudWatch action based recovery. Is its local disk data retained?
No. Recovery loses the instance store data, even though an ordinary instance reboot would preserve it.
A load-balanced web fleet keeps a cache that every instance can rebuild from its peers. Is EC2 instance store a reasonable place for it?
Yes. Instance store suits temporary data replicated across a fleet; losing one instance's copy does not lose the data.
Which CloudWatch alarm action attempts to move an impaired EC2 instance to another host while preserving its ID and IP addresses?
The recover action on StatusCheckFailed_System. Successful recovery keeps the instance ID, IP addresses, metadata, EBS volumes and zone, but loses RAM contents.
A standalone EC2 instance fails StatusCheckFailed_Instance while its system status check passes. Which CloudWatch action can restart it automatically?
Reboot, using an alarm on StatusCheckFailed_Instance. The recover action cannot be used on that metric; investigate the instance's software and network configuration.
Must an operator create a CloudWatch alarm to enable simplified automatic recovery for a supported EC2 instance?
No. Simplified automatic recovery is enabled by default at launch. CloudWatch action based recovery requires an explicitly configured alarm action.
How do simplified and CloudWatch action based EC2 recovery differ for instances with instance store volumes?
Simplified recovery excludes them. CloudWatch recovery supports selected instance types with instance store attached at launch, but loses that data during recovery.
An operator compares automatic EC2 recovery with manually stopping and starting an impaired instance. Which preserves an automatically assigned public IPv4 address?
Automatic recovery. Manual stop and start changes the public IPv4 address unless the instance has an Elastic IP address.
An unhealthy EC2 instance belongs to an Auto Scaling group. Which mechanism should replace it?
EC2 Auto Scaling health-based replacement. Instances in Auto Scaling groups are excluded from simplified and CloudWatch action based recovery.
A running EC2 instance has automatic recovery configured, but there is no capacity for its instance type. Is recovery guaranteed?
No. Recovery requires available capacity. If recovery fails and the instance stays unreachable or keeps failing system checks, AWS recommends a manual stop and start.
A team needs an EC2 instance to resume in another Availability Zone after a zone outage. Does automatic instance recovery provide this?
No. Automatic recovery retains the instance's Availability Zone.
A team wants to detach the primary network interface from an impaired EC2 instance and attach it to a replacement. Is that possible?
No. An EC2 instance's primary network interface cannot be detached.
An EC2 secondary network interface moves between instances in the same Availability Zone. What happens to its private IP addresses?
They stay with the network interface when it is moved.
An EBS-backed EC2 instance has a scheduled retirement event for its degraded host. What simple action moves it to healthy hardware, and what changes?
Stop and start it. It typically starts on a new host and receives a new public IPv4 address.
A tightly coupled HPC job needs the lowest network latency and highest throughput between 16 EC2 instances. Which placement strategy fits?
A cluster placement group in one Availability Zone (add EFA for MPI traffic).
An HDFS cluster of 90 EC2 instances must limit the impact of a rack failure and let the application know which instances share hardware. Which placement strategy fits?
A partition placement group: partitions don't share racks, and partition numbers are visible to the application.
Five critical EC2 instances must never share underlying hardware. Which placement strategy fits, and what is its limit?
A spread placement group: each instance on distinct hardware, at most seven running instances per AZ.
Can a cluster placement group span two Availability Zones for high availability?
No. A cluster placement group lives in one AZ; use spread or partition groups for fault isolation.
Adding instances to an existing cluster placement group fails with an insufficient capacity error. What does AWS recommend?
Launch all instances in a single request with one instance type; if it already happened, stop and start all instances in the group and retry.
Which EC2 network device speeds up MPI or NCCL communication between instances for HPC and ML training?
Elastic Fabric Adapter (EFA).
A Java application on EC2 takes 20 minutes to load caches after boot. The instances are stopped at night and must resume ready to serve in the morning. Which EC2 feature fits?
EC2 hibernation: RAM is saved to the EBS root volume and restored on start.
What does an EC2 instance need to be hibernated?
Hibernation enabled at launch, an encrypted EBS root volume big enough for the RAM, and (on Linux) less than 150 GiB of RAM.
Do you pay EC2 instance charges while an instance is hibernated?
No instance usage charges while it's stopped; you still pay for its EBS volumes, including the saved RAM.
Admins must SSH into Linux EC2 instances without distributing long-lived key pairs, with access controlled by IAM. Which feature fits?
EC2 Instance Connect, which pushes a one-time public key valid for 60 seconds.
An EC2 instance takes a long time to build its in-memory state and is stopped on a schedule. Which feature helps it resume ready to work?
Use hibernation. It saves memory to the encrypted EBS root volume and reloads it on start.
A team expects to hibernate an EC2 instance later. When must it enable hibernation?
At launch. Hibernation cannot be enabled after the instance is launched.
An EC2 workload must retain running process state across a stop. Should it stop normally or hibernate?
Hibernate the instance. Its RAM is saved to the encrypted EBS root volume and processes resume on start.
From which IP address does software on an instance read its metadata?
169.254.169.254, the link-local IMDS address (fd00:ec2::254 for IPv6).
A team plans to hibernate EC2 instances with large memory. What storage requirement must it account for?
The encrypted EBS root volume must have enough space for RAM.
An administrator creates a key pair in the EC2 console for Linux SSH access. When must the private key file be saved?
At creation, when the browser downloads it. The EC2 console does not offer another chance to save that private key.
An EC2 application must reject tokenless instance metadata requests, while another instance must expose no metadata endpoint. Which settings fit?
Require IMDSv2 on the first instance and disable IMDS on the second through instance metadata options.
A batch workload must keep 200 vCPUs of cheap capacity running across several instance types and AZs, replacing Spot Instances when they are interrupted. Which feature fits?
An EC2 Fleet or Spot Fleet with diversified instance types and AZs and a target capacity.
A team cancels an active Spot Instance request, but the instance keeps running and billing. Why?
Canceling a Spot request doesn't terminate its running instance; terminate the instance separately.
A long-running Spot job should get a new instance automatically after each interruption. Which Spot request type fits?
A persistent Spot request, which is resubmitted after an interruption.
What is the default Spot Instance request type, and what happens after an interruption?
One-time; it isn't resubmitted after the instance is interrupted.
Which Spot allocation strategy balances low price with a low chance of interruption, and is the one AWS recommends?
price-capacity-optimized. It narrows to the pools with the most capacity, then launches from the cheapest of them.
A Spot Fleet runs a workload that is costly to interrupt and price matters less. Which allocation strategy fits?
capacity-optimized, which launches only from the pools with the most spare capacity. lowest-price has the highest interruption risk.
Which Spot signal can warn earlier than the two-minute interruption notice?
The EC2 instance rebalance recommendation, sent when the instance is at elevated interruption risk; it is not guaranteed to come first.
An EC2 Spot application needs automated interruption handling. Where can it receive notices, and can it assume a notice always arrives?
Amazon EventBridge or instance metadata. Delivery is best effort, so the application must tolerate an interruption without a notice.
A licensed application is tied to a fixed public IP. If its EC2 instance fails, a standby instance must take over at the same address quickly. What fits?
An Elastic IP address, remapped from the failed instance to the standby.
A software license is bound to a MAC address. How can the license survive replacing the EC2 instance?
Put it on a separate elastic network interface and move that interface to the new instance (same AZ).
An application needs a fixed public IPv4 address that can move to a replacement EC2 instance. What should it use?
Use an Elastic IP address and remap it to the replacement instance.
A database on EC2 shows EBS latency spikes when the instance's network traffic is high. Which instance capability fixes the contention?
EBS optimization, which gives EBS I/O dedicated bandwidth.
Which EC2 feature uses SR-IOV for higher packets per second and lower network latency?
Enhanced networking.
How many Elastic IP addresses can an account allocate per Region by default?
Five. The quota can be raised, and addresses brought with BYOIP do not count.
SSH to a new instance fails with Connection timed out. Where do you look first?
At the network path: the security group and network ACL rules for port 22 (and NACL return ports), and the subnet route to the internet gateway.
A network interface carrying an EC2 instance network identity must move to a replacement instance. What Availability Zone constraint applies?
The replacement must be in the same Availability Zone as the network interface.
An EC2 workload needs EBS I/O that does not compete with other instance network traffic. Which compute feature fits?
Use an EBS-optimized instance with dedicated bandwidth for EBS I/O.
Two instances in the same VPC talk using each other public DNS names. Does the traffic leave the VPC?
No. Inside the VPC the public DNS name resolves to the private IP address, so traffic stays private.
An EC2 instance has a public IPv4 address, but its operating system shows its private IPv4 address. Which VPC component handles translation for internet traffic?
The internet gateway. The instance uses its private address internally; public IPv4 translation happens at the gateway.
Is there an extra charge for enabling EC2 enhanced networking for higher bandwidth and lower latency?
No. Enhanced networking has no additional charge on supported instance types.
What does each part of the instance type name m5.2xlarge mean?
m is the series (general purpose), 5 the generation and 2xlarge the size within the family.
Can an EC2 Spot workload rely on a two-minute warning before every interruption?
No. Notices are best effort. Stop and termination notices give two minutes of warning; hibernation starts immediately.
A launch template asks for dedicated tenancy, but the VPC has default tenancy. Where do the instances run?
On dedicated hardware. A default-tenancy VPC lets the launch template choose dedicated, and a dedicated-tenancy VPC forces dedicated for every instance.
Which EC2 states bill instance usage?
Running, and stopping when the instance is hibernating. EBS volumes and Elastic IPs still bill while stopped, and Reserved Instances bill for their full term even after termination.
A team creates a Capacity Reservation for a week but launches nothing into it. What do they pay?
The On-Demand rate for the reserved capacity for the whole week. A Capacity Reservation is charged whether or not it is used; only Savings Plans or Regional Reserved Instances lower that price.
Development EC2 and RDS instances in several accounts should stop outside business hours automatically. What ready-made AWS solution fits?
Instance Scheduler on AWS, which stops and starts tagged instances on defined schedules across accounts and Regions.
A company no longer needs a Standard Reserved Instance after moving Regions. What can it do with it?
Sell it in the EC2 Reserved Instance Marketplace.
An EC2 application must launch in one Availability Zone for a scheduled event. Does choosing On-Demand alone ensure that the launch succeeds?
No. On-Demand launches can fail when capacity is unavailable. Plan capacity separately from the pricing choice.
An EC2 application license requires repeated placement on the same physical server. Which Dedicated Host feature supports that requirement?
Host affinity. It associates the instance with a particular Dedicated Host over time.
A team plans an EC2 Capacity Reservation for a specific workload. Which workload attributes must it plan the reservation around?
Availability Zone, instance type, operating system platform and tenancy.
An EBS-backed EC2 application needs a larger instance type. Can the team resize it while it keeps serving requests?
No. Stop the instance, change its type and start it again. Plan for downtime.
A team stops every EC2 instance on an On-Demand Dedicated Host but keeps the host allocated. Does host billing stop?
No. The active host is billed regardless of how many instances run on it. Release the host to stop its On-Demand charges.