Study guide
Technical reference and lesson notes
Purpose of This Lesson
This lesson focuses on scenario-based decisions for Amazon EC2 and AWS Lambda. The central skill is matching an operational requirement—such as hardware maintenance, interruption tolerance, fixed source IPs, monitoring, or scheduled execution—to the appropriate AWS feature or pricing model.
Key Concepts
- AWS Personal Health Dashboard: Identifies AWS events that specifically affect your account and resources, including scheduled hardware maintenance.
- Stop and start: Can move an EC2 instance to different underlying hardware. This is useful before scheduled maintenance or when system status checks fail.
- Insufficient instance capacity: AWS does not currently have enough capacity for the requested Availability Zone and instance type. Trying a different Availability Zone or instance type may resolve the problem.
- Instance limit exceeded: The account has reached an EC2 instance limit. An increase must be requested through AWS Support.
- System status checks: Indicate problems involving the underlying host or AWS infrastructure rather than the guest operating system.
- Private subnet without internet egress: Keeps EC2 instances from accessing the internet when no NAT gateway or NAT instance is provided.
- NAT gateway with an Elastic IP: Allows private instances to reach internet-based services while presenting a stable public source IP that can be allowlisted.
- Spot Instances: Provide the greatest cost reduction when an application can tolerate interruptions.
- Spot block: In the scenario presented, this is the choice for a workload that requires a defined time period and must restart if interrupted.
- Unified CloudWatch agent: Collects metrics such as memory utilization from EC2 instances and on-premises servers, and can stream logs to CloudWatch Logs.
- Lambda concurrency: Controls the number of simultaneous Lambda executions. Expected traffic must fit within the applicable concurrency limit.
- Scheduled Lambda invocation: A scheduled rule in CloudWatch Events can invoke a Lambda function at recurring intervals, such as every 15 minutes.
EC2 Operational Scenarios and Decision Points
Hardware maintenance and system health
Use the AWS Personal Health Dashboard to determine whether scheduled hardware maintenance affects a particular EC2 instance. If the instance is critical, stopping and starting it before the maintenance window can move it to different underlying hardware.
The same stop-and-start approach can help when system status checks fail. These checks concern the underlying host or hardware. This differs from an instance status check, which concerns the guest operating system and instance-level configuration.
Capacity and account limits
Two launch failures require different responses:
| Error or condition | Meaning | Appropriate response |
|---|---|---|
InsufficientInstanceCapacity | AWS lacks sufficient capacity for the requested instance type in the selected location | Try another Availability Zone or a different instance type |
InstanceLimitExceeded | The account has reached its EC2 instance limit | Request a limit increase through AWS Support |
Changing the instance type does not directly resolve an account quota problem, and requesting a quota increase does not immediately solve a temporary capacity shortage.
Network isolation and fixed source addresses
If EC2 instances must not access the internet, place them in a private subnet without a NAT gateway or NAT instance. A private subnet alone is not the complete decision; the absence of an internet egress path is what prevents outbound internet access.
If private EC2 instances must access an internet-based service that allowlists one source IP address, route them through a NAT gateway configured with an Elastic IP address. The external service can allowlist that stable public address rather than the private addresses of individual instances.
Selecting an EC2 pricing model
Pricing decisions depend mainly on interruption tolerance and runtime requirements:
- Spot Instances: Best for distributed or asynchronous workloads that can tolerate interruption, such as processing jobs or reporting pipelines.
- Spot block: In the lecture scenario, appropriate for a job requiring a defined runtime window and expected to restart if interrupted.
- On-Demand Instances: Appropriate when interruption is not acceptable or when the workload requires a straightforward, non-committed pricing option. The scenarios emphasize Spot alternatives when interruption tolerance exists.
Examples:
- A distributed application that can handle processing interruptions is a strong Spot Instance candidate.
- An asynchronous data feed used for weekly or monthly reporting can use Spot Instances because reporting is not time-critical and the process can tolerate interruption.
- A nightly two-hour job that must restart if it fails is matched in this lesson with a Spot block for the required time period.
Monitoring, Logs, and Auto Scaling
The standard CloudWatch metrics available for EC2 do not by themselves provide the memory utilization detail required in these scenarios. Install the Unified CloudWatch agent when memory utilization must be tracked on EC2 or on-premises servers.
The agent can also stream application or system logs to CloudWatch Logs. This is important when EC2 Auto Scaling terminates an unhealthy instance: the instance may disappear, but its logs remain available for later analysis if they were sent to CloudWatch Logs before termination.
Lambda Scaling and Scheduling
When a Lambda function is expected to receive a large traffic increase, verify that its concurrency limit is higher than the expected number of simultaneous executions. A limit that is too low can prevent the function from scaling to the anticipated workload.
For a function that must run every 15 minutes, create a scheduled rule in CloudWatch Events to invoke the function periodically. The scheduling mechanism, rather than an application-side timer, supplies the recurring trigger.
Exam- or Assessment-Relevant Takeaways
- Use the AWS Personal Health Dashboard for account-specific scheduled maintenance notifications.
- Stop and start an instance when the scenario points to moving it to different underlying hardware.
- Distinguish temporary AWS capacity shortages from account instance-limit exhaustion.
- For no internet access, use a private subnet without a NAT gateway or NAT instance.
- For a single allowlisted source IP from private instances, use a NAT gateway with an Elastic IP.
- Choose Spot when interruptions are acceptable; choose the scenario’s time-bound Spot option when a defined processing period is required.
- AWS is responsible for the EC2 hardware under the shared responsibility model.
- Use the Unified CloudWatch agent for memory metrics and log collection beyond the basic scenario requirements.
- Ensure Lambda concurrency exceeds expected simultaneous executions.
- Use a scheduled CloudWatch Events rule for a 15-minute Lambda trigger.
Tool / Feature Decision Guide
| Requirement | Feature or action | Decisive reason |
|---|---|---|
| Check whether planned AWS maintenance affects your instance | AWS Personal Health Dashboard | It reports events affecting your account and resources |
| Move an instance away from its current host | Stop and start | The instance can be placed on different underlying hardware |
| Resolve insufficient capacity | Try another Availability Zone or instance type | The requested capacity is unavailable in the current placement choice |
| Resolve an EC2 instance limit error | Request a limit increase through AWS Support | The account quota has been reached |
| Prevent internet access from EC2 | Private subnet without NAT gateway or NAT instance | No internet egress path is provided |
| Provide one allowlisted outbound IP | NAT gateway with an Elastic IP | Private instances share the gateway’s stable public source IP |
| Run interruption-tolerant distributed processing cheaply | Spot Instances | They offer the greatest price reduction in the presented choices |
| Monitor memory on EC2 and on premises | Unified CloudWatch agent | It collects memory utilization across both environments |
| Preserve logs from instances that may be terminated | CloudWatch agent to CloudWatch Logs | Logs remain available for later analysis after termination |
| Trigger Lambda every 15 minutes | Scheduled CloudWatch Events rule | The rule provides recurring invocation |
Common Traps / Misconceptions
- Confusing capacity with limits:
InsufficientInstanceCapacityis a current AWS capacity problem;InstanceLimitExceededis an account limit problem. - Treating system status checks as an application problem: System checks point toward the underlying host or AWS infrastructure, making stop and start a possible remediation.
- Assuming a private subnet automatically blocks all access: Confirm that no NAT gateway or NAT instance provides internet egress.
- Using an instance’s private IP for external allowlisting: Internet services need the NAT gateway’s Elastic IP when traffic exits through the gateway.
- Assuming default monitoring includes memory: Use the Unified CloudWatch agent for memory utilization in these scenarios.
- Relying on local logs after Auto Scaling termination: Logs must be streamed to CloudWatch Logs if they are needed after the instance is gone.
- Ignoring interruption tolerance in pricing questions: Spot is suitable only when the workload can handle interruptions.
- Setting Lambda concurrency below expected demand: A low concurrency limit can prevent the function from handling the expected simultaneous executions.
- Using an ad hoc timer for recurring Lambda execution: Use a scheduled CloudWatch Events rule for the 15-minute requirement.
Real-World Engineer / Analyst Notes
- Treat AWS Personal Health Dashboard notifications as operational inputs: review affected resources and decide whether moving a critical instance before maintenance reduces risk.
- When diagnosing launch failures, record the exact error before changing configuration. Capacity remediation and quota remediation follow different paths.
- Design interruption-tolerant workloads deliberately before adopting Spot. Distributed processing, checkpointing, and asynchronous reporting are natural candidates because work can be retried or resumed.
- Ship logs away from ephemeral compute. Auto Scaling is valuable for recovery, but it also means the original instance may no longer exist during investigation.
- Monitor the metric that reflects the suspected failure mode. If memory pressure or a memory leak is suspected, install the CloudWatch agent rather than relying only on basic EC2 metrics.
- Fixed outbound IP requirements are architectural constraints. Use controlled egress through a NAT gateway and allowlist its Elastic IP rather than exposing private instances directly.
Quick Reference Summary
- Maintenance notification: AWS Personal Health Dashboard.
- Move to new host: Stop and start the EC2 instance.
- Insufficient capacity: Try another Availability Zone or instance type.
- Instance limit exceeded: Request a limit increase.
- No internet access: Private subnet with no NAT gateway or NAT instance.
- One public source IP for private instances: NAT gateway plus Elastic IP.
- Interruption-tolerant workload: Spot Instances.
- Defined time-period job in the presented scenario: Spot block.
- EC2/on-premises memory monitoring: Unified CloudWatch agent.
- Logs needed after instance termination: CloudWatch agent to CloudWatch Logs.
- Lambda traffic spike: Set concurrency higher than expected simultaneous executions.
- Lambda every 15 minutes: Scheduled CloudWatch Events rule.
Flashcards
Q: An EC2 launch returns InsufficientInstanceCapacity. What should you try first?
A: Try a different Availability Zone or instance type because AWS lacks sufficient capacity for the current request.
Q: An EC2 launch returns InstanceLimitExceeded. Is changing the instance type the primary fix?
A: No. The account has reached an EC2 instance limit, so request a limit increase through AWS Support.
Q: Which AWS service shows scheduled hardware maintenance that affects resources in your account?
A: The AWS Personal Health Dashboard provides account-specific notifications about scheduled maintenance and other relevant events.
Q: A critical EC2 instance is scheduled for hardware maintenance. What action can move it before the maintenance window?
A: Stop and start the instance, which can place it on different underlying hardware.
Q: What does a failing EC2 system status check generally indicate?
A: A problem with the underlying host or AWS hardware, rather than solely with the guest operating system.
Q: How would you prevent EC2 instances from accessing the internet?
A: Place them in a private subnet and do not provide a NAT gateway or NAT instance for internet egress.
Q: Private EC2 instances must reach an external service that allowlists one source IP. Which design fits?
A: Route them through a NAT gateway with an Elastic IP, and allowlist that Elastic IP at the external service.
Q: When is Spot pricing a strong choice for a distributed application?
A: When the application can tolerate processing interruptions and retry or redistribute work, allowing it to benefit from lower cost.
Q: What pricing choice is matched to the lecture’s two-hour job that must restart if it fails?
A: A Spot block for the required time period is the scenario’s intended choice.
Q: Which agent should collect memory utilization from both EC2 and on-premises servers?
A: The Unified CloudWatch agent.
Q: How can logs from an unhealthy EC2 instance remain available after Auto Scaling terminates it?
A: Install the CloudWatch agent and stream the logs to CloudWatch Logs before the instance is terminated.
Q: A Lambda function expects a major traffic increase. What concurrency check is required?
A: Ensure the concurrency limit is higher than the expected number of simultaneous executions.
Q: How should a Lambda function be invoked every 15 minutes?
A: Create a scheduled rule in CloudWatch Events to invoke the function periodically.
Practice Questions
Question 1
A company launches EC2 instances in a private subnet. The instances must download data from an internet-based service, and that service accepts traffic from only one allowlisted IP address. Which design best satisfies the requirement?
A. Assign public IPv4 addresses directly to every instance
B. Use a NAT gateway with an Elastic IP
C. Use a private subnet with no route to a NAT device
D. Use an internet gateway without public addresses on the instances
Correct answer: B
Explanation: A NAT gateway with an Elastic IP gives private instances a stable public source IP that the external service can allowlist.
Question 2
An EC2 instance reports failing system status checks. The organization wants to move the workload to different underlying hardware. Which action should the administrator take?
A. Reboot the guest operating system only
B. Stop and start the instance
C. Install the Unified CloudWatch agent
D. Request an EC2 instance-limit increase
Correct answer: B
Explanation: System status checks concern the underlying host. Stopping and starting the instance can move it to a different host.
Question 3
A distributed EC2 application processes independent work items and can retry items if capacity is interrupted. The team’s primary goal is to reduce compute cost. Which pricing model is the best fit?
A. Spot Instances
B. Dedicated hardware maintenance
C. A NAT gateway
D. An increased EC2 instance limit
Correct answer: A
Explanation: The application can tolerate interruptions, which is the decisive condition for selecting Spot Instances in this scenario.
Question 4
An Auto Scaling group replaces unhealthy EC2 instances. During an incident, an administrator needs logs from an instance that has already been terminated. What should have been configured?
A. A scheduled CloudWatch Events rule
B. The Unified CloudWatch agent streaming logs to CloudWatch Logs
C. A larger Lambda concurrency limit
D. A different EC2 Availability Zone only
Correct answer: B
Explanation: The CloudWatch agent can stream logs to CloudWatch Logs, preserving them for analysis after the original instance is terminated.
WordPress Metadata
Suggested Slug:
aws-cloudops-ec2-lambda-exam-scenarios
Meta Description:
Study common SOA-C03 scenarios for EC2 maintenance, capacity errors, networking, pricing models, monitoring, auto scaling, and Lambda scheduling.
Tags:
AWS Certified CloudOps Engineer, SOA-C03, Amazon EC2, AWS Lambda, EC2 Auto Scaling, Amazon CloudWatch, Spot Instances, AWS networking, Shared responsibility model