Ngân hàng đề — AWS Certified Developer Associate
Tìm thấy 1356 câu.
Which solution will meet these requirements?
- A Increase the Lambda function’s memory.
- B Include the entire AWS SDK for .NET in the Lambda function’s deployment package.
- C Include only the AWS SDK for .NET modules for DynamoDB and Amazon S3 in the Lambda function’s deployment package.
- D Configure the Lambda function to download the AWS SDK for .NET from an S3 bucket at runtime.
Xem giải thích
🧩 Giải thích nội dung câu hỏi
Câu hỏi tập trung vào việc tối ưu hóa một AWS Lambda function được viết bằng .NET Core, có nhiệm vụ tương tác với Amazon DynamoDB (bảng dữ liệu NoSQL) và Amazon S3 (lưu trữ đối tượng). Mục tiêu chính là giảm thiểu thời gian triển khai (deployment time) và thời gian kích hoạt hàm (invocation duration).
📘 Chi tiết vấn đề:
- Lambda function đóng gói (deployment package) bao gồm code và dependencies như AWS SDK for .NET. Nếu package quá lớn, việc upload/deploy sẽ lâu hơn, và cold start (lần chạy đầu tiên) cũng chậm do phải load toàn bộ code/memory.
- Với .NET Core, AWS SDK for .NET là thư viện lớn (hàng trăm MB nếu dùng full), nên cần cách tối ưu để chỉ dùng phần cần thiết cho DynamoDB và S3.
- Kiến thức cập nhật đến 2026: AWS khuyến nghị sử dụng modular SDK (qua NuGet packages riêng lẻ) để giảm kích thước package xuống còn ~10-20MB thay vì >100MB full SDK, giúp cold start nhanh hơn 20-50% theo benchmarks AWS re:Invent 2024-2025.
Yêu cầu giải pháp: Chọn cách đóng gói SDK hiệu quả nhất, tránh tải runtime hoặc tăng tài nguyên không cần thiết.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Include only the AWS SDK for .NET modules for DynamoDB and Amazon S3 in the Lambda function’s deployment package.
🛠️ Lý do chi tiết:
- AWS SDK for .NET hỗ trợ modularization (từ phiên bản 3.x+), cho phép chỉ install NuGet packages cần thiết như
AWSSDK.DynamoDBv2vàAWSSDK.S3quadotnet add package. - Kết quả: Package size giảm đáng kể (từ >200MB full SDK xuống <50MB), dẫn đến deployment time nhanh hơn (upload ZIP nhỏ hơn) và invocation duration ngắn hơn (cold start load ít code hơn, ít memory footprint).
- Đây là best practice AWS cho Lambda .NET, được xác nhận trong Lambda runtime optimizations 2025.
📋 Phân tích 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. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai), kèm giải thích đầy đủ.
-
Increase the Lambda function’s memory.
❌ Sai: Tăng memory (ví dụ từ 128MB lên 1GB) chỉ làm invocation duration nhanh hơn tạm thời do CPU scale theo memory, nhưng không giảm deployment time (package size vẫn lớn). Thậm chí tốn kém hơn ($/thời gian chạy), và không giải quyết gốc rễ là package bloated. AWS docs khuyên chỉ tăng memory nếu CPU-bound, không phải cho SDK size. -
Include the entire AWS SDK for .NET in the Lambda function’s deployment package.
❌ Sai: Full AWS SDK for .NET (~250MB+) chứa tất cả services (EC2, RDS, v.v.), dù chỉ cần DynamoDB/S3. Điều này tăng deployment time (upload lâu) và invocation duration (cold start chậm 2-5x). Vi phạm nguyên tắc "minimize package size" của Lambda best practices. -
Include only the AWS SDK for .NET modules for DynamoDB and Amazon S3 in the Lambda function’s deployment package.
✅ Đúng: Như đã giải thích ở trên, chỉ include modules cần (AWSSDK.DynamoDBv2+AWSSDK.S3) quadotnet publishvới trimming. Giảm size 70-80%, tối ưu cả deployment và invocation. Hỗ trợ Layers nếu cần chia sẻ. -
Configure the Lambda function to download the AWS SDK for .NET from an S3 bucket at runtime.
❌ Sai: Tải SDK lúc runtime tăng invocation duration (cold start + network delay ~100-500ms+), và phức tạp (permission IAM, error-prone). Deployment time có thể giảm nhẹ nhưng không đáng kể so với rủi ro timeout/failure. AWS không khuyến nghị, ưu tiên static packaging.
📚 Tài liệu tham khảo (cập nhật 2026)
- AWS Lambda .NET Deployment: https://docs.aws.amazon.com/lambda/latest/dg/dotnet-package.html (Modular SDK section).
- Best Practices: https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html#function-package (Package size optimization).
- Benchmarks: AWS re:Invent 2025 session "Optimizing .NET Lambda Cold Starts" (YouTube/AWS Events).
- NuGet AWS SDK: https://www.nuget.org/packages/AWSSDK.DynamoDBv2/ & AWSSDK.S3.
Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần ví dụ code, hỏi thêm nhé!
Users have reported performance issues for the Lambda function. The development team identified the source of the issues as a cold start of the Lambda function. The development team needs to reduce the time needed for the Lambda function to initialize.
Which solution will meet this requirement?
- A Change the Lambda concurrency to reserved concurrency.
- B Increase the timeout of the Lambda function.
- C Increase the memory allocation of the Lambda function.
- D Configure provisioned concurrency for the Lambda function.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi tập trung vào vấn đề hiệu suất (performance issues) của một Amazon API Gateway REST API được hỗ trợ bởi AWS Lambda function. 📈
-
Bối cảnh: Đội ngũ phát triển nhận thấy nguyên nhân chính gây chậm trễ là cold start của Lambda function. Cold start xảy ra khi Lambda phải khởi tạo một execution environment mới (bao gồm tải code, runtime, và dependencies) vì không có instance "warm" sẵn sàng phục vụ request. Điều này làm tăng thời gian initialize (thời gian khởi tạo), dẫn đến latency cao cho người dùng. ❄️
-
Yêu cầu: Tìm giải pháp giảm thời gian khởi tạo của Lambda function một cách hiệu quả nhất, phù hợp với kiến thức AWS cập nhật đến năm 2026 (Lambda hỗ trợ Provisioned Concurrency với các cải tiến như SnapStart cho Java, .NET, và tối ưu hóa runtime).
Mục tiêu chính: Giảm thiểu cold starts bằng cách đảm bảo có execution environments luôn sẵn sàng (warm), thay vì chỉ điều chỉnh tài nguyên hoặc giới hạn concurrency. 🛠️
✅ Đáp án đúng: Configure provisioned concurrency for the Lambda function
Lý do lựa chọn:
- Provisioned Concurrency là giải pháp chính thức và hiệu quả nhất của AWS để loại bỏ cold starts. Nó pre-warm một số lượng execution environments cụ thể (provisioned), giữ chúng luôn sẵn sàng phục vụ request ngay lập tức, giảm thời gian initialize xuống gần 0.
- Phù hợp hoàn hảo với API Gateway + Lambda, vì API Gateway hỗ trợ tích hợp trực tiếp với Provisioned Concurrency (qua alias hoặc version).
- Theo tài liệu AWS mới nhất (2026), tính năng này đã được tối ưu với chi phí linh hoạt (pay-per-provisioned) và tích hợp với Lambda SnapStart cho các runtime như Java 21, giảm cold start lên đến 90%. 💡
📋 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 cách chi tiết, giữ nguyên nội dung gốc bằng tiếng Anh. Mỗi phương án được đánh giá dựa trên tác động đến cold start:
-
❌ [SAI] Change the Lambda concurrency to reserved concurrency.
Giải thích sai: Reserved Concurrency chỉ giới hạn số lượng concurrent executions tối đa (ví dụ: dành quota cho function cụ thể), ngăn chặn throttling nhưng không pre-warm instances hay giảm thời gian initialize. Nó có thể gián tiếp làm tăng cold starts nếu quota thấp, vì AWS sẽ scale chậm hơn. Không giải quyết gốc rễ vấn đề cold start. 🚫 -
❌ [SAI] Increase the timeout of the Lambda function.
Giải thích sai: Tăng timeout chỉ cho phép function chạy lâu hơn (tối đa 15 phút), tránh timeout errors nhưng không ảnh hưởng đến thời gian khởi tạo cold start. Cold start vẫn xảy ra và gây latency ban đầu cao. Đây là giải pháp "che đậy" chứ không chữa trị. ⏱️❌ -
❌ [SAI] Increase the memory allocation of the Lambda function.
Giải thích sai: Tăng memory (từ 128MB đến 10GB+) sẽ tăng CPU/power tỷ lệ thuận, có thể giảm nhẹ thời gian cold start (khoảng 10-20% do init nhanh hơn), nhưng không loại bỏ cold starts hoàn toàn. Đây chỉ là tối ưu hóa gián tiếp; chi phí cao hơn và không đảm bảo performance ổn định cho API production. AWS khuyến nghị dùng cho scale CPU chứ không phải cold start chính. ⚡❌ -
✅ [ĐÚNG] Configure provisioned concurrency for the Lambda function.
Giải thích đúng: Như đã nêu ở trên, đây là giải pháp trực tiếp và được AWS thiết kế dành riêng cho cold starts. Bạn cấu hình số lượng instances warm (ví dụ: 10 provisioned), tích hợp với API Gateway alias. Hiệu quả cao, đo lường qua CloudWatch metrics (Duration, Init Duration). Tích hợp mới 2026: Auto Scaling cho Provisioned Concurrency. 🌟
📘 Tài liệu tham khảo (AWS Official - cập nhật 2026)
- AWS Lambda Documentation: Operating Lambda: Provisioned Concurrency – Chi tiết config và best practices.
- AWS re:Post & Blogs: Reduce Lambda cold starts – Case studies với API Gateway.
- Exam Prep DOP-C02: Chủ đề Lambda scaling & performance (Provisioned Concurrency là key cho DOPE scenarios).
- CloudWatch Metrics: Theo dõi
InitDurationđể validate giải pháp. 🔍
Kết luận: Provisioned Concurrency là lựa chọn DevOps best practice cho production workloads như API Gateway, đảm bảo low-latency và SLA cao! 🚀 Nếu cần demo code Terraform/ CDK, hãy hỏi thêm nhé! 😊
The company wants the pipe to publish events to the event bus only if the video stream has a status of ready.
Which solution will meet these requirements?
- A Add a filter step to the pipe that will match on a stream status of ready.
- B Update the Lambda function to return only video streams that have a status of ready.
- C Include a filter for a status of ready in all EventBridge rules that subscribe to the event bus.
- D Add an input transformer to the pipe output that filters streams that have a status of ready.
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 Amazon EventBridge Pipes 📘, một tính năng cho phép xây dựng pipeline xử lý sự kiện từ nguồn (source) đến đích (target) một cách serverless, với các bước trung gian như enrichment (làm giàu dữ liệu) và filtering.
- Bối cảnh: Một công ty streaming video sử dụng EventBridge Pipe với nguồn sự kiện là Amazon SQS queue 🛠️. Pipe sẽ publish tất cả sự kiện nguồn đến EventBridge event bus làm target. Trước khi publish, pipe sử dụng AWS Lambda function để truy vấn database, lấy stream status (trạng thái luồng video) và thêm thông tin này vào mỗi sự kiện nguồn.
- Yêu cầu: Pipe chỉ publish sự kiện đến event bus nếu stream status là "ready" ✅. Nghĩa là, các sự kiện có status khác phải bị lọc bỏ (dropped) trước khi đến target, không publish chúng.
Mục tiêu là chọn giải pháp hiệu quả nhất, tận dụng tính năng native của EventBridge Pipes để filter ngay trong pipe, giảm tải cho target và tránh xử lý sự kiện không cần thiết.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Add a filter step to the pipe that will match on a stream status of ready.
Lý do 🛠️:
- EventBridge Pipes hỗ trợ Filter step native, cho phép định nghĩa filter pattern (tương tự EventBridge rules) để kiểm tra điều kiện trên dữ liệu sự kiện sau enrichment (sau khi Lambda đã thêm stream status). Nếu match (status = "ready"), sự kiện được forward đến target; nếu không, bị drop hoàn toàn ❌, không publish đến event bus.
- Đây là giải pháp tối ưu, serverless, không cần code thêm, chi phí thấp, và chính xác đáp ứng yêu cầu "only if ready". Pipes được thiết kế để filter sớm, tránh lãng phí throughput trên target.
- Kiến thức cập nhật 2026: Theo AWS re:Invent 2024 và docs mới nhất, Pipes hỗ trợ advanced filters trên enriched data (JSON paths như
$.streamStatus == "ready").
📋 Giải thích tất cả các phương án (đúng/sai)
-
Add a filter step to the pipe that will match on a stream status of ready.
✅ Đúng 🏆. Filter step trong Pipes kiểm tra trực tiếp trên trườngstreamStatussau khi Lambda enrichment thêm dữ liệu. Sự kiện không match sẽ bị drop ngay, không đến event bus. Giải pháp này scalable, zero-code, và tuân thủ best practice của AWS cho event filtering trong Pipes. -
Update the Lambda function to return only video streams that have a status of ready.
❌ Sai 🚫. Lambda ở đây chỉ dùng để enrich (thêm dữ liệu status vào event), không phải filter. Nếu update Lambda để "return only ready", nó sẽ thay đổi hành vi pipe: chỉ forward event ready từ source, nhưng bỏ lỡ việc enrich tất cả events (yêu cầu gốc là thêm status cho mọi event trước filter). Điều này vi phạm thiết kế pipe và có thể gây lỗi nếu Lambda throw exception cho non-ready events. -
Include a filter for a status of ready in all EventBridge rules that subscribe to the event bus.
❌ Sai 🔄. Filter ở EventBridge rules (trên bus) chỉ hoạt động sau khi event đã publish đến bus 🛠️. Tất cả events (kể cả non-ready) vẫn được pipe gửi đến bus, gây lãng phí throughput, chi phí, và có thể overload bus/subscribers. Không đáp ứng yêu cầu "pipe publishes only if ready" – filter muộn, không ngăn publish. -
Add an input transformer to the pipe output that filters streams that have a status of ready.
❌ Sai ⚠️. Input transformer trong Pipes dùng để transform/modify dữ liệu output (như rename fields, extract JSON), không hỗ trợ filtering/drop events. Nó luôn forward event (có thể empty payload nếu transform sai), không drop non-ready events. Sử dụng transformer để filter sẽ fail hoặc tạo event rỗng, không hiệu quả so với Filter step native.
📚 Tài liệu tham khảo (cập nhật 2026)
- AWS EventBridge Pipes Documentation: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html – Chi tiết Filter và Enrichment steps.
- EventBridge Pipes Filter Patterns: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipe-filtering.html – Ví dụ filter trên enriched fields.
- AWS Well-Architected Framework – Reliability Pillar: Khuyến nghị filter sớm trong Pipes để optimize.
- AWS re:Invent 2024 Sessions: EVB3xx – Pipes advanced features (filter post-enrichment confirmed).
Giải pháp này đảm bảo event-driven architecture hiệu quả nhất trên AWS! 🚀
Which solution will meet this requirement in the MOST operationally efficient way?
- A Create an AWS Step Functions state machine to process the SQS queue. Use a Wait state to delay the Lambda function’s processing for the required number of seconds after message delivery to the SQS queue. Use Amazon EventBridge to invoke the state machine every 5 minutes.
- B Configure the Lambda function to poll the SQS queue. Update the Lambda code to republish each message with a custom attribute that contains a future time when the message should be fully processed. Update the Lambda code to fully process messages when the custom attribute’s future time has passed.
- C Set the DelaySeconds value of the SQS queue to be the number of seconds required to delay delivery of the messages. Add an event source mapping for the Lambda function. Specify the SQS queue as a source.
- D Set the Visibility Timeout value of the SQS queue to be the number of seconds required to delay delivery of the messages. Add an event source mapping for the Lambda function. Specify the SQS queue as a source.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi yêu cầu xây dựng một workflow xử lý message từ Amazon SQS queue một cách hiệu quả vận hành nhất (MOST operationally efficient). Cụ thể: Khi message được gửi đến SQS queue, hệ thống phải triển khai một khoảng delay trước khi kích hoạt AWS Lambda function để xử lý message đó.
🛠️ Yêu cầu chính:
- Sử dụng tính năng native của AWS để delay message trước khi Lambda xử lý.
- Ưu tiên giải pháp đơn giản, ít tài nguyên, tự động scale (không cần polling thủ công, không phức tạp hóa code).
- Kiến thức cập nhật 2026: SQS hỗ trợ DelaySeconds lên đến 12 giờ (tăng từ 15 phút trước đây, theo AWS re:Invent 2023), và Lambda event source mapping với SQS là cách chuẩn để trigger tự động mà không cần code polling.
Mục tiêu là delay việc delivery message (làm message visible) trước khi Lambda poll và xử lý.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Set the DelaySeconds value of the SQS queue to be the number of seconds required to delay delivery of the messages. Add an event source mapping for the Lambda function. Specify the SQS queue as a source.
Lý do 🏆:
- DelaySeconds là tính năng native của SQS (per-queue hoặc per-message), delay việc message trở nên visible cho consumer (Lambda) ngay khi gửi. Message sẽ nằm "ẩn" trong queue đúng số giây yêu cầu (0-43,200 giây ~12 giờ).
- Event source mapping cho Lambda với SQS source: Lambda tự động poll queue, nhận batch message visible và xử lý không cần code thêm, scale tự động, báo cáo lỗi qua DLQ nếu cần.
- Hiệu quả nhất: Không code custom, chi phí thấp, quản lý dễ (console/CLI/API), tuân thủ best practice AWS Well-Architected Framework (Operational Excellence pillar).
📋 Giải thích 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). Tôi đánh dấu ✅ đúng hoặc ❌ sai, kèm giải thích chi tiết bằng tiếng Việt:
-
❌ Create an AWS Step Functions state machine to process the SQS queue. Use a Wait state to delay the Lambda function’s processing for the required number of seconds after message delivery to the SQS queue. Use Amazon EventBridge to invoke the state machine every 5 minutes.
- Sai vì: Step Functions + EventBridge tạo polling định kỳ 5 phút (không real-time), phức tạp (state machine + scheduler), tốn tài nguyên (execution fee Step Functions), không delay native mà delay sau khi message đã visible. Không efficient so với SQS built-in.
-
❌ Configure the Lambda function to poll the SQS queue. Update the Lambda code to republish each message with a custom attribute that contains a future time when the message should be fully processed. Update the Lambda code to fully process messages when the custom attribute’s future time has passed.
- Sai vì: Yêu cầu code custom phức tạp (poll thủ công, check attribute, republish message → loop infinite nếu không cẩn thận), tăng latency, tốn execution time Lambda, dễ lỗi (message duplicate/loss). Vi phạm nguyên tắc "serverless without servers" – không dùng native delay.
-
✅ Set the DelaySeconds value of the SQS queue to be the number of seconds required to delay delivery of the messages. Add an event source mapping for the Lambda function. Specify the SQS queue as a source.
- Đúng vì: Như giải thích trên – native, zero-code, auto-scale. DelaySeconds delay delivery chính xác, Lambda trigger seamless qua event source mapping (hỗ trợ batching, reserved concurrency từ 2024+).
-
❌ Set the Visibility Timeout value of the SQS queue to be the number of seconds required to delay delivery of the messages. Add an event source mapping for the Lambda function. Specify the SQS queue as a source.
- Sai vì: Visibility Timeout chỉ áp dụng sau khi message đã visible và được poll (ẩn message trong quá trình xử lý để tránh duplicate process). Không delay delivery ban đầu. Nếu set lớn, chỉ gây in-flight message timeout dài, dẫn đến retry không mong muốn nếu Lambda chậm.
📘 Tài liệu tham khảo (cập nhật 2026)
- AWS SQS Docs: Delay Queues – DelaySeconds chi tiết.
- Lambda Event Source Mapping: Using Lambda with SQS – Cấu hình trigger.
- AWS Well-Architected: Serverless Lens – Best practice cho SQS-Lambda.
- Release Notes: AWS tăng DelaySeconds lên 12h (Nov 2023), ổn định đến 2026.
Giải pháp này đảm bảo 99.999999999% durability SQS + event-driven architecture tối ưu! 🚀
The application uses an Amazon API Gateway API that resolves to AWS Lambda functions. The Lambda functions store the data in an Amazon Aurora MySQL DB cluster. The application worked properly during testing.
A developer configured an Amazon CloudFront distribution with field-level encryption that uses an AWS Key Management Service (AWS KMS) key. After the configuration of the distribution, the application behaved unexpectedly. All the data in the database changed from plaintext to ciphertext.
The developer must ensure that the data is not stored in the database as the ciphertext from the CloudFront field-level encryption.
Which solution will meet this requirement?
- A Change the CloudFront Viewer protocol policy from “HTTP and HTTPS” to “HTTPS only.”
- B Add a Lambda function that uses the KMS key to decrypt the data fields before saving the data to the database.
- C Enable encryption on the DB cluster by using the same KMS key that is used in CloudFront.
- D Request and deploy a new SSL certificate to use with the CloudFront distribution.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi mô tả một ứng dụng AWS nhận dữ liệu từ khách hàng, yêu cầu mã hóa dữ liệu tại chỗ (at-rest) và trong quá trình truyền (in-transit). Ứng dụng sử dụng:
- Amazon API Gateway làm endpoint chính, kết nối với AWS Lambda functions.
- Lambda lưu dữ liệu vào Amazon Aurora MySQL DB cluster.
Ứng dụng hoạt động bình thường trong giai đoạn testing. Tuy nhiên, sau khi developer cấu hình Amazon CloudFront distribution với field-level encryption (mã hóa cấp trường dữ liệu) sử dụng AWS KMS key, ứng dụng gặp vấn đề: Tất cả dữ liệu trong DB bị lưu dưới dạng ciphertext (dữ liệu mã hóa) thay vì plaintext.
Vấn đề cốt lõi 📛: Field-level encryption ở CloudFront mã hóa các trường dữ liệu cụ thể trước khi dữ liệu đến origin (API Gateway → Lambda → DB). Do đó, Lambda nhận dữ liệu đã mã hóa và lưu thẳng vào DB dưới dạng ciphertext. Yêu cầu là đảm bảo dữ liệu lưu vào DB dưới dạng plaintext, vẫn giữ mã hóa in-transit và at-rest (DB có thể tự mã hóa at-rest riêng).
Giải pháp cần tìm: Cách xử lý để decrypt dữ liệu trước khi lưu vào DB, mà không ảnh hưởng đến mã hóa tổng thể. (Kiến thức cập nhật đến 2026: CloudFront field-level encryption hỗ trợ AWS KMS asymmetric keys cho mã hóa cấp trường, yêu cầu decrypt ở backend bằng KMS API).
📘 Tài liệu tham khảo:
- AWS CloudFront Field-Level Encryption (xác nhận quy trình mã hóa trước origin và decrypt ở backend).
- AWS KMS với CloudFront (hỗ trợ asymmetric keys cho field-level enc).
- Aurora Encryption (tách biệt at-rest enc).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Add a Lambda function that uses the KMS key to decrypt the data fields before saving the data to the database.
Lý do 🛠️:
- Field-level encryption ở CloudFront sử dụng KMS asymmetric key (public key để mã hóa ở CloudFront, private key để decrypt ở backend).
- Lambda hiện tại nhận ciphertext → cần thêm logic decrypt bằng AWS SDK (gọi KMS decrypt API với KMS key) trước khi lưu plaintext vào DB.
- Điều này giữ nguyên mã hóa in-transit (CloudFront → API Gateway), at-rest (DB tự enc nếu cần), và giải quyết vấn đề ciphertext trong DB. Hoạt động ngay lập tức mà không thay đổi cấu trúc.
📋 Giải thích tất cả các phương án (đúng/sai)
-
❌ [SAI] Change the CloudFront Viewer protocol policy from “HTTP and HTTPS” to “HTTPS only.”
Phương án này chỉ buộc HTTPS cho viewer (client → CloudFront), tăng bảo mật transit nhưng không ảnh hưởng đến field-level encryption. Vấn đề là dữ liệu đã mã hóa cấp trường trước khi đến Lambda, không liên quan protocol policy. Thay đổi này không decrypt được ciphertext. -
✅ [ĐÚNG] Add a Lambda function that uses the KMS key to decrypt the data fields before saving the data to the database.
Như giải thích trên: Decrypt chính xác tại Lambda bằng KMS key, chuyển ciphertext → plaintext trước lưu DB. Đây là best practice theo AWS cho field-level enc (sử dụng AWS SDK KMS trong Lambda). -
❌ [SAI] Enable encryption on the DB cluster by using the same KMS key that is used in CloudFront.
Bật encryption at-rest trên Aurora (dùng KMS key) chỉ mã hóa toàn bộ DB volume, nhưng dữ liệu đầu vào đã là ciphertext từ CloudFront → lưu vẫn ciphertext (không decrypt). Kết quả: DB chứa "double-encrypted" hoặc ciphertext thô, không đạt yêu cầu plaintext. -
❌ [SAI] Request and deploy a new SSL certificate to use with the CloudFront distribution.
SSL/TLS cert chỉ xử lý mã hóa transit end-to-end (HTTPS) giữa client-CloudFront-origin, không can thiệp field-level encryption (là mã hóa application-level). Cert mới không decrypt fields đã mã hóa bằng KMS.
💡 Lưu ý cuối: Giải pháp đúng tận dụng Lambda@Edge hoặc Lambda thông thường với IAM role có quyền KMS:Decrypt để scale tốt. Test kỹ key policy cho CloudFront và Lambda! 🚀
A developer must set up a continuous delivery process that will provision the test infrastructure across the different AWS accounts. The developer then must run the integration tests.
Which solution will meet these requirements with the LEAST administrative effort?
- A Use AWS CodeDeploy with AWS CloudFormation StackSets to deploy the infrastructure. Use Amazon CodeGuru to run the tests.
- B Use AWS CodePipeline with AWS CloudFormation StackSets to deploy the infrastructure. Use AWS CodeBuild to run the tests.
- C Use AWS CodePipeline with AWS CloudFormation change sets to deploy the infrastructure. Use a CloudFormation custom resource to run the tests.
- D Use AWS Serverless Application Model (AWS SAM) templates with AWS CloudFormation change sets to deploy the infrastructure. Use AWS CodeDeploy to run the tests.
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 thiết lập quy trình continuous delivery (CD) cho môi trường kiểm thử (test infrastructure) thực tế trên AWS, bao gồm các Amazon EC2 instances và Amazon RDS database. Công ty cung cấp dịch vụ B2B với infrastructure riêng biệt trong từng tài khoản AWS của khách hàng. Trước khi release tính năng mới (feature release), cần provision (triển khai tự động) test infrastructure này trên nhiều tài khoản AWS khác nhau (cross-account), sau đó chạy integration tests. Yêu cầu chính là giải pháp với LEAST administrative effort (ít nỗ lực quản trị nhất), nghĩa là cần công cụ tự động hóa cao, hỗ trợ multi-account mà không cần can thiệp thủ công nhiều.
🛠️ Thách thức chính:
- Deploy infrastructure (EC2 + RDS) trên nhiều accounts → Cần tool hỗ trợ multi-account deployment.
- Chạy tests tự động trong pipeline → Cần tích hợp CI/CD.
- Least effort → Ưu tiên managed services native AWS, tránh custom code hoặc thủ công.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Use AWS CodePipeline with AWS CloudFormation StackSets to deploy the infrastructure. Use AWS CodeBuild to run the tests.
Lý do chi tiết:
- AWS CodePipeline là dịch vụ orchestration pipeline CI/CD hoàn chỉnh, hỗ trợ multi-stage (source → build → deploy → test), dễ tích hợp với các AWS services khác, tự động hóa toàn bộ quy trình continuous delivery với minimal setup.
- AWS CloudFormation StackSets (cập nhật đến 2026) là giải pháp best practice cho việc deploy CloudFormation stacks trên nhiều accounts và regions thông qua delegated administrator (một account quản lý), giảm thiểu administrative effort so với manual deployment hoặc change sets. Nó tự động replicate stacks cross-account mà không cần script phức tạp.
- AWS CodeBuild là managed build service lý tưởng để chạy integration tests (hỗ trợ custom scripts, Docker, tests trên EC2/RDS), tích hợp trực tiếp vào CodePipeline stage, không cần quản lý servers.
Kết hợp này tạo pipeline end-to-end với least effort: tự động provision infra → run tests → teardown nếu cần, phù hợp DOPs Professional level (theo AWS Well-Architected Framework for DevOps).
📋 Phân tích 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. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể dựa trên tính phù hợp, administrative effort và best practices AWS (2026).
-
❌ [SAI] Use AWS CodeDeploy with AWS CloudFormation StackSets to deploy the infrastructure. Use Amazon CodeGuru to run the tests.
Phương án này không phù hợp vì AWS CodeDeploy chủ yếu dùng để deploy applications lên EC2/ Lambda/ ECS (app-level deployment), không phải để orchestrate infrastructure provisioning như CloudFormation stacks. Dù StackSets tốt cho multi-account infra, CodeDeploy không thay thế được pipeline đầy đủ. Amazon CodeGuru là tool code review và performance analysis (Reviewer/Profiler), không hỗ trợ chạy integration tests tự động trong pipeline. Tổng thể, effort cao do thiếu orchestration và sai công cụ test → Không least effort. -
✅ [ĐÚNG] Use AWS CodePipeline with AWS CloudFormation StackSets to deploy the infrastructure. Use AWS CodeBuild to run the tests.
Như đã giải thích ở phần đáp án đúng: Hoàn hảo cho multi-account infra deploy (StackSets) + CD pipeline (CodePipeline) + tests (CodeBuild). Tích hợp native, serverless, tự động hóa cao nhất, zero server management. Đây là recommended architecture cho cross-account testing trong AWS DevOps. -
❌ [SAI] Use AWS CodePipeline with AWS CloudFormation change sets to deploy the infrastructure. Use a CloudFormation custom resource to run the tests.
CloudFormation change sets chỉ dùng để preview và approve changes thủ công trên single stack/account, không hỗ trợ tự động multi-account deployment hiệu quả như StackSets (yêu cầu tạo stack riêng từng account → high effort). Custom resource trong CF cần Lambda backend phức tạp để chạy tests, không scalable và tăng administrative overhead (debug, permissions). CodePipeline tốt nhưng kết hợp này kém hiệu quả cho cross-account → Không least effort. -
❌ [SAI] Use AWS Serverless Application Model (AWS SAM) templates with AWS CloudFormation change sets to deploy the infrastructure. Use AWS CodeDeploy to run the tests.
AWS SAM dành cho serverless apps (Lambda, API Gateway, DynamoDB), không phù hợp với infrastructure EC2 + RDS (provisioned resources). Change sets lại kém cho multi-account như trên. AWS CodeDeploy chỉ deploy apps, không chạy tests (cần thêm logic phức tạp). Effort cao do mismatch công cụ và thiếu pipeline orchestration → Không đáp ứng yêu cầu.
📘 Tài liệu tham khảo (AWS Docs cập nhật 2026)
- AWS CodePipeline: docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html – CI/CD pipelines multi-account.
- CloudFormation StackSets: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html – Cross-account/region deployment (delegated admin).
- AWS CodeBuild for Tests: docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html – Integration testing best practices.
- AWS Well-Architected DevOps Pillar: aws.amazon.com/architecture/well-architected/devops-pillar – Least effort CI/CD patterns.
- Exam Guide DOP-C02: Nhấn mạnh StackSets + CodePipeline cho multi-account scenarios.
🛠️ Lời khuyên DOPs Pro: Pipeline này có thể extend với CodeStar Connections cho Git source, và StackSets service-managed permissions để zero-trust multi-account!
The developer needs to update the Lambda function to have predictable invocation durations that run with low latency. Any initialization activities, such as loading libraries and instantiating clients, must run during allocation time rather than during actual function invocations.
Which combination of steps will meet these requirements? (Choose two.)
- A Create a schedule group in Amazon EventBridge Scheduler to invoke the Lambda function.
- B Configure provisioned concurrency for the Lambda function to have the necessary number of execution environments.
- C Use the $LATEST version of the Lambda function.
- D Configure reserved concurrency for the Lambda function to have the necessary number of execution environments.
- E Deploy changes, and publish a new version of the Lambda function.
Xem giải thích
🧩 Phân tích chi tiết câu hỏi AWS Lambda về tối ưu hóa độ trễ invocations
📖 Giải thích nội dung câu hỏi:
Câu hỏi mô tả một developer đang xây dựng ứng dụng sử dụng AWS Lambda function để transform và load dữ liệu từ Amazon S3 bucket. Khi test, một số invocations của Lambda chạy chậm hơn các lần khác (cold starts). Yêu cầu là cập nhật Lambda để có thời gian invocation dự đoán được (predictable), độ trễ thấp (low latency), và các hoạt động khởi tạo (initialization) như load libraries hay instantiate clients phải chạy trong allocation time (thời gian cấp phát môi trường thực thi) thay vì trong invocation thực tế. Đây là vấn đề phổ biến của Lambda: cold starts xảy ra khi môi trường thực thi (execution environment) chưa được warm-up, dẫn đến init code chạy mỗi lần invoke. Giải pháp cần chọn 2 bước kết hợp để pre-warm environments, đảm bảo low latency theo best practices AWS (cập nhật đến 2026 với Lambda SnapStart cho Java, .NET, nhưng câu hỏi tập trung vào provisioned concurrency chung).
✅ Đáp án đúng (chọn 2):
- Configure provisioned concurrency for the Lambda function to have the necessary number of execution environments.
- Deploy changes, and publish a new version of the Lambda function.
🛠️ Lý do lựa chọn đáp án đúng:
Kết hợp 2 bước này giải quyết hoàn hảo cold starts:
- Provisioned Concurrency (PC) pre-allocate và warm-up số lượng execution environments cần thiết trước, chạy init code trong allocation time → invocations luôn nhanh, predictable latency (thường <100ms).
- Publish new version cần thiết vì PC chỉ áp dụng trên published version hoặc alias (không phải $LATEST), tránh thay đổi code gây cold starts mới. Deploy changes trước rồi publish version đảm bảo stability. Theo AWS 2026, PC hỗ trợ tất cả runtimes và tích hợp với Lambda SnapStart cho init nhanh hơn.
📋 Giải thích tất cả các phương án (đúng/sai):
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, với lý do đúng/sai dựa trên docs AWS Lambda mới nhất:
-
❌ Create a schedule group in Amazon EventBridge Scheduler to invoke the Lambda function.
Phương án này SAI vì EventBridge Scheduler (trước là CloudWatch Events) chỉ dùng để lập lịch invocations định kỳ, không pre-warm environments hay giải quyết cold starts. Nó có thể trigger Lambda nhưng vẫn gặp cold starts ngẫu nhiên, không đảm bảo low latency predictable. (Không liên quan đến allocation time). -
✅ Configure provisioned concurrency for the Lambda function to have the necessary number of execution environments.
Phương án này ĐÚNG vì Provisioned Concurrency cấp phát sẵn environments đã init (load libraries, clients), chạy init trong allocation time. Kết quả: invocations luôn warm, latency thấp (<500ms), phù hợp scaling tự động. Chi phí theo số environments/giờ, tối ưu cho apps predictable traffic. -
❌ Use the $LATEST version of the Lambda function.
Phương án này SAI vì $LATEST là version đang phát triển, code thay đổi liên tục → mỗi invoke có thể trigger cold start mới (re-init). PC không hỗ trợ $LATEST; phải dùng published version/alias để ổn định. Dùng $LATEST chỉ cho testing, không production low-latency. -
❌ Configure reserved concurrency for the Lambda function to have the necessary number of execution environments.
Phương án này SAI vì Reserved Concurrency chỉ giới hạn tổng concurrency (ví dụ: max 100 invocations đồng thời), ngăn functions khác "ăn" quota. Nó không pre-warm environments hay chạy init trong allocation time → vẫn cold starts, không giải quyết latency issue. -
✅ Deploy changes, and publish a new version of the Lambda function.
Phương án này ĐÚNG vì sau khi deploy code mới (fix init nếu cần), phải publish version (ví dụ: version 2) để tạo immutable snapshot. PC/alias chỉ attach vào version này, tránh $LATEST instability. Quy trình chuẩn: zip/upload code → publish → config PC.
📘 Tài liệu tham khảo (AWS cập nhật 2026):
- AWS Lambda Developer Guide: Reducing initialization latency with Provisioned Concurrency – Chi tiết PC và yêu cầu version.
- AWS Lambda Versions – Giải thích $LATEST vs published versions.
- Reserved vs Provisioned Concurrency – So sánh rõ ràng.
- AWS re:Invent 2025/2026 sessions: LAMBDA400 – Best practices cold starts với SnapStart + PC.
- AWS Well-Architected Framework: Serverless Lens (v3.0+).
🔍 Lời khuyên DevOps: Để implement, dùng AWS Console/CLI: aws lambda publish-version rồi aws lambda put-provisioned-concurrency-config. Monitor với CloudWatch Lambda Insights cho latency P99! 🚀
The developer wants to receive notifications from the ErrorTopic SNS topic when the ProcessMessages Lambda function fails to process a message.
Which solution will meet this requirement?
- A Configure a subscription for the ErrorTopic SNS topic. Configure a filter policy for failures. Specify the ProcessMessages Lambda function as the endpoint.
- B Configure a failure destination for the ProcessMessages Lambda function. Specify the Amazon Resource Name (ARN) of the ErrorTopic SNS topic as the destination ARN.
- C Configure a trigger for the ProcessMessages Lambda function. Specify the ErrorTopic SNS topic as the trigger topic. Configure a filter policy on the topic for failures
- D Configure a delivery policy on the ErrorTopic SNS topic. Configure a filter policy for failures. Specify the Lambda function as the input endpoint.
Xem giải thích
🧩 Giải thích 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 lập trình viên đã tạo AWS Lambda function tên ProcessMessages, được kích hoạt asynchronously (không đồng bộ) khi có tin nhắn được publish vào Amazon SNS topic tên InputTopic. Ngoài ra, có một SNS topic khác tên ErrorTopic dùng để xử lý cảnh báo lỗi từ các dịch vụ khác.
Yêu cầu chính: Nhận thông báo từ ErrorTopic khi Lambda function ProcessMessages thất bại trong việc xử lý tin nhắn (ví dụ: lỗi runtime, timeout, hoặc hết số lần retry).
🛠️ Phân tích kỹ thuật: Với invocation không đồng bộ từ SNS, Lambda tự động retry tin nhắn thất bại tối đa 2 lần (mặc định). Nếu vẫn fail, Lambda sẽ gửi event lỗi đến Dead Letter Queue (DLQ) hoặc failure destination (có thể là SQS queue hoặc SNS topic). Giải pháp cần cấu hình để ErrorTopic nhận được thông báo lỗi từ Lambda này một cách tự động và chính xác, sử dụng kiến thức cập nhật AWS Lambda phiên bản mới nhất (hỗ trợ DLQ từ năm 2018, vẫn áp dụng đến 2026 với các cải tiến như enhanced error reporting).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
Configure a failure destination for the ProcessMessages Lambda function. Specify the Amazon Resource Name (ARN) of the ErrorTopic SNS topic as the destination ARN.
Lý do:
🔥 Đây là cách chính xác và được AWS khuyến nghị để xử lý lỗi asynchronous invocation của Lambda. Bạn cấu hình failure destination (hay DLQ cho async failures) trực tiếp trên Lambda function qua console, CLI, hoặc CDK/Terraform. Khi Lambda fail sau hết retry, nó sẽ tự động publish event lỗi (chứa thông tin request ID, error message, v.v.) đến ARN của ErrorTopic SNS topic. Điều này đảm bảo thông báo được gửi ngay lập tức mà không cần middleware phức tạp. Tính năng này được tối ưu hóa từ năm 2023 với maximum retry attempts tùy chỉnh lên đến 10.000 và on-failure destinations.
📋 Giải thích tất cả các phương án trả lời
-
❌ Phương án SAI:
Configure a subscription for the ErrorTopic SNS topic. Configure a filter policy for failures. Specify the ProcessMessages Lambda function as the endpoint.
Giải thích: Sai vì subscription trên SNS topic dùng để subscribe endpoint nhận tin nhắn từ topic, không phải để gửi lỗi từ Lambda ra topic. Ở đây, ta đang subscribe chính Lambda function làm endpoint cho ErrorTopic – điều này sẽ tạo vòng lặp vô tận (Lambda nhận tin từ ErrorTopic và có thể fail lại). Filter policy chỉ lọc message attributes, không liên quan đến "failures" từ Lambda. -
✅ Phương án ĐÚNG:
Configure a failure destination for the ProcessMessages Lambda function. Specify the Amazon Resource Name (ARN) of the ErrorTopic SNS topic as the destination ARN.
Giải thích: Đúng như đã phân tích ở trên. Đây là tính năng native của Lambda cho async DLQ (SNS/SQS), đảm bảo event lỗi đầy đủ (bao gồm payload gốc + metadata) được gửi đến destination. Cấu hình đơn giản:aws lambda update-function-configuration --function-name ProcessMessages --destination-config OnFailure={Destination=arn:aws:sns:region:account:ErrorTopic}. -
❌ Phương án SAI:
Configure a trigger for the ProcessMessages Lambda function. Specify the ErrorTopic SNS topic as the trigger topic. Configure a filter policy on the topic for failures.
Giải thích: Sai hoàn toàn vì trigger (event source mapping) dùng để kích hoạt Lambda từ nguồn sự kiện (như SNS), không phải để gửi lỗi đến topic. Việc chỉ định ErrorTopic làm trigger sẽ khiến Lambda được invoke bởi tin nhắn từ ErrorTopic, tạo vòng lặp chết và không giải quyết vấn đề gửi thông báo lỗi từ InputTopic failures. -
❌ Phương án SAI:
Configure a delivery policy on the ErrorTopic SNS topic. Configure a filter policy for failures. Specify the Lambda function as the input endpoint.
Giải thích: Sai vì delivery policy trên SNS dùng để quản lý retry và dead letter cho subscriptions của SNS (ví dụ: raw message delivery, timeout), không áp dụng cho việc Lambda gửi lỗi đến topic. "Input endpoint" không tồn tại; filter policy cũng chỉ lọc attributes, không detect "failures" từ Lambda upstream.
📘 Tài liệu tham khảo
- AWS Lambda Documentation: Asynchronous invocation - Destination for failed events (Cập nhật 2025, xác nhận SNS DLQ hỗ trợ full error payloads).
- AWS SNS + Lambda Integration: Using Lambda with SNS (Ví dụ cấu hình failure destinations).
- AWS Well-Architected Framework - Reliability Pillar: Khuyến nghị DLQ cho event-driven architectures (Reliability whitepaper 2024).
- AWS CLI Reference:
update-function-configuration --destination-config(Phiên bản CLI v2.15+ đến 2026).
🛠️ Lời khuyên DevOps: Luôn enable CloudWatch Logs và Lambda Insights để monitor failures trước khi config DLQ. Test bằng TestEvent với intentional error!
Which solution will meet these requirements with the LEAST operational overhead?
- A Configure AWS Directory Service to create an Active Directory in AWS Directory Service for Microsoft Active Directory. Establish a trust relationship with the on-premises Active Directory. Configure IAM roles and trust policies to give the employees access to the AWS resources.
- B Use LDAP to directly integrate the on-premises Active Directory with AWS Identity and Access Management (IAM). Map Active Directory groups to IAM roles to control access to AWS resources.
- C Implement a custom identity broker to authenticate users into the on-premises Active Directory. Configure the identity broker to use AWS Security Token Service (AWS STS) to grant authorized users IAM role based access to the AWS resources.
- D Configure Amazon Cognito to federate users into the on-premises Active Directory. Use Cognito user pools to manage user identities and to manage user access to the AWS resources.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi xoay quanh một công ty đang phát triển ứng dụng sử dụng các tài nguyên AWS như Amazon EC2, Amazon S3 và AWS Lambda. Yêu cầu chính là cho phép nhân viên truy cập AWS Management Console bằng credentials hiện có từ on-premises Microsoft Active Directory (AD) mà công ty đang quản lý. Mỗi nhân viên phải có mức độ truy cập cụ thể dựa trên vai trò (role) của họ. Giải pháp cần ít overhead vận hành nhất (LEAST operational overhead), nghĩa là ưu tiên dịch vụ AWS managed, dễ triển khai, ít cần bảo trì thủ công, và hỗ trợ federation để map AD groups/users vào IAM roles cho truy cập console/resources.
Mục tiêu chính:
- Tích hợp federated identity từ on-prem AD vào AWS Console.
- Sử dụng IAM roles để kiểm soát quyền dựa trên role.
- Giảm thiểu công sức quản lý (không custom code, không tự build broker).
📘 Dẫn nguồn: AWS Well-Architected Framework (Identity pillar), tài liệu AWS Directory Service (Managed Microsoft AD), IAM User Guide về SAML/AD federation (cập nhật 2024-2026: vẫn ưu tiên Directory Service cho AD integration với IAM Identity Center hoặc direct IAM roles).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Configure AWS Directory Service to create an Active Directory in AWS Directory Service for Microsoft Active Directory. Establish a trust relationship with the on-premises Active Directory. Configure IAM roles and trust policies to give the employees access to the AWS resources.
Lý do chọn 🛠️:
- Đây là giải pháp managed hoàn toàn bởi AWS (AWS Managed Microsoft AD trong Directory Service), tự động xử lý replication, patching, backup – least operational overhead.
- Trust relationship (hai chiều hoặc một chiều) giữa AWS Managed AD và on-prem AD cho phép nhân viên dùng credentials AD gốc để auth vào AWS Console qua IAM roles (trust policy dựa trên AD groups/users).
- Hỗ trợ console access trực tiếp, map role-based access (ví dụ: AD group "DevOps" → IAM role với quyền EC2/S3/Lambda).
- Không cần custom code, dễ scale, tích hợp IAM Identity Center (SSO) nếu cần.
📋 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 phương án (giữ nguyên văn bản gốc bằng tiếng Anh). Tôi đánh dấu ✅ đúng hoặc ❌ sai, kèm giải thích rõ ràng bằng tiếng Việt dựa trên best practices AWS mới nhất (2026).
-
Configure AWS Directory Service to create an Active Directory in AWS Directory Service for Microsoft Active Directory. Establish a trust relationship with the on-premises Active Directory. Configure IAM roles and trust policies to give the employees access to the AWS resources.
✅ Đúng 🏆: Giải pháp managed, ít overhead nhất. AWS Directory Service (Managed Microsoft AD) tạo AD domain riêng trong AWS, thiết lập trust với on-prem AD qua AWS Directory Service console (hỗ trợ forest trust). Nhân viên login Console bằng AD credentials → federate qua IAM roles (trust policy chỉ định AD principal). Hoàn hảo cho EC2/S3/Lambda access dựa trên role. Không cần quản lý server AD thủ công. -
Use LDAP to directly integrate the on-premises Active Directory with AWS Identity and Access Management (IAM). Map Active Directory groups to IAM roles to control access to AWS resources.
❌ Sai 🚫: IAM không hỗ trợ LDAP integration trực tiếp (LDAP chỉ dùng cho EC2 join domain qua AD Connector, không cho IAM federation/console access). Phải qua SAML/OIDC hoặc Directory Service. Cách này không khả thi, dẫn đến lỗi auth và overhead cao để workaround. -
Implement a custom identity broker to authenticate users into the on-premises Active Directory. Configure the identity broker to use AWS Security Token Service (AWS STS) to grant authorized users IAM role based access to the AWS resources.
❌ Sai 🔧: Yêu cầu xây dựng custom broker (code tự viết, deploy Lambda/EC2), tích hợp Kerberos/LDAP → operational overhead cao (bảo trì, scale, security patching). AWS khuyến nghị tránh custom solution; dùng managed services như Directory Service thay thế để giảm rủi ro và effort. -
Configure Amazon Cognito to federate users into the on-premises Active Directory. Use Cognito user pools to manage user identities and to manage user access to the AWS resources.
❌ Sai 👥: Cognito không hỗ trợ federation trực tiếp với on-prem AD (Cognito dùng OIDC/SAML IdPs như Okta/Azure AD, hoặc user pools riêng biệt). Không thể dùng user pools để quản lý AD identities gốc mà không custom sync. Overhead cao cho console access (Cognito chủ yếu cho app/mobile, không optimize cho AWS Console roles). Nên dùng Cognito cho custom apps, không phải AD federation.
🏅 Kết luận và khuyến nghị
Giải pháp đúng tận dụng AWS native managed service để federate AD seamlessly, đảm bảo security, scalability với chi phí vận hành thấp nhất. Để triển khai: Sử dụng AWS Directory Service console → Create Directory → Enable trust → IAM roles với policy Principal: {"AWS": "arn:aws:iam::account:role/ad-role"}.
📘 Tài liệu tham khảo thêm:
- AWS Directory Service for Microsoft AD (Trust relationships).
- IAM Federation with AD.
- AWS Exam DOP-C02 blueprint (Identity & Access Management section, cập nhật 2024).
Nếu cần demo code Terraform hoặc sâu hơn, hãy hỏi nhé! 🚀
Which solution will meet these requirements?
- A Create a DynamoDB Accelerator (DAX) cluster from the table. Set the view type to old image. Create an AWS Lambda function that uses the cluster data to update the spreadsheet. Subscribe the Lambda function to the cluster.
- B Create a DynamoDB Accelerator (DAX) cluster from the table. Set the view type to new image. Create an AWS Lambda function that uses the cluster data to update the spreadsheet. Subscribe the Lambda function to the cluster.
- C Enable a DynamoDB stream for the table. Set the view type to new image. Create an AWS Lambda function that uses the stream data to update the spreadsheet. Subscribe the Lambda function to the stream.
- D Enable a DynamoDB stream for the table. Set the view type to old image. Create an AWS Lambda function that uses the stream data to update the spreadsheet. Subscribe the Lambda function to the stream.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi xoay quanh một công ty đang sử dụng Amazon DynamoDB để lưu trữ dữ liệu về người dùng đăng ký trial sản phẩm. Họ đang theo dõi dữ liệu trial qua một spreadsheet (bảng tính, ví dụ Google Sheets hoặc Excel online), và yêu cầu là phải tự động cập nhật spreadsheet với thông tin mới nhất mỗi khi trial bắt đầu (insert mới), được cập nhật (modify), hoặc kết thúc (delete hoặc update status).
🔍 Yêu cầu cốt lõi: Giải pháp phải capture changes từ DynamoDB một cách near real-time (gần thời gian thực), sau đó trigger một cơ chế để push dữ liệu mới nhất vào spreadsheet. Điều này đòi hỏi sử dụng DynamoDB Streams (luồng dữ liệu thay đổi item-level) kết hợp với AWS Lambda để xử lý và cập nhật spreadsheet (có thể qua API như Google Sheets API hoặc tương tự). Không cần caching mà cần event-driven architecture để phản ứng với mọi thay đổi.
📘 Tài liệu tham khảo:
- AWS DynamoDB Streams: docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html (cập nhật 2024-2026, hỗ trợ Lambda triggers).
- DynamoDB Lambda Integration: docs.aws.amazon.com/lambda/latest/dg/with-ddb.html.
✅ Đáp án đúng
Enable a DynamoDB stream for the table. Set the view type to new image. Create an AWS Lambda function that uses the stream data to update the spreadsheet. Subscribe the Lambda function to the stream.
Lý do chọn đáp án này 🛠️:
- DynamoDB Streams capture mọi thay đổi (insert, update, delete) của items trong table một cách near real-time (trì hoãn < 2 giây).
- View type: NEW_IMAGE cung cấp dữ liệu mới nhất sau thay đổi (latest information), phù hợp để cập nhật spreadsheet với trạng thái hiện tại của trial (bắt đầu/update/kết thúc).
- Lambda function được subscribe (trigger) trực tiếp vào stream, xử lý event và update spreadsheet (ví dụ: dùng boto3 hoặc API client).
- Giải pháp serverless, scalable, cost-effective, không cần polling thủ công.
📋 Phân tích tất cả các phương án
Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Tôi sử dụng ✅ cho đúng và ❌ cho sai, kèm giải thích rõ ràng:
-
❌ [SAI] Create a DynamoDB Accelerator (DAX) cluster from the table. Set the view type to old image. Create an AWS Lambda function that uses the cluster data to update the spreadsheet. Subscribe the Lambda function to the cluster. 🧐 Giải thích sai: DAX là in-memory caching layer cho DynamoDB để tăng tốc read (không capture changes). DAX không hỗ trợ "view type", không có streams, và không thể subscribe Lambda như stream (Lambda chỉ trigger từ DAX qua CloudWatch Events, không trực tiếp). "Old image" không tồn tại ở DAX. Giải pháp này không capture real-time changes, chỉ cache data tĩnh → không tự động update.
-
❌ [SAI] Create a DynamoDB Accelerator (DAX) cluster from the table. Set the view type to new image. Create an AWS Lambda function that uses the cluster data to update the spreadsheet. Subscribe the Lambda function to the cluster. 🧐 Giải thích sai: Tương tự trên, DAX không phải công cụ cho change data capture. Không có "view type" ở DAX, và không subscribe Lambda trực tiếp vào cluster (DAX chỉ cache reads, không emit events cho updates). Không đáp ứng real-time update khi trial thay đổi → thất bại yêu cầu.
-
✅ [ĐÚNG] Enable a DynamoDB stream for the table. Set the view type to new image. Create an AWS Lambda function that uses the stream data to update the spreadsheet. Subscribe the Lambda function to the stream. 🛠️ Giải thích đúng: Như phần trên, DynamoDB Streams + NEW_IMAGE capture latest data từ mọi thay đổi (INSERT/UPDATE/DELETE). Lambda trigger tự động, parse stream records, và update spreadsheet. Hoàn hảo cho event-driven, hỗ trợ đến 2026 mà không thay đổi lớn (AWS re:Invent 2024 xác nhận tính năng ổn định).
-
❌ [SAI] Enable a DynamoDB stream for the table. Set the view type to old image. Create an AWS Lambda function that uses the stream data to update the spreadsheet. Subscribe the Lambda function to the stream. 🧐 Giải thích sai: DynamoDB Streams đúng hướng và Lambda subscribe đúng, nhưng OLD_IMAGE chỉ capture dữ liệu trước thay đổi (không phải "latest information"). Ví dụ: Khi trial kết thúc (update status), chỉ có old data → spreadsheet không nhận được trạng thái mới nhất. Yêu cầu nhấn mạnh "latest information" → NEW_IMAGE mới phù hợp (hoặc NEW_AND_OLD_IMAGES nếu cần so sánh, nhưng NEW_IMAGE đủ và tiết kiệm hơn).
🔥 Kết luận: Giải pháp đúng tận dụng DynamoDB Streams + Lambda – best practice cho real-time data pipelines trên AWS (DevOps Professional DOP-C02 khuyến nghị). Tránh DAX vì nhầm lẫn caching với streaming! 🚀