Ngân hàng đề — AWS Certified Solutions Architect Professional
Tìm thấy 1221 câu.
Which solution will achieve the company's goal with the LEAST operational overhead?
- A Install the AWS Replication Agent on the source servers, including the MySQL servers. Set up replication for all servers. Launch test instances for regular drills. Cut over to the test instances to fail over the workload in the case of a failure event.
- B Install the AWS Replication Agent on the source servers, including the MySQL servers. Initialize AWS Elastic Disaster Recovery in the target AWS Region. Define the launch settings. Frequently perform failover and fallback from the most recent point in time.
- C Create AWS Database Migration Service (AWS DMS) replication servers and a target Amazon Aurora MySQL DB cluster to host the database. Create a DMS replication task to copy the existing data to the target DB cluster. Create a local AWS Schema Conversion Tool (AWS SCT) change data capture (CDC) task to keep the data synchronized. Install the rest of the software on EC2 instances by starting with a compatible base AMI.
- D Deploy an AWS Storage Gateway Volume Gateway on premises. Mount volumes on all on-premises servers. Install the application and the MySQL database on the new volumes. Take regular snapshots. Install all the software on EC2 Instances by starting with a compatible base AMI. Launch a Volume Gateway on an EC2 instance. Restore the volumes from the latest snapshot. Mount the new volumes on the EC2 instances in the case of a failure event.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi tập trung vào việc xây dựng giải pháp business continuity (liên tục kinh doanh) trên AWS cho một ứng dụng on-premises chính, chạy trên physical servers (máy chủ vật lý) cùng với các ứng dụng khác. Ứng dụng này sử dụng MySQL database làm kho dữ liệu, và tất cả OS on-premises đều tương thích với Amazon EC2.
Mục tiêu chính: Failover (chuyển đổi khẩn cấp) sang AWS khi hệ thống on-premises gặp sự cố, với LEAST operational overhead (ít nỗ lực vận hành nhất) – nghĩa là giải pháp phải tự động hóa cao, dễ thiết lập, drill thường xuyên, và không yêu cầu can thiệp thủ công phức tạp.
✅ Yêu cầu cốt lõi: Replicate toàn bộ servers (bao gồm app và DB MySQL) một cách liên tục, hỗ trợ test drills, failover/failback nhanh chóng, mà không cần rebuild từ đầu hoặc migrate thủ công.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Install the AWS Replication Agent on the source servers, including the MySQL servers. Initialize AWS Elastic Disaster Recovery in the target AWS Region. Define the launch settings. Frequently perform failover and fallback from the most recent point in time.
Lý do chọn (theo kiến thức AWS cập nhật 2026):
- 🛠️ AWS Elastic Disaster Recovery (DRS) là dịch vụ chuyên biệt cho disaster recovery (DR) từ on-premises sang AWS, với operational overhead thấp nhất. Nó sử dụng AWS Replication Agent (agent nhẹ) để replicate continuous block-level toàn bộ servers (app + MySQL DB) mà không ảnh hưởng hiệu suất on-premises.
- 📈 Quy trình: Cài agent → Initialize DRS ở target Region → Define launch settings (EC2 instance types, subnets, etc.) → Tự động failover/failback từ point-in-time gần nhất (RPO thấp, ~giây/phút).
- 🔄 Hỗ trợ drills thường xuyên không ảnh hưởng production, failback dễ dàng khi recover on-premises.
- So với các option khác, DRS fully managed, không cần setup DMS/SCT thủ công hay snapshots, phù hợp migrate toàn bộ stack (app + DB) với least effort.
📘 Tài liệu tham khảo:
- AWS DRS User Guide: https://docs.aws.amazon.com/drs/latest/userguide/what-is-drs.html
- AWS Well-Architected Framework - Reliability Pillar (2024 update): Nhấn mạnh DRS cho low-RTO/RPO DR.
🔍 Giải thích chi tiết tất cả các phương án
Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc tiếng Anh. Mỗi option được đánh giá đúng/sai, lý do bằng tiếng Việt rõ ràng:
-
❌ [SAI] Install the AWS Replication Agent on the source servers, including the MySQL servers. Set up replication for all servers. Launch test instances for regular drills. Cut over to the test instances to fail over the workload in the case of a failure event.
🧠 Tại sao sai? Mô tả replication agent thủ công và launch test instances + cut over yêu cầu vận hành cao (manual drills, không tự động point-in-time recovery). Không tận dụng DRS fully managed, dẫn đến overhead lớn hơn (quản lý replication riêng, không có launch settings predefined). Không phải giải pháp tối ưu AWS. -
✅ [ĐÚNG] Install the AWS Replication Agent on the source servers, including the MySQL servers. Initialize AWS Elastic Disaster Recovery in the target AWS Region. Define the launch settings. Frequently perform failover and fallback from the most recent point in time.
🛠️ Tại sao đúng? Như đã giải thích ở trên: DRS tự động hóa toàn bộ (agent → replication → launch EC2 tự động), hỗ trợ frequent drills/failover/failback với RTO/RPO thấp. Overhead thấp nhất vì serverless-managed, replicate app + MySQL nguyên bản mà không migrate DB riêng. -
❌ [SAI] Create AWS Database Migration Service (AWS DMS) replication servers and a target Amazon Aurora MySQL DB cluster to host the database. Create a DMS replication task to copy the existing data to the target DB cluster. Create a local AWS Schema Conversion Tool (AWS SCT) change data capture (CDC) task to keep the data synchronized. Install the rest of the software on EC2 instances by starting with a compatible base AMI.
🚫 Tại sao sai? Tập trung migrate DB riêng lẻ bằng DMS + SCT + CDC (phức tạp, overhead cao cho schema conversion/ongoing sync). App phải install thủ công trên EC2 từ AMI (không replicate toàn bộ server). Không phải DR toàn diện cho physical servers multi-app, RTO cao vì sync DB riêng và rebuild app. -
❌ [SAI] Deploy an AWS Storage Gateway Volume Gateway on premises. Mount volumes on all on-premises servers. Install the application and the MySQL database on the new volumes. Take regular snapshots. Install all the software on EC2 Instances by starting with a compatible base AMI. Launch a Volume Gateway on an EC2 instance. Restore the volumes from the latest snapshot. Mount the new volumes on the EC2 instances in the case of a failure event.
📦 Tại sao sai? Storage Gateway Volume Gateway chỉ backup volumes/block storage qua snapshots (không continuous replication real-time). Failover yêu cầu restore snapshots + install thủ công app/DB trên EC2 (overhead lớn, RPO phụ thuộc snapshot schedule). Không replicate toàn server, MySQL có thể inconsistent nếu snapshot không atomic.
🎯 Kết luận khuyến nghị
Sử dụng AWS Elastic Disaster Recovery là lựa chọn best practice cho DR on-premises sang AWS với least overhead, đảm bảo high availability và dễ scale. Để thực hiện, bắt đầu từ AWS Console → DRS → Source servers setup. Nếu cần pilot, dùng AWS Free Tier cho drills! 🚀
Which solution will meet these requirements?
- A In the company's AWS account, create resource policies for all resources in the account to grant access to the auditors' AWS account. Assign a unique external ID to the resource policy.
- B In the company's AWS account, create an IAM role that trusts the auditors' AWS account. Create an IAM policy that has the required permissions. Attach the policy to the role. Assign a unique external ID to the role's trust policy.
- C In the company's AWS account, create an IAM user. Attach the required IAM policies to the IAM user. Create API access keys for the IAM user. Share the access keys with the auditors.
- D In the company's AWS account, create an IAM group that has the required permissions. Create an IAM user in the company's account for each auditor. Add the IAM users to the IAM group.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi này xoay quanh thách thức bảo mật trong môi trường AWS, cụ thể là cách cấp quyền truy cập read-only an toàn cho các kiểm toán viên bên ngoài (external auditors) vào tài khoản AWS của công ty.
- Bối cảnh: Công ty phải tuân thủ kiểm toán quy định (regulatory audits) về thông tin tài chính. Kiểm toán viên sử dụng một tài khoản AWS riêng (auditors' AWS account), không phải tài khoản của công ty. Họ cần truy cập read-only (chỉ đọc, không chỉnh sửa) vào tài khoản AWS của công ty.
- Yêu cầu chính: Giải pháp phải an toàn, tuân thủ AWS security best practices (như nguyên tắc least privilege, tránh chia sẻ credentials, sử dụng role-based access thay vì user/access keys).
- Mục tiêu: Tránh rủi ro bảo mật như lộ credentials, tấn công account takeover, và đảm bảo kiểm soát chặt chẽ (ví dụ: sử dụng external ID để chống confused deputy attacks).
- Kiến thức liên quan (cập nhật 2026): AWS khuyến nghị sử dụng IAM Roles với cross-account trust kết hợp external ID cho truy cập liên tài khoản, theo IAM Access Analyzer và Security Pillar trong AWS Well-Architected Framework (phiên bản mới nhất).
📘 Tài liệu tham khảo:
- AWS IAM Roles for Cross-Account Access (cập nhật 2025).
- External ID Best Practices.
- AWS Well-Architected Framework: Security Pillar (2026 edition).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: In the company's AWS account, create an IAM role that trusts the auditors' AWS account. Create an IAM policy that has the required permissions. Attach the policy to the role. Assign a unique external ID to the role's trust policy.
Lý do chi tiết 🛠️:
- Đây là best practice chuẩn của AWS cho cross-account access: Tạo IAM Role trong tài khoản công ty (trust auditors' account), gắn IAM Policy với quyền read-only (ví dụ: ReadOnlyAccess hoặc custom policy chỉ cho phép
Describe*,List*actions). - Trust policy của role chỉ định
Principallà auditors' account ID, cộng với unique external ID (một chuỗi ngẫu nhiên) để ngăn chặn confused deputy attacks – kẻ tấn công không thể giả mạo auditors assume role nếu không biết external ID. - Auditors assume role qua STS
AssumeRoleAPI từ account của họ, nhận temporary credentials (an toàn hơn access keys vĩnh viễn). - Tuân thủ least privilege, audit trail qua CloudTrail, và không chia sẻ long-term credentials.
- Cập nhật 2026: IAM Roles hỗ trợ tags và conditions nâng cao hơn cho fine-grained control.
📋 Giải thích tất cả các phương án (đúng/sai)
-
Phương án 1: In the company's AWS account, create resource policies for all resources in the account to grant access to the auditors' AWS account. Assign a unique external ID to the resource policy.
❌ Sai vì: Resource policies (như S3 bucket policy) chỉ áp dụng cho tài nguyên cụ thể (không phải toàn account), không scale cho toàn bộ tài khoản AWS. Không hỗ trợ external ID ở mức resource policy (external ID chỉ dùng trong IAM trust policies). Vi phạm best practices vì phức tạp, khó quản lý, và không cung cấp IAM-level read-only unified access. -
Phương án 2: In the company's AWS account, create an IAM role that trusts the auditors' AWS account. Create an IAM policy that has the required permissions. Attach the policy to the role. Assign a unique external ID to the role's trust policy.
✅ Đúng vì: Như đã giải thích ở phần đáp án đúng – đây là giải pháp chuẩn AWS, an toàn, scalable, và tuân thủ security best practices với temporary credentials + external ID. -
Phương án 3: In the company's AWS account, create an IAM user. Attach the required IAM policies to the IAM user. Create API access keys for the IAM user. Share the access keys with the auditors.
❌ Sai vì: Tạo IAM user + chia sẻ access keys vĩnh viễn là anti-pattern bảo mật (AWS khuyến cáo chống lại). Dễ bị lộ keys, không có thời hạn hết hạn tự động, khó thu hồi, và auditors phải quản lý keys ngoài account của họ. Vi phạm nguyên tắc "don't share credentials" trong IAM best practices. -
Phương án 4: In the company's AWS account, create an IAM group that has the required permissions. Create an IAM user in the company's account for each auditor. Add the IAM users to the IAM group.
❌ Sai vì: Tạo IAM users trong account công ty cho auditors bên ngoài yêu cầu chia sẻ passwords hoặc keys, tạo rủi ro bảo mật cao (auditors có thể lạm dụng). Không hỗ trợ cross-account tự nhiên, khó quản lý (phải tạo user riêng lẻ), và không dùng temporary credentials – trái với best practices cho external access.
Which solution will meet these requirements with the LEAST latency?
- A Create a two-node DynamoDB Accelerator (DAX) cluster. Configure an application to read and write data by using DAX.
- B Create a three-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data by using DAX and to write data directly to the DynamoDB table.
- C Create a three-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data directly from the DynamoDB table and to write data by using DAX.
- D Create a single-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data by using DAX and to write data directly to the DynamoDB table.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi tập trung vào một nền tảng giao dịch nhạy cảm với độ trễ (latency-sensitive) sử dụng Amazon DynamoDB làm backend lưu trữ, đang chạy ở chế độ on-demand capacity (tự động scale theo nhu cầu). Kiến trúc sư giải pháp (solutions architect) cần thiết kế giải pháp cải thiện hiệu suất (performance), đặc biệt là giảm độ trễ thấp nhất (LEAST latency), đồng thời đảm bảo tính sẵn sàng cao (high availability - HA) cho nền tảng.
🔑 Yêu cầu cốt lõi:
- Giảm latency: DynamoDB thường có latency đọc ~10ms (single-digit millisecond), nhưng với ứng dụng giao dịch cần microsecond-level.
- High availability: Phải chịu lỗi node/cluster mà không downtime.
- DAX (DynamoDB Accelerator): Là dịch vụ in-memory caching cho DynamoDB, giảm latency đọc xuống microsecond, hỗ trợ read/write qua endpoint DAX. Tuy nhiên, để tối ưu:
- Read: Qua DAX để tận dụng cache.
- Write: Trực tiếp vào DynamoDB để tránh overhead (DAX sẽ tự động invalidate/update cache).
- On-demand mode: Không ảnh hưởng đến DAX, nhưng DAX giúp giảm RCU/WCU load trên DynamoDB.
Giải pháp phải chọn cluster DAX phù hợp về số node và cách config app để đạt LEAST latency + HA.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a three-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data by using DAX and to write data directly to the DynamoDB table.
Lý do 🛠️:
- 3-node cluster: Đảm bảo HA cao nhất với quorum 2/3 (chịu được 1 node fail mà không mất dữ liệu/cache). AWS khuyến nghị minimum 3 nodes cho production để replication across AZs (multi-AZ).
- Read qua DAX: Latency giảm từ ms xuống microseconds nhờ in-memory cache.
- Write trực tiếp DynamoDB: Tránh latency kép (app write DAX → DAX sync DynamoDB), DAX tự động invalidate cache sau write → nhanh nhất cho trading platform.
- Least latency tổng thể: Kết hợp cache read nhanh + write trực tiếp → lý tưởng cho workload read-heavy như trading.
- Phù hợp on-demand DynamoDB: DAX giảm throttling/load trên table chính.
📋 Phân tích tất cả các phương án
-
❌ Create a two-node DynamoDB Accelerator (DAX) cluster. Configure an application to read and write data by using DAX.
Sai vì: 2-node chỉ quorum 1/2, không đảm bảo HA (fail 1 node → toàn bộ cluster down). Write qua DAX thêm latency sync → không LEAST latency. Không đạt yêu cầu HA cho trading platform. -
✅ Create a three-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data by using DAX and to write data directly to the DynamoDB table.
Đúng vì: Như giải thích trên – 3-node HA, read cache microsecond latency, write trực tiếp tối ưu → LEAST latency + HA. -
❌ Create a three-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data directly from the DynamoDB table and to write data by using DAX.
Sai vì: Read trực tiếp DynamoDB → latency cao (~10ms), không tận dụng DAX cache → không cải thiện performance chính (read thường chiếm tỷ lệ lớn trong trading). Write qua DAX không cần thiết và thêm overhead. -
❌ Create a single-node DynamoDB Accelerator (DAX) cluster. Configure an application to read data by using DAX and to write data directly to the DynamoDB table.
Sai vì: Single-node không HA (fail → toàn bộ cache mất, downtime). AWS chỉ recommend cho dev/test, không production HA → vi phạm yêu cầu high availability.
📘 Tài liệu tham khảo (kiến thức AWS cập nhật 2026)
- AWS DAX Documentation: Amazon DynamoDB Accelerator (DAX) – Khuyến nghị ≥3 nodes cho HA, best practice read-only qua DAX.
- DAX Cluster Best Practices: DAX Fault Tolerance – Multi-node replication across AZs.
- DynamoDB Performance: DAX Low Latency – Microsecond reads, write direct cho least latency.
- Exam Topic DOP-C02: High availability & caching trong DynamoDB (AWS Certified DevOps Engineer Professional).
Giải pháp này tối ưu chi phí + performance cho latency-sensitive apps! 🚀
The application averages hundreds of thousands of requests each month. However, the application is used mainly during lunchtime and receives minimal traffic during the rest of the day.
A solutions architect needs to optimize the infrastructure cost of the application without negatively affecting the application availability.
Which combination of steps will meet these requirements? (Choose two.)
- A Change all the EC2 instances to compute optimized instances that have the same number of cores as the existing EC2 instances.
- B Move the application frontend to a static website that is hosted on Amazon S3.
- C Deploy the application frontend by using AWS Elastic Beanstalk. Use the same instance type for the nodes.
- D Change all the backend EC2 instances to Spot Instances.
- E Deploy the backend Python application to general purpose burstable EC2 instances that have the same number of cores as the existing EC2 instances.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một ứng dụng đã migrate từ on-premises lên AWS, bao gồm:
- Frontend: Website tĩnh chạy trên 2 EC2 instances (loại large general purpose On-Demand) phía sau Application Load Balancer (ALB).
- Backend: Ứng dụng Python chạy trên 3 EC2 instances tương tự, cũng phía sau một ALB riêng.
- Mô hình sử dụng: Hàng trăm nghìn requests/tháng, nhưng chủ yếu tập trung vào giờ ăn trưa (peak usage), còn lại gần như idle (ít traffic).
- Yêu cầu: Solutions Architect cần tối ưu chi phí infrastructure mà không ảnh hưởng availability (tính sẵn sàng cao).
📈 Vấn đề chính: EC2 On-Demand large general purpose được size theo peak on-premises → Chi phí cao vì chạy full-time dù traffic thấp. Giải pháp phải chọn 2 steps kết hợp để giảm chi phí (cost optimization) theo AWS Well-Architected Framework (pillar Cost Optimization, cập nhật 2023-2026).
✅ Đáp án đúng (Chọn TWO)
Hai phương án đúng là:
- Move the application frontend to a static website that is hosted on Amazon S3.
- Deploy the backend Python application to general purpose burstable EC2 instances that have the same number of cores as the existing EC2 instances.
Lý do lựa chọn:
- Frontend là static website → S3 hosting siêu rẻ (pay-per-use, ~$0.023/GB storage + requests), loại bỏ hoàn toàn EC2/ALB (tiết kiệm >90% chi phí), vẫn đảm bảo high availability (99.99%) qua S3 + CloudFront.
- Backend Python cần burstable performance (T3/T4g instances, cập nhật Graviton2/3 đến 2026) → Baseline CPU thấp cho idle time, burst lên peak (credits tích lũy), rẻ hơn 40-50% so On-Demand, giữ nguyên cores → Không ảnh hưởng performance/availability. Kết hợp → Tối ưu nhất mà safe.
🛠️ Phân tích chi tiết từng phương án
-
❌ Change all the EC2 instances to compute optimized instances that have the same number of cores as the existing EC2 instances.
Sai vì: Compute Optimized (C-series như C7g) ưu tiên CPU cao liên tục, phù hợp workload CPU-intensive 100%, nhưng app này idle hầu hết thời gian → Không tận dụng burst/idle, vẫn tốn kém On-Demand (~20-30% đắt hơn general purpose cho mixed workload). Không giải quyết root cause (traffic thấp), có thể tăng chi phí thay vì giảm. -
✅ Move the application frontend to a static website that is hosted on Amazon S3.
Đúng vì: Static website lý tưởng cho Amazon S3 Static Website Hosting (enable qua console/CLI, public bucket + index/error docs). Loại bỏ 2 EC2 + ALB (tiết kiệm hàng trăm USD/tháng), scale infinite, availability 99.99% (multi-AZ), kết hợp CloudFront cho low-latency global. Phù hợp serverless cost model (pay chỉ storage/requests). -
❌ Deploy the application frontend by using AWS Elastic Beanstalk. Use the same instance type for the nodes.
Sai vì: Elastic Beanstalk vẫn deploy trên EC2 managed (single/multi-instance), giữ nguyên instance type On-Demand → Không giảm chi phí (vẫn chạy 24/7 dù idle), chỉ thêm abstraction layer. Không tận dụng static nature của frontend, vi phạm yêu cầu optimize without affecting availability (vẫn phụ thuộc EC2). -
❌ Change all the backend EC2 instances to Spot Instances.
Sai vì: Spot Instances rẻ 70-90% nhưng interruption risk cao (AWS reclaim khi capacity low), đặc biệt peak lunchtime → Ảnh hưởng availability (app downtime nếu Spot evicted). Không phù hợp production backend cần stable (dù có Spot Fleet/Diversified, vẫn rủi ro), vi phạm yêu cầu rõ ràng. -
✅ Deploy the backend Python application to general purpose burstable EC2 instances that have the same number of cores as the existing EC2 instances.
Đúng vì: T3/T4g instances (burstable, unlimited mode từ 2021, cập nhật T4g Graviton 2026) cung cấp baseline CPU cho idle + burst credits cho peak (giữ cores tương đương → performance same). Tiết kiệm 40%+ vs On-Demand (CPU credits free tier), ASG + ALB đảm bảo HA. Hoàn hảo cho predictable bursty traffic.
📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2026)
- S3 Static Hosting: docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html – Cost: ~$0.023/GB + $0.0004/1k requests.
- Burstable EC2 (T3/T4g): docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html & EC2 Pricing – T4g: ~$0.0672/vCPU-hour (vs M5 ~$0.096).
- Well-Architected Cost Optimization: aws.amazon.com/architecture/well-architected – Pillar DOP-C02 exam blueprint.
- Exam DOP-C02: Q&A tương tự Sample Questions AWS (2023-2026).
🎯 Kết luận: Kết hợp S3 frontend + T-burstable backend → Cost savings 70-80%, availability unchanged! 🚀
The platform experiences infrequent high peaks in demand. The surges in demand depend on event dates.
Which solution will provide the MOST cost-effective setup for the platform?
- A Purchase Standard Reserved Instances for the EC2 instances that the EKS cluster uses in its baseline load. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet predicted peak load for the year.
- B Purchase Compute Savings Plans for the predicted medium load of the EKS cluster. Scale the cluster with On-Demand Capacity Reservations based on event dates for peaks. Purchase 1-year No Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale out database read replicas during peaks.
- C Purchase EC2 Instance Savings Plans for the predicted base load of the EKS cluster. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale up the DB instance manually during peaks.
- D Purchase Compute Savings Plans for the predicted base load of the EKS cluster. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale up the DB instance manually during peaks.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi tập trung vào việc tối ưu hóa chi phí (cost-effectiveness) cho một nền tảng bán vé sự kiện chạy trên AWS. Nền tảng hiện tại sử dụng Amazon EKS (Elastic Kubernetes Service) với Amazon EC2 làm worker nodes, kết hợp Amazon RDS for MySQL làm cơ sở dữ liệu. Công ty đang phát triển tính năng mới chạy trên EKS với AWS Fargate (mô hình serverless, không cần quản lý EC2).
Đặc điểm workload: Nhu cầu cao không thường xuyên (infrequent high peaks), phụ thuộc vào ngày sự kiện (event dates), nghĩa là có baseline load ổn định thấp và đột biến cao theo lịch sự kiện.
Mục tiêu: Chọn giải pháp TIẾT KIỆM CHI PHÍ NHẤT (MOST cost-effective) cho toàn bộ platform, bao gồm EKS cluster (EC2 + Fargate) và RDS. Giải pháp cần cân bằng giữa cam kết tiết kiệm dài hạn (như Savings Plans/Reserved Instances) cho baseline, và linh hoạt rẻ tiền cho peaks.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
Purchase Compute Savings Plans for the predicted base load of the EKS cluster. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale up the DB instance manually during peaks.
Lý do chi tiết:
- Compute Savings Plans cho baseline load của EKS cluster là lựa chọn tối ưu nhất vì nó linh hoạt áp dụng cho cả EC2 và Fargate (phù hợp với tính năng mới trên Fargate), tiết kiệm đến 66% so với On-Demand, và dễ điều chỉnh mà không bị ràng buộc instance family cụ thể như EC2 Instance Savings Plans.
- Spot Instances cho peaks: Rẻ nhất (tiết kiệm đến 90%), phù hợp workload không thường xuyên, EKS hỗ trợ Cluster Autoscaler với Spot để tự động scale.
- 1-year All Upfront Reserved Instances (RI) cho RDS base load: Tiết kiệm tối đa (đến 70%), trả trước toàn bộ để giảm chi phí dài hạn cho phần ổn định.
- Scale up DB instance manually cho peaks: RDS hỗ trợ modify instance class nhanh chóng (vài phút downtime hoặc blue/green), rẻ hơn scale out read replicas vì tránh chi phí replica thừa sau peaks.
Giải pháp này tối ưu nhất vì kết hợp cam kết linh hoạt cho EKS (hỗ trợ Fargate), Spot rẻ cho peaks, và RI mạnh cho RDS base, phù hợp workload event-based theo tài liệu AWS mới nhất (2024-2026).
📋 Giải thích chi tiết tất cả các phương án
Dưới đây là phân tích từng lựa chọn, giữ nguyên nội dung gốc bằng tiếng Anh. Tôi đánh dấu ✅ cho đúng, ❌ cho sai, và giải thích rõ lý do bằng tiếng Việt dựa trên best practices AWS DevOps.
-
❌ Phương án SAI 1:
Purchase Standard Reserved Instances for the EC2 instances that the EKS cluster uses in its baseline load. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet predicted peak load for the year.
Lý do sai: Standard Reserved Instances (RI) cho EC2 bị ràng buộc instance family/type cụ thể, kém linh hoạt khi thêm Fargate (không áp dụng RI EC2). Đặc biệt, mua RI cho peak load là lãng phí lớn vì peaks hiếm, dẫn đến underutilization cao và chi phí không tối ưu. Spot cho peaks tốt nhưng phần RI DB sai hướng. -
❌ Phương án SAI 2:
Purchase Compute Savings Plans for the predicted medium load of the EKS cluster. Scale the cluster with On-Demand Capacity Reservations based on event dates for peaks. Purchase 1-year No Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale out database read replicas during peaks.
Lý do sai: Compute Savings Plans tốt cho medium load nhưng On-Demand Capacity Reservations cho peaks rất đắt (gần bằng On-Demand, không tiết kiệm), kém hơn Spot cho workload không liên tục. No Upfront RI cho DB tiết kiệm ít hơn All Upfront (chỉ ~40% vs 70%). Scale out read replicas tốn kém vì replica duy trì sau peaks và tăng chi phí I/O. -
❌ Phương án SAI 3:
Purchase EC2 Instance Savings Plans for the predicted base load of the EKS cluster. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale up the DB instance manually during peaks.
Lý do sai: EC2 Instance Savings Plans chỉ áp dụng cho EC2 (tiết kiệm ~66%), không hỗ trợ Fargate (tính năng mới), dẫn đến chi phí cao hơn cho phần Fargate phải dùng On-Demand. Spot và RI DB tốt, scale up DB tốt, nhưng thiếu linh hoạt toàn EKS làm giải pháp kém cost-effective nhất. -
✅ Phương án ĐÚNG (như đã nêu ở trên):
Purchase Compute Savings Plans for the predicted base load of the EKS cluster. Scale the cluster with Spot Instances to handle peaks. Purchase 1-year All Upfront Reserved Instances for the database to meet the predicted base load. Temporarily scale up the DB instance manually during peaks.
Lý do đúng (tóm tắt): Linh hoạt nhất cho hybrid EKS (EC2 + Fargate), Spot rẻ cho peaks, RI mạnh cho DB base, scale up DB hiệu quả – đạt MOST cost-effective.
📘 Tài liệu tham khảo (cập nhật AWS 2024-2026)
- AWS EKS Cost Optimization: Amazon EKS Best Practices Guide - Cost Optimization Pillar – Khuyến nghị Compute Savings Plans + Spot cho variable workloads.
- Savings Plans vs Reserved Instances: AWS Compute Savings Plans – Linh hoạt cho Fargate/EKS.
- RDS Reserved Instances: Amazon RDS Pricing - Reserved Instances – All Upfront tiết kiệm max cho predictable base.
- EKS Spot Integration: Using Spot Instances in Amazon EKS.
- RDS Scaling: Amazon RDS Scaling – Manual scale-up nhanh cho peaks.
🛠️ Lời khuyên DevOps: Sử dụng AWS Cost Explorer + Compute Optimizer để dự đoán base load chính xác, và Karpenter cho EKS autoscaling Spot/Fargate tự động hóa peaks!
Each week, the company takes the application out of service for routine maintenance. During the time that the application is unavailable, the company wants visitors to receive an informational message instead of a CloudFront error message.
A solutions architect creates an Amazon S3 bucket as the first step in the process.
Which combination of steps should the solutions architect take next to meet the requirements? (Choose three.)
- A Upload static informational content to the S3 bucket.
- B Create a new CloudFront distribution. Set the S3 bucket as the origin.
- C Set the S3 bucket as a second origin in the original CloudFront distribution. Configure the distribution and the S3 bucket to use an origin access identity (OAI).
- D During the weekly maintenance, edit the default cache behavior to use the S3 origin. Revert the change when the maintenance is complete.
- E During the weekly maintenance, create a cache behavior for the S3 origin on the new distribution. Set the path pattern to \ Set the precedence to 0. Delete the cache behavior when the maintenance is complete.
- F During the weekly maintenance, configure Elastic Beanstalk to serve traffic from the S3 bucket.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh một ứng dụng được triển khai trên AWS Elastic Beanstalk (EB), sử dụng Amazon Aurora làm lớp cơ sở dữ liệu. Amazon CloudFront được cấu hình để phục vụ các yêu cầu web, với Elastic Beanstalk domain làm origin server chính. CloudFront còn có alternate domain name (CNAME tùy chỉnh) mà người dùng truy cập.
Mỗi tuần, công ty tạm dừng ứng dụng để bảo trì định kỳ. Trong thời gian này, thay vì trả về lỗi CloudFront (như 502/504 từ origin EB không khả dụng), họ muốn hiển thị thông báo thông tin tĩnh cho người dùng.
Solutions Architect đã tạo Amazon S3 bucket làm bước đầu tiên. Yêu cầu chọn 3 bước tiếp theo để đáp ứng, sử dụng cơ chế CloudFront multi-origin và cache behaviors linh hoạt, mà không làm gián đoạn domain chính.
📘 Kiến thức AWS cập nhật (tính đến 2026): CloudFront hỗ trợ nhiều origins (bao gồm S3 với Origin Access Identity - OAI hoặc Origin Access Control - OAC mới hơn), và có thể chuyển đổi origin tạm thời bằng cách chỉnh sửa default cache behavior hoặc path patterns. Không khuyến khích tạo distribution mới vì tốn thời gian propagation (có thể 15-30 phút). Elastic Beanstalk không hỗ trợ serve trực tiếp từ S3.
Nguồn tham khảo:
- AWS CloudFront Developer Guide: Multiple Origins (cập nhật OAC từ 2022).
- Elastic Beanstalk Maintenance Windows.
- CloudFront Custom Error Responses & Behaviors.
✅ Đáp án đúng (Chọn 3 phương án sau)
Các đáp án đúng tạo quy trình đơn giản, hiệu quả: Upload nội dung tĩnh vào S3, thêm S3 làm origin phụ với OAI (để bảo mật, chỉ CloudFront truy cập S3), và tạm chuyển default behavior sang S3 trong maintenance (revert sau). Điều này đảm bảo zero-downtime switch mà không cần distribution mới, propagation chậm.
Lý do chọn:
- 🔄 Tận dụng multi-origin: CloudFront cho phép switch origin nhanh chóng qua Console/API/CLI mà không ảnh hưởng DNS.
- 🛡️ OAI bảo mật: S3 bucket chỉ public cho CloudFront, tránh truy cập trực tiếp.
- ⚡ Hiệu suất cao: Nội dung tĩnh cache tốt trên CloudFront, phù hợp thông báo maintenance.
🛠️ Giải thích tất cả các phương án (Đúng/Sai)
-
Upload static informational content to the S3 bucket.
✅ Đúng. Bước cần thiết đầu tiên sau tạo bucket: Upload file HTML/JS/CSS chứa thông báo (ví dụ: index.html với "Under Maintenance"). S3 serve static content rẻ, scalable. Không upload thì không có nội dung hiển thị. -
Create a new CloudFront distribution. Set the S3 bucket as the origin.
❌ Sai. Tạo distribution mới yêu cầu thay đổi DNS/Alternate Domain Names, dẫn đến propagation chậm (15-60 phút). Không phù hợp maintenance hàng tuần; phức tạp và tốn kém hơn dùng origin phụ trên distribution hiện tại. -
Set the S3 bucket as a second origin in the original CloudFront distribution. Configure the distribution and the S3 bucket to use an origin access identity (OAI).
✅ Đúng. Thêm S3 làm origin thứ 2 (Custom Origin hoặc S3 Origin), dùng OAI (hoặc OAC mới) để bucket policy chỉ cho CloudFront truy cập (deny public). Bucket policy mẫu:Principal: {"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity...". Cho phép switch behavior mà không expose S3 public. -
During the weekly maintenance, edit the default cache behavior to use the S3 origin. Revert the change when the maintenance is complete.
✅ Đúng. Default cache behavior (precedence cao nhất cho /*) switch origin từ EB sang S3 tạm thời qua Console/CLI (Invalidation cache nếu cần). Revert nhanh chóng sau maintenance. Propagation behavior chỉ vài giây, lý tưởng cho weekly tasks. -
During the weekly maintenance, create a cache behavior for the S3 origin on the new distribution. Set the path pattern to \ Set the precedence to 0. Delete the cache behavior when the maintenance is complete.
❌ Sai. Giả định dùng distribution mới (đã sai), thêm behavior với path pattern "/*" (lỗi đánh máy "") và precedence 0 (cao nhất) để override default. Nhưng xóa behavior sau tốn thời gian validate/propagate, không hiệu quả. Distribution mới vẫn chậm. -
During the weekly maintenance, configure Elastic Beanstalk to serve traffic from the S3 bucket.
❌ Sai. EB không hỗ trợ proxy/serve trực tiếp từ S3 (EB chỉ deploy code, không thay origin động như vậy). Phải dừng EB environment thì origin EB vẫn lỗi, không giải quyết được.
💡 Kết luận: Quy trình hoàn chỉnh giúp tự động hóa qua Lambda/EventBridge cho maintenance hàng tuần nếu scale up (DevOps best practice). Test qua CLI: aws cloudfront update-distribution.
The Lambda function accepts image processing parameters by using environment variables. The company often adjusts the environment variables of the Lambda function to achieve optimal image processing output. The company tests different parameters and publishes a new function version with the updated environment variables after validating results. This update process also requires frequent changes to the custom application to invoke the new function version ARN. These changes cause interruptions for users.
A solutions architect needs to simplify this process to minimize disruption to users.
Which solution will meet these requirements with the LEAST operational overhead?
- A Directly modify the environment variables of the published Lambda function version. Use the SLATEST version to test image processing parameters.
- B Create an Amazon DynamoDB table to store the image processing parameters. Modify the Lambda function to retrieve the image processing parameters from the DynamoDB table.
- C Directly code the image processing parameters within the Lambda function and remove the environment variables. Publish a new function version when the company updates the parameters.
- D Create a Lambda function alias. Modify the client application to use the function alias ARN. Reconfigure the Lambda alias to point to new versions of the function when the company finishes testing.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một tình huống thực tế trong AWS:
Một công ty cho phép người dùng upload hình ảnh từ ứng dụng tùy chỉnh. Quá trình upload kích hoạt một AWS Lambda function để xử lý hình ảnh và lưu vào Amazon S3 bucket. Ứng dụng invoke Lambda bằng specific function version ARN (ARN của phiên bản cụ thể).
🔍 Vấn đề chính:
- Lambda nhận tham số xử lý hình ảnh qua environment variables.
- Công ty thường xuyên điều chỉnh env vars để tối ưu output, test rồi publish version mới với env vars cập nhật.
- Mỗi lần update, phải thay đổi ARN trong ứng dụng client, gây gián đoạn cho người dùng (interruptions).
🎯 Yêu cầu: Solutions Architect cần giải pháp đơn giản hóa quy trình, giảm thiểu gián đoạn cho user, với LEAST operational overhead (ít công vận hành nhất).
Giải pháp lý tưởng phải tránh thay đổi ARN trong app client thường xuyên, cho phép test version mới mà không ảnh hưởng production, và dễ dàng switch sang version đã test.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a Lambda function alias. Modify the client application to use the function alias ARN. Reconfigure the Lambda alias to point to new versions of the function when the company finishes testing.
Lý do:
- 🛠️ Lambda aliases (bí danh) cho phép tạo một "pointer" (con trỏ) đến specific version của function. App client chỉ cần invoke alias ARN (ví dụ:
arn:aws:lambda:region:account:function:myfunction:PROD), không cần biết version cụ thể. - Quy trình: Test version mới (ví dụ: $LATEST hoặc version number), sau khi validate, reconfigure alias để point sang version mới mà KHÔNG thay đổi code app.
- ✅ Least operational overhead: Chỉ cần update alias qua AWS Console/CLI/API (1 lệnh), không deploy lại app, không gián đoạn user. Hoàn toàn phù hợp best practice AWS Lambda blue-green deployment.
- 📈 Kiến thức cập nhật 2026: Lambda aliases hỗ trợ weighted traffic shifting (từ 2023+), tích hợp với Lambda Provisioned Concurrency, đảm bảo zero-downtime.
📘 Tài liệu tham khảo:
- AWS Lambda Versions and Aliases (cập nhật 2025).
- Lambda Aliases for Traffic Shifting.
❌ Giải thích tất cả các phương án (đúng/sai)
-
Phương án 1: Directly modify the environment variables of the published Lambda function version. Use the SLATEST version to test image processing parameters.
❌ Sai vì: Không thể modify env vars của published version (immutable - không thay đổi được). Chỉ edit được trên$LATEST. Việc dùng$LATESTcho testing production gây rủi ro instability, không giải quyết vấn đề thay đổi ARN app, vẫn gián đoạn user. Overhead cao do phải publish version mới thường xuyên. -
Phương án 2: Create an Amazon DynamoDB table to store the image processing parameters. Modify the Lambda function to retrieve the image processing parameters from the DynamoDB table.
❌ Sai vì: Externalize params sang DynamoDB linh hoạt (update DB mà không redeploy Lambda), nhưng vẫn cần publish version mới nếu code Lambda thay đổi để đọc DB, và app vẫn invoke specific ARN → vẫn phải update app. Overhead: Quản lý DB (provisioning, IAM, cost), polling DB tăng latency. Không minimize disruption. -
Phương án 3: Directly code the image processing parameters within the Lambda function and remove the environment variables. Publish a new function version when the company updates the parameters.
❌ Sai vì: Hardcode params vào code làm Lambda ít linh hoạt hơn, mỗi update phải recode + publish version mới, vẫn yêu cầu thay đổi ARN app → gián đoạn lớn hơn. Overhead cao: Redeploy code thường xuyên, test toàn bộ function. Không khuyến khích (vi phạm separation of config). -
Phương án 4 (Đúng - đã giải thích ở trên): Create a Lambda function alias. Modify the client application to use the function alias ARN. Reconfigure the Lambda alias to point to new versions of the function when the company finishes testing.
✅ Đúng vì: Alias làm "middleware" giữa app và versions, chỉ update alias backend (atomic operation), zero-downtime, least overhead. Hoàn hảo cho CI/CD pipeline.
🛡️ Kết luận: Giải pháp alias là best practice cho Lambda versioning, giảm operational burden theo DevOps principles (Infrastructure as Code với AWS SAM/CDK).
Which solution will meet these requirements with the LEAST effort?
- A Migrate public DNS to Amazon Route 53. Create CNAME records for the apex domain to point to the ALB. Use a geolocation routing policy to route traffic based on user location.
- B Place a Network Load Balancer (NLB) in front of the ALMigrate public DNS to Amazon Route 53. Create a CNAME record for the apex domain to point to the NLB’s static IP address. Use a geolocation routing policy to route traffic based on user location.
- C Create an AWS Global Accelerator accelerator with multiple endpoint groups that target endpoints in appropriate AWS Regions. Use the accelerator’s static IP address to create a record in public DNS for the apex domain.
- D Create an Amazon API Gateway API that is backed by AWS Lambda in one of the AWS Regions. Configure a Lambda function to route traffic to application deployments by using the round robin method. Create CNAME records for the apex domain to point to the API's URL.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh việc triển khai ứng dụng multi-Region cho một công ty truyền thông toàn cầu, sử dụng Amazon DynamoDB global tables để đảm bảo dữ liệu nhất quán trải nghiệm người dùng trên hai châu lục. Mỗi Region có public Application Load Balancer (ALB). Công ty quản lý public DNS nội bộ (không dùng Route 53 sẵn). Yêu cầu chính: Làm ứng dụng khả dụng qua apex domain (ví dụ: example.com, không phải subdomain) với LEAST effort (ít công sức nhất).
🔑 Thách thức chính:
- Apex domain chỉ hỗ trợ A record hoặc ALIAS record (không hỗ trợ CNAME trực tiếp ở DNS chuẩn).
- Cần routing dựa trên vị trí địa lý (geolocation) để tối ưu traffic giữa các Region/continents.
- Giữ nguyên DNS nội bộ (không migrate sang Route 53 nếu không cần).
- Sử dụng kiến thức AWS cập nhật 2026: AWS Global Accelerator (v2 với hỗ trợ tốt hơn cho static IP Anycast, endpoint groups linh hoạt) là giải pháp tối ưu cho global traffic steering với low latency.
✅ Đáp án đúng: Tạo AWS Global Accelerator accelerator với multiple endpoint groups nhắm đến endpoints ở các Region phù hợp. Sử dụng static IP của accelerator để tạo record trong public DNS cho apex domain.
Lý do lựa chọn 🛠️:
- Global Accelerator cung cấp 2 static IP Anycast (Anycast từ Edge Locations toàn cầu), hỗ trợ A record trực tiếp cho apex domain mà không cần migrate DNS sang Route 53.
- Tự động routing traffic dựa trên geolocation/health của endpoints (ALB ở các Region), giảm latency 60% so ALB trực tiếp.
- Least effort: Chỉ cần tạo accelerator, thêm endpoint groups (target ALB), cập nhật 1 A record ở DNS nội bộ. Không phức tạp, scale tự động.
- Hỗ trợ multi-Region seamless với DynamoDB global tables.
📋 Giải thích tất cả các phương án
-
❌ [SAI] Migrate public DNS to Amazon Route 53. Create CNAME records for the apex domain to point to the ALB. Use a geolocation routing policy to route traffic based on user location.
Phương án này sai hoàn toàn vì: Apex domain không hỗ trợ CNAME (DNS chuẩn chỉ cho A/AAAA record). ALB DNS không static (thay đổi), migrate DNS sang Route 53 mất effort lớn (chuyển zone, TTL). Geolocation policy tốt nhưng không giải quyết apex issue. Phức tạp hơn cần thiết. -
❌ [SAI] Place a Network Load Balancer (NLB) in front of the ALB. Migrate public DNS to Amazon Route 53. Create a CNAME record for the apex domain to point to the NLB’s static IP address. Use a geolocation routing policy to route traffic based on user location.
Sai ở nhiều điểm: NLB có static IP (IPv4/IPv6) nhưng CNAME không dùng cho IP (phải A record). Đặt NLB trước ALB tăng complexity/latency, vẫn cần migrate DNS (effort cao). Geolocation ở Route 53 ok nhưng không optimal cho global (chỉ Region-level), không least effort. -
✅ [ĐÚNG] Create an AWS Global Accelerator accelerator with multiple endpoint groups that target endpoints in appropriate AWS Regions. Use the accelerator’s static IP address to create a record in public DNS for the apex domain.
Đúng 100% như đã giải thích: Static IP Anycast hỗ trợ A record apex, routing intelligent (geo/health/closest), tích hợp ALB trực tiếp, không migrate DNS, least operational effort. Lý tưởng cho multi-Region media app cao traffic. -
❌ [SAI] Create an Amazon API Gateway API that is backed by AWS Lambda in one of the AWS Regions. Configure a Lambda function to route traffic to application deployments by using the round robin method. Create CNAME records for the apex domain to point to the API's URL.
Sai cơ bản: API Gateway + Lambda dành cho API, không phù hợp web app full (ALB backend). Round robin không geo-aware (latency cao, không consistent UX). Apex domain lại CNAME issue, single Region bottleneck. Effort cao (code Lambda, manage scaling), vi phạm least effort.
📘 Tài liệu tham khảo (AWS Docs cập nhật 2026)
- AWS Global Accelerator: docs.aws.amazon.com/global-accelerator/latest/dg/what-is-global-accelerator.html – Static IPs & apex domain support.
- Route 53 Apex Records: docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html – Xác nhận no CNAME for apex.
- DynamoDB Global Tables: docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html – Tích hợp multi-Region.
- DevOps Pro Exam Guide: aws.amazon.com/certification/certified-devops-engineer-professional/ – Topic DOP-C02: Global services.
Hy vọng phân tích này giúp bạn ôn thi hiệu quả! 🚀 Nếu cần thêm case study, hỏi nhé!
A solutions architect needs to simplify the deployment of the solution and optimize for code reuse.
Which solution will meet these requirements?
- A Deploy the shared libraries and custom classes into a Docker image. Store the image in an S3 bucket. Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
- B Deploy the shared libraries and custom classes to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
- C Deploy the shared libraries and custom classes to a Docker container in Amazon Elastic Container Service (Amazon ECS) by using the AWS Fargate launch type. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the deployed container as a Lambda layer.
- D Deploy the shared libraries, custom classes, and code for the API's Lambda functions to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Configure the API's Lambda functions to use the Docker image as the deployment package.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
📘 Câu hỏi mô tả tình huống: Một công ty đang xây dựng API serverless mới sử dụng Amazon API Gateway kết nối với AWS Lambda. Các hàm Lambda được tích hợp để sử dụng shared libraries (thư viện chia sẻ) và custom classes (các lớp tùy chỉnh). Nhiệm vụ của Solutions Architect là đơn giản hóa việc triển khai (simplify deployment) và tối ưu hóa tái sử dụng code (optimize for code reuse).
🛠️ Yêu cầu cốt lõi:
- Serverless: Tập trung vào Lambda (không quản lý server).
- Code reuse: Shared libraries/custom classes cần được chia sẻ giữa các Lambda functions.
- Deployment đơn giản: Giảm phức tạp, dễ quản lý package.
- Kiến thức cập nhật AWS 2026: Lambda hỗ trợ container images (từ 2020, dung lượng lên 10GB), Lambda Layers cho reuse code (zip-based, không hỗ trợ Docker trực tiếp làm layer), ECR cho lưu trữ image. Không thay đổi lớn ở phiên bản mới nhất.
Mục tiêu: Tìm giải pháp đóng gói shared code + Lambda code, deploy dễ dàng, reuse tối ưu mà không vi phạm hạn chế AWS.
✅ Đáp án đúng
Deploy the shared libraries, custom classes, and code for the API's Lambda functions to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Configure the API's Lambda functions to use the Docker image as the deployment package.
Lý do chọn đáp án này 🏆:
- ✅ Tối ưu code reuse: Toàn bộ shared libraries, custom classes và code Lambda được đóng gói chung vào một Docker image duy nhất → Tất cả functions dùng chung image, tránh duplicate code.
- ✅ Đơn giản hóa deployment: Chỉ build/upload một image lên ECR (registry native AWS), rồi config Lambda dùng image làm deployment package (container image support từ Lambda 2020+). Không cần layer riêng, zip files phức tạp.
- 🛠️ Tuân thủ AWS best practices 2026: Lambda container images hỗ trợ đầy đủ runtime (Node.js, Python,...), tích hợp API Gateway seamless. Dung lượng lớn (10GB), phù hợp shared libs lớn.
- 📈 Lợi ích: CI/CD dễ (ECR + CodeBuild), versioning image tốt hơn zip/layer.
Nguồn tham khảo 📚:
- AWS Docs: Lambda Container Images (cập nhật 2025).
- Lambda Deployment Packages.
🔍 Giải thích tất cả các phương án (đúng/sai)
Dưới đây là phân tích từng phương án một với lý do chính xác dựa trên tính năng AWS mới nhất. Giữ nguyên văn bản gốc tiếng Anh, chỉ giải thích bằng tiếng Việt.
-
Phương án 1 ❌:
Deploy the shared libraries and custom classes into a Docker image. Store the image in an S3 bucket. Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
Sai vì: Lambda Layers KHÔNG hỗ trợ Docker image làm source (chỉ chấp nhận .zip file với cấu trúc thư mục cụ thể nhưnodejs/node_modules). S3 lưu image không phải cách chuẩn (ECR mới đúng). Deploy Lambda as zip + layer vẫn phức tạp, không đơn giản hóa. Vi phạm hạn chế Layers (2026: vẫn zip-only). -
Phương án 2 ❌:
Deploy the shared libraries and custom classes to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Create a Lambda layer that uses the Docker image as the source. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the Lambda layer.
Sai vì: Dù ECR đúng cho image, nhưng Lambda Layers vẫn KHÔNG dùng Docker image làm source (phải unzip/extract). Shared code chỉ ở layer, Lambda code riêng zip → Không reuse tối ưu toàn bộ, deployment 2 bước phức tạp. AWS không hỗ trợ (xem Layers docs: chỉ zip/ARN). -
Phương án 3 ❌:
Deploy the shared libraries and custom classes to a Docker container in Amazon Elastic Container Service (Amazon ECS) by using the AWS Fargate launch type. Deploy the API's Lambda functions as Zip packages. Configure the packages to use the deployed container as a Lambda layer.
Sai vì: ECS Fargate là managed containers, KHÔNG thể dùng làm Lambda Layer (Layers chỉ zip/ECR cho Lambda images, không phải ECS service). Lambda không kết nối trực tiếp ECS như layer → Không serverless thuần, chi phí cao, deployment rối (2 services riêng). Vi phạm nguyên tắc serverless. -
Phương án 4 ✅:
Deploy the shared libraries, custom classes, and code for the API's Lambda functions to a Docker image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Configure the API's Lambda functions to use the Docker image as the deployment package.
Đúng vì: Như giải thích ở phần ✅ trên. Đây là best practice AWS cho code reuse lớn + deployment đơn giản (single image cho tất cả). Hỗ trợ full 2026.
Kết luận 🎯: Giải pháp đúng tận dụng Lambda Container Images để simplify + reuse tối đa, tránh hạn chế Layers. Nếu implement, dùng SAM/ECR integration cho CI/CD! 🚀
The company wants to provide local feedback to factory workers when a defect is detected. The company must be able to provide this feedback even if the factory’s internet connectivity is down. The company has a local Linux server that hosts an API that provides local feedback to the workers.
How should the company deploy the ML model to meet these requirements?
- A Set up an Amazon Kinesis video stream from each IP camera to AWS. Use Amazon EC2 instances to take still images of the streams. Upload the images to an Amazon S3 bucket. Deploy a SageMaker endpoint with the ML model. Invoke an AWS Lambda function to call the inference endpoint when new images are uploaded. Configure the Lambda function to call the local API when a defect is detected.
- B Deploy AWS IoT Greengrass on the local server. Deploy the ML model to the Greengrass server. Create a Greengrass component to take still images from the cameras and run inference. Configure the component to call the local API when a defect is detected.
- C Order an AWS Snowball device. Deploy a SageMaker endpoint the ML model and an Amazon EC2 instance on the Snowball device. Take still images from the cameras. Run inference from the EC2 instance. Configure the instance to call the local API when a defect is detected.
- D Deploy Amazon Monitron devices on each IP camera. Deploy an Amazon Monitron Gateway on premises. Deploy the ML model to the Amazon Monitron devices. Use Amazon Monitron health state alarms to call the local API from an AWS Lambda function when a defect is detected.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống thực tế của một công ty sản xuất 🏭:
Họ đang xây dựng giải pháp kiểm tra lỗi sản phẩm tại nhà máy với các IP camera đặt ở cuối mỗi dây chuyền lắp ráp. Công ty đã sử dụng Amazon SageMaker để huấn luyện mô hình ML nhận diện lỗi phổ biến từ ảnh tĩnh (still images).
Yêu cầu chính cần đáp ứng:
- Cung cấp phản hồi cục bộ (local feedback) ngay lập tức cho công nhân nhà máy khi phát hiện lỗi.
- Phải hoạt động ngay cả khi mất kết nối internet (offline mode).
- Có sẵn một máy chủ Linux cục bộ (local Linux server) đang host API cục bộ để gửi feedback cho công nhân.
Mục tiêu: Deploy mô hình ML sao cho có thể chụp ảnh tĩnh từ camera, chạy inference cục bộ (local inference), và gọi API local khi phát hiện lỗi, không phụ thuộc cloud để đảm bảo tính liên tục.
Đây là bài kiểm tra kiến thức về edge computing và ML inference tại chỗ trên AWS, đặc biệt với các dịch vụ hỗ trợ offline deployment (cập nhật đến 2026: AWS IoT Greengrass v2.x hỗ trợ SageMaker Neo cho ML models với inference optimized).
📘 Tài liệu tham khảo:
- AWS IoT Greengrass Documentation (Machine Learning Inference).
- Amazon SageMaker Edge Manager (cho edge deployment).
- AWS Well-Architected Framework: Edge pillar (2024 update).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Deploy AWS IoT Greengrass on the local server. Deploy the ML model to the Greengrass server. Create a Greengrass component to take still images from the cameras and run inference. Configure the component to call the local API when a defect is detected.
Lý do chi tiết 🛠️:
- AWS IoT Greengrass là giải pháp edge runtime lý tưởng cho môi trường on-premises/offline, deploy trực tiếp lên local Linux server.
- Hỗ trợ deploy SageMaker ML model (qua SageMaker Neo compiler) để chạy local inference mà không cần internet sau khi deploy ban đầu.
- Có thể tạo custom Greengrass component (Lambda hoặc container-based) để: chụp ảnh tĩnh từ IP camera, chạy inference, và gọi local API ngay lập tức khi phát hiện lỗi.
- Đáp ứng đầy đủ: Local processing, offline capable, tận dụng server sẵn có. Không có độ trễ cloud hay phụ thuộc kết nối.
✅ Hoàn hảo cho yêu cầu! (Greengrass v2 hỗ trợ ML inference với TensorFlow, PyTorch, ONNX đến 2026).
📋 Giải thích tất cả các phương án (đúng/sai)
-
❌ Phương án SAI: Set up an Amazon Kinesis video stream from each IP camera to AWS. Use Amazon EC2 instances to take still images of the streams. Upload the images to an Amazon S3 bucket. Deploy a SageMaker endpoint with the ML model. Invoke an AWS Lambda function to call the inference endpoint when new images are uploaded. Configure the Lambda function to call the local API when a defect is detected.
Lý do sai: Toàn bộ quy trình phụ thuộc cloud services (Kinesis, EC2, S3, SageMaker endpoint, Lambda) → Yêu cầu internet liên tục để stream video, upload ảnh, chạy inference. Khi mất net, không thể xử lý local → Không đáp ứng "feedback ngay cả khi down internet". Độ trễ cao do round-trip cloud. -
✅ Phương án ĐÚNG: Deploy AWS IoT Greengrass on the local server. Deploy the ML model to the Greengrass server. Create a Greengrass component to take still images from the cameras and run inference. Configure the component to call the local API when a defect is detected.
Lý do đúng: (Như phần trên) Edge deployment hoàn chỉnh trên local server, hỗ trợ offline inference với custom component. Tích hợp SageMaker model seamless, gọi API local tức thì. -
❌ Phương án SAI: Order an AWS Snowball device. Deploy a SageMaker endpoint the ML model and an Amazon EC2 instance on the Snowball device. Take still images from the cameras. Run inference from the EC2 instance. Configure the instance to call the local API when a defect is detected.
Lý do sai: AWS Snowball là thiết bị data transfer edge (như Snowball Edge), không phải giải pháp liên tục/permanent cho production. SageMaker endpoint không deploy trực tiếp lên Snowball (hỗ trợ ML inference limited qua EC2 on Edge, nhưng phức tạp và không optimized cho real-time camera). Snowball dùng cho batch transfer, không scale cho nhiều camera lâu dài → Không phù hợp local server sẵn có. -
❌ Phương án SAI: Deploy Amazon Monitron devices on each IP camera. Deploy an Amazon Monitron Gateway on premises. Deploy the ML model to the Amazon Monitron devices. Use Amazon Monitron health state alarms to call the local API from an AWS Lambda function when a defect is detected.
Lý do sai: Amazon Monitron dành cho predictive maintenance dựa vibration/sensor (không phải IP camera/video). Không hỗ trợ custom SageMaker ML model hay xử lý ảnh tĩnh từ camera. Alarms gọi Lambda (cloud-dependent) → Không offline, không phù hợp visual inspection.
Kết luận 💡: Greengrass là lựa chọn optimal cho hybrid edge ML trên AWS, đảm bảo resiliency và low-latency local feedback! Nếu deploy thực tế, dùng greengrass-cli để build component. 🚀