Question 1
A company has a VPC with public and private subnets in two AZs. The private instances need to access Amazon DynamoDB without traversing the internet. Which solution is MOST cost-effective?
- Create a DynamoDB interface VPC endpoint in each private subnet with private DNS.
- Create a VPC peering connection between the VPC and the DynamoDB service VPC.
- Route the private subnets' DynamoDB traffic through a NAT gateway in each AZ.
- Create a DynamoDB gateway VPC endpoint and add it to the private route tables. — Correct
Correct answer
Create a DynamoDB gateway VPC endpoint and add it to the private route tables.
Explanation
DynamoDB gateway endpoints are free and keep traffic private. Interface endpoints for DynamoDB exist but cost more. NAT gateways send traffic to public endpoints and add charges. You cannot peer with the service.
Question 2
A company runs batch jobs that can be interrupted and restarted. The jobs run for 1 to 3 hours each night. The company wants the LOWEST compute cost. Which purchasing option should be used?
- On-Demand Instances
- Reserved Instances
- Spot Instances — Correct
- Dedicated Instances
Correct answer
Spot Instances
Explanation
Spot Instances offer the largest discounts and suit interruptible jobs. On-Demand costs more. Reserved Instances suit steady 24/7 usage. Dedicated Instances cost more and are for isolation needs.
Question 3
A company has application logs that are rarely queried after 90 days but must be kept for 3 years. The logs are currently in CloudWatch Logs. Which solution reduces cost while keeping the logs available for occasional queries?
- Keep all logs in CloudWatch Logs for 3 years and query them with Logs Insights when needed.
- Keep 90 days in CloudWatch Logs, export older logs to S3 with lifecycle rules, and query with Athena. — Correct
- Copy the logs to EBS volumes attached to an EC2 instance that runs a log search tool.
- Delete logs older than 90 days and rely on CloudTrail Event history for older information.
Correct answer
Keep 90 days in CloudWatch Logs, export older logs to S3 with lifecycle rules, and query with Athena.
Explanation
Exporting older logs to S3 with lifecycle rules is cheaper, and Athena can query them. Keeping 3 years in CloudWatch costs more. Deleting logs breaks the requirement. EBS and EC2 add cost and management.
Question 4
A company runs an Amazon ECS service and wants to reduce costs for tasks that can tolerate interruption while keeping a base level of stable capacity. Which configuration fits BEST?
- Running all tasks on FARGATE_SPOT with no base value so that the cost is as low as possible.
- Running all tasks on EC2 Dedicated Hosts so that the tasks are never interrupted.
- A capacity provider strategy with a FARGATE base and FARGATE_SPOT for additional tasks. — Correct
- Running all tasks on FARGATE with Compute Savings Plans that cover the peak number of tasks.
Correct answer
A capacity provider strategy with a FARGATE base and FARGATE_SPOT for additional tasks.
Explanation
A base on FARGATE keeps stable capacity, and FARGATE_SPOT lowers cost for the rest. Spot-only risks losing all tasks. Covering peak with Savings Plans pays for unused capacity. Dedicated Hosts cost more.
Question 5
A company has strict requirements to keep EC2 instances on hardware that is dedicated to the company, and to control instance placement on specific physical servers for licensing. Which option should be used?
- Dedicated Instances
- Spot Instances
- Dedicated Hosts — Correct
- Capacity Reservations
Correct answer
Dedicated Hosts
Explanation
Dedicated Hosts give visibility and control over physical servers for bring-your-own-license software. Dedicated Instances run on dedicated hardware but without host-level control. Spot and Capacity Reservations do not provide dedicated hardware.
Question 6
An application must process uploaded files as soon as they arrive in an S3 bucket. Each file takes up to 2 minutes to process. Uploads are unpredictable, with long idle periods. Which solution is the MOST cost-effective?
- Run an Amazon ECS service on Fargate with one always-on task that lists the bucket every 30 seconds.
- Run an Amazon EMR cluster that scans the bucket every hour and processes all new files in a batch.
- Run a fleet of EC2 instances in an Auto Scaling group that polls the bucket for new files every minute.
- Configure S3 event notifications to invoke an AWS Lambda function that processes each file. — Correct
Correct answer
Configure S3 event notifications to invoke an AWS Lambda function that processes each file.
Explanation
Lambda runs only when files arrive and fits the 2-minute processing time, so idle periods cost nothing. Always-on instances, tasks, or clusters cost money while idle, and hourly batches add delay.
Question 7
An application stores data in DynamoDB. The company wants to automatically delete items 90 days after creation without consuming write capacity. Which solution meets this requirement?
- Use an S3 lifecycle rule that targets the DynamoDB table's storage.
- Run a daily Lambda function that scans the table and deletes old items.
- Enable DynamoDB Time to Live (TTL) with an expiration timestamp attribute. — Correct
- Create a DynamoDB Streams trigger that deletes items after 90 days.
Correct answer
Enable DynamoDB Time to Live (TTL) with an expiration timestamp attribute.
Explanation
TTL deletes expired items at no write cost. Scans and stream-based deletes consume capacity and require code. S3 lifecycle rules do not apply to DynamoDB.
Question 8
A company runs a stateless web application on EC2 instances. Traffic varies during the day and drops to near zero at night. The company wants to minimize cost while maintaining performance. Which solution meets these requirements?
- Run the maximum number of instances needed at peak at all times and purchase Reserved Instances for them.
- Use an Auto Scaling group with a target tracking policy behind an Application Load Balancer. — Correct
- Use one large instance and resize it manually twice a day to match the expected traffic.
- Use Dedicated Hosts so that the company pays only for the hosts that run during the day.
Correct answer
Use an Auto Scaling group with a target tracking policy behind an Application Load Balancer.
Explanation
Auto Scaling adds and removes instances with demand, so the company pays only for needed capacity. Peak-sized fleets waste money at night. Manual resizing is slow and causes downtime. Dedicated Hosts cost more.
Question 9
A company runs Microsoft SQL Server on EC2 with a license included in the instance price. The company wants to bring its existing SQL Server licenses that require per-core licensing on dedicated physical servers. Which option should be used?
- Amazon RDS for SQL Server with Multi-AZ
- Shared tenancy instances with Savings Plans
- Spot Instances with license-included AMIs
- Dedicated Hosts, with AWS License Manager tracking the licenses — Correct
Correct answer
Dedicated Hosts, with AWS License Manager tracking the licenses
Explanation
Dedicated Hosts allow per-core licensing on dedicated hardware, and License Manager tracks usage. Spot and shared tenancy do not meet the license terms. RDS for SQL Server uses license-included pricing.
Question 10
A company has an application that reads data from Amazon S3 in us-east-1 and processes it on EC2 in eu-west-1. Data transfer costs are high. Which change reduces costs the MOST?
- Run the processing in us-east-1, in the same Region as the data. — Correct
- Enable S3 Transfer Acceleration on the bucket in us-east-1.
- Use S3 Intelligent-Tiering for the data in us-east-1.
- Use a NAT gateway in eu-west-1 for the S3 traffic.
Correct answer
Run the processing in us-east-1, in the same Region as the data.
Explanation
Processing data in the same Region avoids inter-Region transfer charges. Transfer Acceleration adds cost. A NAT gateway adds processing charges. Storage class does not affect transfer charges.