Ngân hàng đề — AWS Certified Developer Associate

Tìm thấy 1356 câu.

Câu 1271
A company has an application that uses an Amazon Cognito user pool for authentication. A developer needs to add a new REST API that will use the user pool to authenticate requests.

Which solution will meet this requirement with the LEAST development effort?
  1. A Create a new API key and a new usage plan. Associate the API key and the REST API with the usage plan.
  2. B Create a Cognito authorizer for the correct user pool. Reference the header that contains the Cognito token.
  3. C Create an AWS Lambda token authorizer. Reference the authorization token in the event payload. Authenticate requests based on the token value.
  4. D Create an AWS Lambda request authorizer. Reference the authorization header in the event payload. Authenticate requests by using the header value in a request to the Cognito API.
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ích hợp Amazon Cognito user pool để xác thực (authenticate) các yêu cầu (requests) cho một REST API mới trên Amazon API Gateway. Công ty đã có ứng dụng sử dụng Cognito user pool làm nguồn xác thực người dùng. Nhiệm vụ của developer là thêm API mới với yêu cầu least development effort (ít công sức phát triển nhất), nghĩa là ưu tiên giải pháp tích hợp sẵn, không cần code tùy chỉnh nhiều.

🛠️ Bối cảnh kỹ thuật (cập nhật AWS 2026):

  • Cognito user pool cung cấp JWT token (ID token hoặc access token) sau khi user đăng nhập.
  • API Gateway hỗ trợ authorizers để kiểm tra token này tự động, đảm bảo chỉ request hợp lệ mới qua.
  • Mục tiêu: Xác thực token từ header (thường là Authorization: Bearer <token>), không cần Lambda function tùy chỉnh để giảm effort.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create a Cognito authorizer for the correct user pool. Reference the header that contains the Cognito token.

Lý do (bằng tiếng Việt rõ ràng):

  • Đây là giải pháp tích hợp sẵn của API Gateway (built-in Cognito User Pool Authorizer), chỉ cần chọn user pool và chỉ định header chứa token (như Authorization).
  • Least development effort ✅: Không cần viết code Lambda, không cần gọi API Cognito thủ công. API Gateway tự động validate JWT token với Cognito (kiểm tra signature, expiry, claims).
  • Cập nhật AWS 2026: Hỗ trợ đầy đủ JWT validation với scopes, groups, và token source (header/query/cookie). Thời gian setup < 5 phút qua Console/CLI/CDK.

📋 Phân tí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 phương án được đánh dấu ✅ (đúng) hoặc ❌ (sai), kèm giải thích hoàn toàn bằng tiếng Việt tại sao đúng/sai, so sánh effort.

  • Create a new API key and a new usage plan. Associate the API key and the REST API with the usage plan.
    ❌ Sai: API key + usage plan chỉ dùng cho rate limiting/throttling/quota (giới hạn sử dụng), không authenticate user từ Cognito. Không kiểm tra token/JWT, không liên quan đến user pool. Effort thấp nhưng không đáp ứng yêu cầu authentication. Phù hợp cho public API, không phải user-based auth.

  • Create a Cognito authorizer for the correct user pool. Reference the header that contains the Cognito token.
    ✅ Đúng: Như đã giải thích ở trên. Giải pháp native, zero-code, API Gateway tự handle toàn bộ flow validate token với Cognito. Hỗ trợ REST API (HTTP APIs cũng tương tự từ 2021+). Least effort so với các option Lambda-based.

  • Create an AWS Lambda token authorizer. Reference the authorization token in the event payload. Authenticate requests based on the token value.
    ❌ Sai: Lambda token authorizer yêu cầu viết code Lambda để parse token từ event.payload.authorizationToken và validate (thường dùng jsonwebtoken lib hoặc gọi Cognito API). Effort cao hơn (code, test, deploy Lambda), dễ lỗi (custom logic). Không cần thiết khi có built-in Cognito authorizer.

  • Create an AWS Lambda request authorizer. Reference the authorization header in the event payload. Authenticate requests by using the header value in a request to the Cognito API.
    ❌ Sai: Lambda request authorizer linh hoạt hơn (truy cập full request context), nhưng phải code đầy đủ (extract header từ event, gọi Cognito GetUser hoặc AdminInitiateAuth API). Effort rất cao (network call, error handling, IAM policy). Phù hợp custom auth phức tạp, không phải least effort cho Cognito.

📘 Tài liệu tham khảo (AWS cập nhật 2026)

🛠️ Lời khuyên thực tế: Sử dụng AWS Console để create authorizer nhanh, hoặc CDK/Terraform cho IaC. Test với curl -H "Authorization: Bearer <token>". Nếu cần scopes/groups, config trong authorizer settings!

Câu 1272
A developer is testing an AWS Lambda function that has an event source of an Amazon Simple Queue Service (Amazon SQS) queue. The developer notices that some of the messages the Lambda function processes re-appear in the queue while the messages are being processed.

The developer must correct this behavior.

Which solution will meet this requirement?
  1. A Increase the timeout of the Lambda function.
  2. B Increase the visibility timeout of the SQS queue.
  3. C Increase the memory allocation of the Lambda function.
  4. D Increase the batch size in the event source mapping.
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 lập trình viên đang kiểm tra một hàm AWS Lambda có nguồn sự kiện (event source) là hàng đợi Amazon Simple Queue Service (Amazon SQS). Trong quá trình kiểm tra, lập trình viên nhận thấy một số tin nhắn (messages) mà Lambda đang xử lý lại xuất hiện trở lại trong hàng đợi SQS ngay cả khi chúng đang được xử lý. Điều này dẫn đến tình trạng duplicate processing hoặc vòng lặp xử lý không mong muốn.

Nguyên nhân gốc rễ 📌:
Khi Lambda sử dụng SQS làm event source (qua event source mapping), Lambda sẽ poll (lấy) các messages từ SQS theo batch. Lúc này, SQS áp dụng visibility timeout (thời gian ẩn) cho các messages đó – nghĩa là messages tạm thời "ẩn" khỏi các consumer khác trong khoảng thời gian này. Nếu Lambda không hoàn thành xử lý và delete message trước khi visibility timeout hết hạn, messages sẽ trở lại hàng đợi (become visible lại) và có thể được poll lại, gây ra hiện tượng re-appear.

Vấn đề cần giải quyết: Tăng thời gian để Lambda xử lý xong messages mà không bị chúng visible lại sớm. Giải pháp phải đảm bảo tính nhất quán và tránh xử lý lặp.
(Kiến thức dựa trên AWS Well-Architected Framework và tài liệu Lambda-SQS integration mới nhất 2025-2026, nơi visibility timeout là yếu tố then chốt cho asynchronous invocation).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Increase the visibility timeout of the SQS queue.

Lý do chi tiết 🛠️:
Visibility timeout của SQS quyết định thời gian messages bị "ẩn" sau khi được poll. Mặc định là 30 giây, nhưng có thể cấu hình lên đến 12 giờ (tăng từ 2024). Nếu thời gian xử lý Lambda (function timeout tối đa 15 phút) dài hơn visibility timeout, messages sẽ re-appear ngay lập tức. Tăng visibility timeout sẽ cho Lambda đủ thời gian xử lý và delete messages thành công, ngăn chặn việc chúng visible lại trong lúc đang process. Đây là giải pháp trực tiếp, hiệu quả và theo best practice AWS (AWS khuyến nghị visibility timeout ≥ Lambda timeout + buffer time).

📋 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 một cách chi tiết. Tôi giữ nguyên nội dung văn bản gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với lý do rõ ràng:

  • Increase the timeout of the Lambda function. ❌
    Sai vì: Timeout của Lambda (tối đa 15 phút) kiểm soát thời gian chạy hàm trước khi bị terminate, nhưng không ảnh hưởng trực tiếp đến visibility timeout của SQS. Nếu Lambda timeout hết hạn trước khi delete message, messages vẫn re-appear do SQS visibility timeout độc lập. Tăng Lambda timeout chỉ giúp hàm chạy lâu hơn, nhưng nếu vẫn < visibility timeout thì vấn đề không giải quyết (và có thể lãng phí resource). Không phải giải pháp gốc rễ.

  • Increase the visibility timeout of the SQS queue. ✅
    Đúng vì: Như đã giải thích ở trên, đây là giải pháp chính xác và trực tiếp. Tăng giá trị này (qua AWS Console, CLI hoặc CDK/Terraform) đảm bảo messages chỉ visible lại sau khi Lambda chắc chắn đã xử lý xong (Lambda timeout + thời gian delete). AWS docs xác nhận: "Set visibility timeout to at least 6x message processing time" cho batch processing.

  • Increase the memory allocation of the Lambda function. ❌
    Sai vì: Tăng memory (từ 128MB đến 10GB) sẽ tăng CPU power và tốc độ xử lý Lambda, giúp hàm chạy nhanh hơn, nhưng không ngăn messages re-appear nếu visibility timeout quá ngắn. Vấn đề là thời gian visibility, không phải performance (dù gián tiếp giúp). Đây chỉ là optimization, không fix root cause.

  • Increase the batch size in the event source mapping. ❌
    Sai vì: Batch size (mặc định 10, tối đa 10,000) kiểm soát số messages poll một lần, tăng có thể làm Lambda xử lý nhiều hơn nhưng tăng rủi ro partial failure (nếu một message fail, cả batch retry). Không liên quan đến việc messages re-appear trong lúc processing – vấn đề vẫn nằm ở visibility timeout so với thời gian xử lý từng message.

📘 Tài liệu tham khảo (cập nhật mới nhất 2026)

  • AWS Documentation: Using Lambda with Amazon SQS – Phần "Visibility timeout" và "Configuring an SQS event source".
  • AWS re:Post & Best Practices: SQS Visibility Timeout for Lambda (updated 2025).
  • Exam Topic DOP-C02: Serverless Architectures – SQS-Lambda integration (visibility timeout là key point).
  • CLI Command mẫu: aws sqs set-queue-attributes --queue-url <URL> --attributes VisibilityTimeout=300 (tăng lên 5 phút).

Nếu cần ví dụ code CDK hoặc Terraform để implement, hãy cho tôi biết nhé! 🚀

Câu 1273
A developer created reusable code that several AWS Lambda functions need to use. The developer bundled the code into a zip archive. The developer needs to deploy the code to AWS and update the Lambda functions to use the code.

Which solution will meet this requirement in the MOST operationally efficient way?
  1. A Upload the zip archive to Amazon S3. Configure an import path on the Lambda functions to point to the zip archive.
  2. B Create a new Lambda function that contains and runs the shared code. Update the existing Lambda functions to invoke the new Lambda function synchronously.
  3. C Create a Lambda layer that contains the zip archive. Attach the Lambda layer to the Lambda functions.
  4. D Create a Lambda container image that includes the shared code. Use the container image as a Lambda base image for all the functions.
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 tình huống một lập trình viên (developer) đã tạo ra một đoạn code tái sử dụng (reusable code) mà nhiều AWS Lambda functions cần sử dụng chung. Code này đã được bundle thành file zip archive. Yêu cầu là deploy code lên AWS và update các Lambda functions để chúng có thể sử dụng code đó, với tiêu chí MOST operationally efficient (hiệu quả vận hành cao nhất).

📌 Điểm mấu chốt:

  • Cần giải pháp tái sử dụng code mà không làm phức tạp hóa việc deploy/update.
  • Phải tiết kiệm chi phí, thời gian quản lý, và dễ scale (operationally efficient theo nguyên tắc AWS Well-Architected Framework).
  • Không yêu cầu thay đổi lớn cấu trúc Lambda hiện tại, chỉ thêm shared code.

🛠️ Bối cảnh AWS Lambda (cập nhật 2026): Lambda hỗ trợ chia sẻ code qua Layers (tái sử dụng thư viện/code), Container Images, hoặc invoke giữa functions. Layers là lựa chọn tối ưu cho reusable code không phải toàn bộ runtime.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create a Lambda layer that contains the zip archive. Attach the Lambda layer to the Lambda functions.

Lý do (🧩 Phân tích sâu):

  • Lambda Layers cho phép upload zip archive trực tiếp làm layer, sau đó attach vào nhiều functions chỉ với vài cú click/API call.
  • Hiệu quả vận hành cao nhất (MOST operationally efficient): Update code chỉ cần publish layer version mới → functions tự động dùng version mới mà không cần redeploy từng function. Hỗ trợ lên đến 5 layers/function, dung lượng 250MB unzipped/shared.
  • Tiết kiệm: Code shared ở layer không tính vào kích thước function (giảm cold start, chi phí lưu trữ).
  • Theo AWS best practice 2026: Layers lý tưởng cho shared libraries (Node.js/Python/etc.), dễ version control.

📘 Tài liệu tham khảo:

📋 Phân tí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 một cách khách quan, giữ nguyên văn bản 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 operationally efficient (dễ quản lý, scale, ít bước deploy/update).

  • [SAI] Upload the zip archive to Amazon S3. Configure an import path on the Lambda functions to point to the zip archive.
    ❌ Lý do sai: Lambda không hỗ trợ import path trực tiếp từ S3 zip như vậy (chỉ hỗ trợ Layers hoặc code inline/container). Phải download S3 vào /tmp runtime (tăng cold start, giới hạn 512MB /tmp). Không efficient: Phải update mỗi function thủ công + code xử lý download → tăng complexity, lỗi-prone. Không phải best practice.

  • [SAI] Create a new Lambda function that contains and runs the shared code. Update the existing Lambda functions to invoke the new Lambda function synchronously.
    ❌ Lý do sai: Tạo function riêng để chạy shared code rồi invoke sync gây latency cao (2x execution time + network overhead), tăng chi phí (2 invocations/billing). Không efficient: Phải manage thêm function (permissions, errors), scale kém nếu shared code heavy. Phù hợp microservices lớn, không phải reusable code đơn giản.

  • [ĐÚNG] Create a Lambda layer that contains the zip archive. Attach the Lambda layer to the Lambda functions.
    ✅ Lý do đúng (như phần trên): Tối ưu nhất - Deploy zip → layer → attach multi-functions. Versioning tự động, zero-downtime update, giảm kích thước deployment package. Hỗ trợ tất cả runtimes (Python/Node/Java/etc.), tích hợp SAM/ CDK dễ dàng.

  • [SAI] Create a Lambda container image that includes the shared code. Use the container image as a Lambda base image for all the functions.
    ❌ Lý do sai: Container images (ECR) phù hợp full runtime + code lớn (>250MB layers), nhưng quá phức tạp cho shared code zip: Phải rebuild/redeploy TẤT CẢ functions mỗi update (không shared như layers). Tăng kích thước image → cold start chậm hơn, chi phí ECR lưu trữ. Không efficient cho reusable libraries (AWS recommend layers trước containers).

🛡️ Kết luận: Lambda Layers là gold standard cho shared code theo AWS 2026. Nếu code >250MB hoặc cần custom runtime, mới cân nhắc containers. Sử dụng AWS SAM/CLI để automate: sam deploy --layer-version.

Câu 1274
A team has an Amazon API Gateway REST API that consists of a single resource and a GET method that is backed by an AWS Lambda integration.

A developer makes a change to the Lambda function and deploys the function as a new version. The developer needs to set up a process to test the new version of the function before using the new version in production. The tests must not affect the production REST API.

Which solution will meet these requirements with the LEAST operational overhead?
  1. A Create a new resource in the REST API. Add a GET method to the new resource, and add a Lambda integration to the updated version of the Lambda function. Deploy the new version.
  2. B Create a new stage for the REST API. Create a stage variable. Assign the stage variable to the Lambda function. Set the API Gateway integrated Lambda function name to the stage variable. Deploy the new version.
  3. C Create a new REST API. Add a resource that has a single GET method that is integrated with the updated version of the Lambda function.
  4. D Update the Lambda integration of the existing GET method to point to the updated version of the Lambda function. Deploy the new version.
Xem giải thích

🧩 Giải thích nội dung câu hỏi
Câu hỏi xoay quanh một nhóm phát triển đang sử dụng Amazon API Gateway REST API với chỉ một resource duy nhất và phương thức GET, được tích hợp (backed by) với AWS Lambda. Một lập trình viên đã thay đổi code Lambda và triển khai dưới dạng version mới. Yêu cầu là thiết lập quy trình test version mới trước khi đưa vào production, đồng thời không ảnh hưởng đến REST API đang chạy production. Giải pháp phải có operational overhead thấp nhất (ít công sức vận hành nhất).
🔍 Yêu cầu chính:

  • Test an toàn, tách biệt với production.
  • Sử dụng tính năng AWS mới nhất (đến 2026): API Gateway hỗ trợ stages (dev/prod), stage variables cho dynamic Lambda alias/version, và Lambda versioning/aliases cho blue-green deployment.
  • Tránh thay đổi trực tiếp production để giảm rủi ro downtime hoặc lỗi.

✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a new stage for the REST API. Create a stage variable. Assign the stage variable to the Lambda function. Set the API Gateway integrated Lambda function name to the stage variable. Deploy the new version.

🛠️ Lý do chi tiết:

  • Tạo stage mới (ví dụ: "test" hoặc "dev") cho phép test độc lập mà không ảnh hưởng stage production (ví dụ: "prod").
  • Sử dụng stage variable (như lambdaVersion) để động chỉ định Lambda function name/alias/version (ví dụ: $lambdaAlias:$testVersion).
  • Cấu hình integration URI của Lambda thành stage variable: arn:aws:apigateway:.../invocations?${stageVariables.lambdaVersion}.
  • Deploy stage mới → Test qua URL stage test (https://api-id.execute-api.region.amazonaws.com/test/). Production giữ nguyên stage variable cũ.
  • Least overhead: Chỉ cần tạo stage/variable (CLI/Console nhanh), không tạo resource/API mới, dễ switch traffic bằng alias (như $LATEST → $PROD), hỗ trợ canary/blue-green deployment tự động. Phù hợp best practice AWS DevOps (2026).

📋 Phân tích tất cả các phương án

🔴 Phương án A (SAI):
Create a new resource in the REST API. Add a GET method to the new resource, and add a Lambda integration to the updated version of the Lambda function. Deploy the new version.
❌ Lý do sai: Tạo resource mới trong cùng REST API/stage vẫn có thể ảnh hưởng production nếu deploy stage chung (client có thể gọi nhầm endpoint mới). Overhead cao: Phải quản lý nhiều resource/method, refactor client code để test (/new-resource thay vì /old), không tách biệt môi trường thực sự. Không tận dụng stage/variable.

🔵 Phương án B (ĐÚNG):
Create a new stage for the REST API. Create a stage variable. Assign the stage variable to the Lambda function. Set the API Gateway integrated Lambda function name to the stage variable. Deploy the new version.
✅ Lý do đúng: Như giải thích trên – tách biệt hoàn hảo qua stages, dynamic switch qua variable, overhead thấp nhất (chỉ vài click/CLI), hỗ trợ test production-like traffic.

🔴 Phương án C (SAI):
Create a new REST API. Add a resource that has a single GET method that is integrated with the updated version of the Lambda function.
❌ Lý do sai: Tạo REST API hoàn toàn mới có overhead rất cao: Phải duplicate config (domain, auth, CORS, throttling), quản lý 2 APIs riêng (custom domain phức tạp), migrate traffic thủ công. Không hiệu quả cho test nhanh, vi phạm "least operational overhead".

🔴 Phương án D (SAI):
Update the Lambda integration of the existing GET method to point to the updated version of the Lambda function. Deploy the new version.
❌ Lý do sai: Thay đổi trực tiếp integration hiện tại và deploy → Ảnh hưởng ngay production (downtime/rủi ro lỗi). Không có môi trường test riêng, trái yêu cầu "tests must not affect production".

📘 Tài liệu tham khảo (AWS cập nhật 2026):

🚀 Khuyến nghị thực tế: Sử dụng AWS CDK/SAM để automate stage creation, kết hợp CodePipeline cho full CI/CD pipeline!

Câu 1275
A developer manages encryption keys in AWS Key Management Service (AWS KMS). The developer must ensure that all encryption keys can be deleted immediately when the keys are no longer required. The developer wants a solution that is highly available and does not require manual management for compute infrastructure.

Which solution will meet these requirements?
  1. A Use AWS KMS managed keys. When the keys are no longer required, schedule the keys for immediate deletion.
  2. B Use customer managed keys with imported key material. When the keys are no longer required, delete the imported key material.
  3. C Use customer managed keys. When the keys are no longer required, delete the key material.
  4. D Use customer managed keys and an AWS CloudHSM key store. When the keys are no longer required, schedule the keys for immediate deletion.
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 việc quản lý encryption keys trong AWS Key Management Service (AWS KMS). Developer cần một giải pháp cho phép xóa keys ngay lập tức (immediate deletion) khi không còn cần, đồng thời đảm bảo:

  • Highly available (có tính sẵn sàng cao, tự động scale và replicate).
  • Không yêu cầu quản lý thủ công compute infrastructure (không cần tự quản lý server, cluster hay phần cứng).

🛠️ Yêu cầu cốt lõi: AWS KMS là dịch vụ managed hoàn toàn, nhưng các loại key khác nhau có quy trình xóa khác nhau. Không phải key nào cũng hỗ trợ xóa ngay lập tức (thường có waiting period 7-30 ngày để tránh xóa nhầm). Giải pháp phải tận dụng tính năng đặc biệt của KMS mà không cần dịch vụ bên ngoài như CloudHSM (yêu cầu quản lý cluster).

📘 Kiến thức cập nhật AWS (2026): Theo AWS KMS Developer Guide (phiên bản mới nhất), chỉ customer managed keys (CMKs) với imported key material cho phép delete key material ngay lập tức, làm key unusable immediately. KMS vẫn highly available với multi-AZ replication.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Use customer managed keys with imported key material. When the keys are no longer required, delete the imported key material.

Lý do:

  • 🗝️ Với CMKs có imported key material (key material do customer tự generate và import vào KMS), bạn có thể delete imported key material ngay lập tức qua API DeleteImportedKeyMaterial. Điều này làm key unusable ngay lập tức (không thể dùng để encrypt/decrypt), đáp ứng "deleted immediately".
  • ✅ Highly available: KMS managed service, tự động replicate key material qua multi-AZ, không downtime.
  • ✅ No manual compute management: Không cần quản lý server; KMS xử lý toàn bộ.
  • So với các loại key khác, đây là duy nhất hỗ trợ immediate deletion mà vẫn giữ lợi ích managed service.

📝 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 bằng tiếng Anh), với lý do đúng/sai dựa trên docs AWS KMS:

  • ❌ [SAI] Use AWS KMS managed keys. When the keys are no longer required, schedule the keys for immediate deletion.
    Lý do sai: AWS managed keys (AWS owned/CMK không imported) KHÔNG hỗ trợ immediate deletion. Phải schedule deletion với waiting period tối thiểu 7 ngày (có thể lên 30 ngày). Không đáp ứng "deleted immediately". (Nguồn: AWS KMS FAQ - Key deletion policies).

  • ✅ [ĐÚNG] Use customer managed keys with imported key material. When the keys are no longer required, delete the imported key material.
    Lý do đúng: Như đã giải thích ở trên, delete imported key material qua API làm key unusable ngay lập tức. Hoàn hảo cho highly available và no manual management. (Nguồn: AWS KMS API Reference - DeleteImportedKeyMaterial).

  • ❌ [SAI] Use customer managed keys. When the keys are no longer required, delete the key material.
    Lý do sai: CMKs thông thường (không imported) KHÔNG cho phép delete key material trực tiếp. Chỉ có schedule deletion với waiting period 7-30 ngày. "Delete key material" không tồn tại cho loại này. (Nguồn: AWS KMS Developer Guide - Deleting KMS keys).

  • ❌ [SAI] Use customer managed keys and an AWS CloudHSM key store. When the keys are no longer required, schedule the keys for immediate deletion.
    Lý do sai: CloudHSM yêu cầu quản lý thủ công cluster HSM (provision instances, manage backups, scaling), vi phạm "no manual management for compute infrastructure". Deletion cũng chỉ schedule, không immediate. Không highly available tự động như KMS thuần. (Nguồn: AWS CloudHSM User Guide - Key stores in KMS).

📚 Tài liệu tham khảo

  • AWS KMS Developer Guide: Key material & Deleting keys (cập nhật 2025-2026).
  • AWS KMS API Reference: DeleteImportedKeyMaterial (unique cho imported keys).
  • AWS Well-Architected Framework - Security Pillar: Khuyến nghị imported keys cho control cao hơn.

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần thêm ví dụ code, hỏi nhé!

Câu 1276
A company has an ecommerce application. The application's API sends order data to an Amazon Simple Queue Service (Amazon SOS) queue. A developer needs to modify the application to enrich the order data before the application sends the order data to a fulfillment system.

Which solution will meet this requirement with the LEAST development effort?
  1. A Create an AWS Lambda function to poll the SOS queue. enrich the message data, and send the enriched data to the fulfilment system, Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda function to the SNS topic.
  2. B Create an AWS Step Functions state machine. Configure an Amazon EventBridge rule to run the state machine when an order is published to the SQS queue. Map the orders to an AWS Lambda function. Program the Lambda function to perform the data enrichment and to invoke the state machine. Configure the last step of the state machine to send the enriched data to the fulfilment system,
  3. C Create an Amazon EMR cluster to read messages from the SQS queue. Configure an EMR job to enrich the order data. Create and configure an Amazon S3 bucket as the output location. Adjust the order fulfilment system to retrieve the enriched files from the S3 bucket.
  4. D Create an Amazon EventBridge pipe that uses event enrichment. Configure the SQS queue as a source for the pipe. Set the fulfillment system as the target of the pipe.
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 một ứng dụng thương mại điện tử (ecommerce) trên AWS, nơi API của ứng dụng gửi dữ liệu đơn hàng (order data) vào hàng đợi Amazon Simple Queue Service (Amazon SQS). Nhà phát triển cần sửa đổi ứng dụng để làm phong phú hóa (enrich) dữ liệu đơn hàng trước khi gửi đến hệ thống thực hiện đơn hàng (fulfillment system). Yêu cầu chính là chọn giải pháp với ÍT NHIỆU CÔNG SỨC PHÁT TRIỂN NHẤT (LEAST development effort).

🛠️ Mục tiêu cốt lõi: Xử lý dữ liệu từ SQS một cách tự động, thêm thông tin bổ sung (enrichment) mà không cần viết nhiều code, quản lý infrastructure thủ công, phù hợp với kiến trúc serverless hiện đại trên AWS (cập nhật đến 2026, sử dụng EventBridge Pipes và các dịch vụ managed mới nhất).

📘 Tài liệu tham khảo:

  • AWS Documentation: Amazon EventBridge Pipes (tính năng chính thức từ 2023, hỗ trợ enrichment native).
  • AWS Well-Architected Framework: Serverless Lens (ưu tiên least effort với managed services).
  • AWS re:Post & Exam Dumps DOP-C02 (DevOps Engineer Pro, cập nhật 2025).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create an Amazon EventBridge pipe that uses event enrichment. Configure the SQS queue as a source for the pipe. Set the fulfillment system as the target of the pipe.

Lý do chọn 🏆:

  • EventBridge Pipes là dịch vụ serverless integration managed hoàn toàn, hỗ trợ source trực tiếp từ SQS queue (FIFO/Standard), enrichment tự động (qua Lambda, HTTP API, hoặc mapping transformer), và target linh hoạt (như API Gateway, Lambda, SQS khác, hoặc fulfillment system qua HTTP/HTTPS).
  • Least development effort: Không cần viết code polling, trigger thủ công, hay state machine phức tạp. Chỉ cần cấu hình pipe qua Console/CLI/CDK (vài phút), AWS tự quản lý scaling, retry, dead-letter queue (DLQ).
  • Phù hợp cập nhật 2026: Pipes hỗ trợ batching lên đến 10k messages, enrichment với Step Functions mini, và integration native với 200+ targets (bao gồm custom HTTP cho fulfillment).

🔍 Phân tích tất cả các phương án (đúng/sai)

  • ❌ Phương án SAI 1: Create an AWS Lambda function to poll the SOS queue. enrich the message data, and send the enriched data to the fulfilment system, Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda function to the SNS topic.

    • Giải thích sai: Phương án này yêu cầu viết code Lambda để poll SQS thủ công (sử dụng ReceiveMessage API, xử lý long-polling), sau đó enrich và push vào SNS, rồi subscribe Lambda khác. Quá nhiều code (polling logic, error handling, visibility timeout), không tận dụng trigger tự động của SQS-Lambda. SNS thừa thãi vì không cần fan-out ở đây. Effort cao: Phát triển + test polling ~ vài giờ/ngày.
  • ❌ Phương án SAI 2: Create an AWS Step Functions state machine. Configure an Amazon EventBridge rule to run the state machine when an order is published to the SQS queue. Map the orders to an AWS Lambda function. Program the Lambda function to perform the data enrichment and to invoke the state machine. Configure the last step of the state machine to send the enriched data to the fulfilment system.

    • Giải thích sai: Quá phức tạp và lặp vòng: EventBridge rule trigger Step Functions từ SQS (cần custom rule), Lambda enrich rồi invoke lại Step Functions (self-loop rủi ro), cuối cùng send target. Yêu cầu code Lambda + ASL (Amazon States Language) dài, quản lý execution history. EventBridge Pipes làm điều này managed mà không cần Step Functions. Effort cao: Thiết kế state machine ~ vài ngày, dễ lỗi infinite loop.
  • ❌ Phương án SAI 3: Create an Amazon EMR cluster to read messages from the SQS queue. Configure an EMR job to enrich the order data. Create and configure an Amazon S3 bucket as the output location. Adjust the order fulfilment system to retrieve the enriched files from the S3 bucket.

    • Giải thích sai: EMR (Elastic MapReduce) dành cho big data processing (Spark/Hadoop), overkill cho enrichment đơn giản từ SQS (real-time/low-volume). Cần provision cluster (EC2 managed), viết EMR job (Scala/Python), drain SQS -> S3, rồi fulfillment poll S3. Không serverless, tốn chi phí idle cluster, latency cao (batch processing). Effort cực cao: Setup EMR + job flow ~ tuần, không phù hợp ecommerce real-time.
  • ✅ Phương án ĐÚNG 4: Create an Amazon EventBridge pipe that uses event enrichment. Configure the SQS queue as a source for the pipe. Set the fulfillment system as the target of the pipe.

    • Giải thích đúng: Như đã nêu ở trên, managed end-to-end: Source SQS (auto-polling), Enrichment (native via filter/mapping hoặc Lambda invoke), Target trực tiếp (HTTP/SQS/Lambda). Zero provisioning, auto-scale, built-in retry/DLQ. Least effort: Cấu hình JSON qua Console ~5 phút, hỗ trợ CDK/Terraform.

🛠️ Kết luận khuyến nghị: Chọn Pipes để tuân thủ nguyên tắc serverless-first trong DOP-C02 exam. Test nhanh trên AWS Free Tier để verify! 🚀

Câu 1277
An application interacts with Amazon Aurora to store and track customer information. The primary database is set up with multiple read replicas for improving the performance of the read queries. However, one of the Aurora replicas is receiving most or all of the traffic, while the other Aurora replica remains idle.

How can this issue be resolved?
  1. A Disable application-level DNS caching.
  2. B Enable application-level DNS caching.
  3. C Enable application pooling
  4. D Disable application pooling
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 vấn đề phân tải traffic đọc (read traffic) trong Amazon Aurora – một dịch vụ cơ sở dữ liệu quan hệ tương thích MySQL/PostgreSQL được quản lý bởi AWS.

  • Tình huống: Ứng dụng sử dụng Aurora cluster với primary database (viết chính) và nhiều read replicas để tăng hiệu suất cho các truy vấn đọc (read queries). Tuy nhiên, một read replica nhận hầu hết hoặc toàn bộ traffic, trong khi các replica khác nhàn rỗi (idle).
  • Nguyên nhân gốc rễ 🛠️: Aurora sử dụng cluster reader endpoint (endpoint đọc chung) để tự động phân tải traffic qua DNS round-robin với TTL (Time To Live) thấp (khoảng 30 giây). Nhưng nếu ứng dụng cache DNS ở mức application-level (ví dụ: Java có JVM DNS cache mặc định 30 phút, hoặc app tự implement caching), ứng dụng sẽ chỉ query DNS một lần, nhận danh sách replicas cố định và "kẹt" traffic vào một replica duy nhất.
  • Mục tiêu giải quyết: Đảm bảo traffic được phân bổ đều giữa các read replicas để tận dụng tối đa scalability và performance.

Vấn đề này phổ biến trong Aurora MySQL/PostgreSQL (cập nhật đến 2026, vẫn giữ cơ chế DNS-based load balancing cho reader endpoints, với cải tiến như Proxy hỗ trợ nhưng không thay thế hoàn toàn).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Disable application-level DNS caching.

Lý do chi tiết 📘:

  • Khi tắt cache DNS ở mức ứng dụng, ứng dụng sẽ query DNS thường xuyên (theo TTL của AWS ~30 giây), nhận được danh sách endpoints replicas mới nhất từ cluster reader endpoint.
  • Điều này kích hoạt round-robin load balancing tự động của Aurora, phân tải traffic đều đến tất cả read replicas, giải quyết tình trạng "hot replica" (một replica quá tải).
  • Best practice AWS (cập nhật 2026): Luôn disable app-level DNS caching cho Aurora reader endpoints để tránh override cơ chế native load balancing. Nếu dùng Aurora Proxy (ra mắt 2022, cập nhật liên tục), nó hỗ trợ connection pooling tốt hơn nhưng không thay thế disable DNS cache.

❌ Giải thích tất cả các phương án trả lời

Dưới đây là phân tích từng phương án một cách chi tiết. Tôi giữ nguyên nội dung gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với lý do đúng/sai dựa trên kiến thức AWS mới nhất:

  • ✅ [ĐÚNG] Disable application-level DNS caching.
    🛠️ Đúng vì: Như giải thích trên, việc tắt cache DNS ở app-level cho phép ứng dụng refresh endpoint thường xuyên, tận dụng DNS round-robin của Aurora. Đây là giải pháp trực tiếp, nhanh chóng và không cần thay đổi hạ tầng.

  • ❌ [SAI] Enable application-level DNS caching.
    🛠️ Sai vì: Bật cache DNS ở app-level sẽ làm vấn đề tệ hơn – ứng dụng cache endpoint lâu dài (ví dụ: JVM mặc định 30 phút), chỉ route traffic đến replicas đầu tiên nhận được, bỏ qua các replica khác hoàn toàn.

  • ❌ [SAI] Enable application pooling.
    🛠️ Sai vì: Connection pooling (như HikariCP, PgBouncer) quản lý pool kết nối tái sử dụng đến DB để giảm overhead, nhưng không giải quyết load balancing giữa replicas. Nó chỉ tối ưu connections đến một endpoint cố định, vẫn giữ tình trạng một replica quá tải.

  • ❌ [SAI] Disable application pooling.
    🛠️ Sai vì: Tắt connection pooling sẽ tăng overhead kết nối mới (expensive về CPU/network), làm giảm performance tổng thể mà không ảnh hưởng đến phân tải replicas. Đây thậm chí là anti-pattern; AWS khuyến nghị giữ pooling ON kết hợp disable DNS cache.

📘 Tài liệu tham khảo (AWS cập nhật đến 2026)

Hy vọng phân tích này giúp bạn ôn thi AWS Certified DevOps Engineer Professional hiệu quả! 🚀 Nếu cần thêm ví dụ code/config, hãy hỏi nhé!

Câu 1278
A company runs continuous integration/continuous delivery (CI/CD) pipelines for its application on AWS CodePipeline. A developer must write unit tests and run them as part of the pipelines before staging the artifacts for testing.

How should the developer incorporate unit tests as part of CI/CD pipelines?
  1. A Create a separate CodePipeline pipeline to run unit tests.
  2. B Update the AWS CodeBuild build specification to include a phase for running unit tests.
  3. C Install the AWS CodeDeploy agent on an Amazon EC2 instance to run unit tests.
  4. D Create a testing branch in a git repository for the pipelines to run unit tests.
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 việc tích hợp unit tests (kiểm thử đơn vị) vào quy trình CI/CD pipelines sử dụng AWS CodePipeline. Cụ thể:

  • Công ty đang chạy pipelines CI/CD cho ứng dụng trên CodePipeline.
  • Developer cần viết unit tests và chạy chúng trước khi staging artifacts (giai đoạn chuẩn bị artifacts để test tiếp theo).
  • Mục tiêu: Đảm bảo unit tests được thực thi tự động trong pipeline, giúp phát hiện lỗi sớm, phù hợp với best practice DevOps trên AWS (theo phiên bản mới nhất 2024-2026, CodePipeline hỗ trợ tích hợp chặt chẽ với CodeBuild cho build/test/deploy).
    ✅ Đáp án đúng: Update the AWS CodeBuild build specification to include a phase for running unit tests.

Lý do lựa chọn:
🛠️ Trong CodePipeline, stage CodeBuild là nơi lý tưởng để chạy build và test (bao gồm unit tests). File buildspec.yaml (build specification) cho phép định nghĩa các phase như install, pre_build, build, post_build, và đặc biệt phase test để chạy unit tests tự động. Tests chạy song song hoặc tuần tự, artifacts chỉ được staging nếu tests pass. Điều này đảm bảo pipeline liền mạch, không cần tool ngoài, và scale tự động với managed build environments (cập nhật mới nhất: hỗ trợ test reports với JUnit/XML để visualize trên CodeBuild console).

📋 Giải thích tất cả các phương án trả lời

  • ❌ Create a separate CodePipeline pipeline to run unit tests.
    Phương án này sai vì tạo pipeline riêng biệt sẽ làm phức tạp quy trình CI/CD, tăng chi phí quản lý và không đảm bảo thứ tự (unit tests phải chạy trước staging trong cùng pipeline). CodePipeline được thiết kế để chain các action (source → build → test → deploy) trong một pipeline duy nhất, tránh duplicate efforts.

  • ✅ Update the AWS CodeBuild build specification to include a phase for running unit tests.
    Phương án này đúng như đã giải thích ở trên: Sử dụng phase test trong buildspec.yaml (ví dụ: test: commands: - npm test hoặc mvn test), tích hợp trực tiếp vào stage CodeBuild của pipeline. Tests fail → pipeline dừng, artifacts không stage. Hỗ trợ batch testing và reports (JUnit parser từ 2023+).

  • ❌ Install the AWS CodeDeploy agent on an Amazon EC2 instance to run unit tests.
    Phương án này sai vì AWS CodeDeploy chỉ dùng cho deployment (deploy artifacts lên EC2/ECS/Lambda), không phải chạy tests. Agent trên EC2 là để nhận deploy hooks, không hỗ trợ unit tests. Sử dụng sai tool, vi phạm separation of concerns trong CI/CD.

  • ❌ Create a testing branch in a git repository for the pipelines to run unit tests.
    Phương án này sai vì branch trong Git chỉ là cơ chế source control (như feature/testing branch), không tự động chạy tests. Pipeline vẫn cần trigger từ source stage (CodeCommit/GitHub), nhưng branching không thay thế integration tests vào build phase. Có thể dùng branch filters trong CodePipeline, nhưng không giải quyết yêu cầu "incorporate unit tests".

📘 Tài liệu tham khảo (AWS Docs cập nhật 2024-2026)

Hy vọng phân tích này giúp bạn nắm vững kiến thức DOP-C02! 🚀 Nếu cần ví dụ buildspec.yaml cụ thể, hãy hỏi thêm nhé!

Câu 1279 Chọn nhiều đáp án
A developer is troubleshooting a three-tier application, which is deployed on Amazon EC2 instances. There is a connectivity problem between the application servers and the database servers.

Which AWS services or tools should be used to identity the faulty component? (Choose two.)
  1. A AWS CloudTrail
  2. B AWS Trusted Advisor
  3. C Amazon VPC Flow Logs
  4. D Network access control lists
  5. E AWS Config rules
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 khắc phục sự cố kết nối (troubleshooting connectivity problem) trong một ứng dụng ba tầng (three-tier application) được triển khai trên các instance Amazon EC2. Cụ thể, có vấn đề về kết nối giữa máy chủ ứng dụng (application servers) và máy chủ cơ sở dữ liệu (database servers).
📌 Mục tiêu: Xác định thành phần bị lỗi (identify the faulty component) bằng cách chọn HAI dịch vụ hoặc công cụ AWS phù hợp nhất (Choose two).
🔍 Bối cảnh: Đây là vấn đề mạng (network-related), thường liên quan đến luồng dữ liệu IP, quy tắc bảo mật hoặc cấu hình VPC. Chúng ta cần các công cụ theo dõi lưu lượng mạng chi tiết để pinpoint nguyên nhân như block traffic, route sai hoặc ACL từ chối.

✅ Đáp án đúng (Chọn TWO)

Amazon VPC Flow Logs và Network access control lists.

Lý do lựa chọn:
🛠️ Amazon VPC Flow Logs ghi lại toàn bộ thông tin về lưu lượng mạng (IP traffic) vào/ra các network interface trong VPC, bao gồm accept/reject, giúp phát hiện chính xác điểm nghẽn kết nối (ví dụ: traffic bị drop giữa app và DB). Đây là công cụ cốt lõi cho network troubleshooting theo best practices AWS mới nhất (2024-2026).
🛠️ Network access control lists (NACLs) là firewall stateless ở mức subnet, kiểm tra rules để xác định xem traffic có bị chặn bởi inbound/outbound rules không – rất phổ biến trong three-tier app nơi app servers và DB servers ở các subnet khác nhau.
📘 Nguồn tham khảo:

📋 Phân tí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 bằng tiếng Anh. Tôi đánh dấu ✅ (đúng) hoặc ❌ (sai), kèm giải thích bằng tiếng Việt rõ ràng:

  • AWS CloudTrail
    ❌ Sai: AWS CloudTrail chỉ ghi lại các API calls và hoạt động quản trị (management events), không theo dõi lưu lượng mạng thực tế (network traffic) giữa EC2 instances. Không giúp identify faulty component trong connectivity problem.
    📘 Tham khảo: CloudTrail User Guide.

  • AWS Trusted Advisor
    ❌ Sai: Đây là công cụ kiểm tra best practices tổng quát (cost, performance, security), không cung cấp dữ liệu chi tiết về network flow hoặc connectivity issues cụ thể. Nó có thể gợi ý cải thiện VPC nhưng không troubleshoot realtime.
    📘 Tham khảo: Trusted Advisor.

  • Amazon VPC Flow Logs
    ✅ Đúng: Công cụ mạnh mẽ capture metadata về traffic (source/dest IP, port, accept/reject), lý tưởng để phân tích tại sao app servers không kết nối được DB servers (ví dụ: traffic rejected do security group hoặc route). Hỗ trợ integration với CloudWatch Logs/ Athena cho query sâu.
    🛠️ Ưu điểm mới nhất (2026): Tích hợp AI insights qua Amazon VPC Reachability Analyzer.
    📘 Tham khảo: Flow Logs.

  • Network access control lists
    ✅ Đúng: NACLs kiểm soát traffic ở subnet level (inbound/outbound rules), giúp xác định nếu rule đang block traffic từ app subnet đến DB subnet. Trong three-tier app, NACL thường là faulty component phổ biến bên cạnh Security Groups.
    🛠️ Lưu ý: NACL stateless nên evaluate cả request và response.
    📘 Tham khảo: NACLs.

  • AWS Config rules
    ❌ Sai: AWS Config rules đánh giá compliance cấu hình tài nguyên (ví dụ: EC2 có public IP?), không ghi log network traffic hoặc connectivity realtime. Không phù hợp cho troubleshooting fault ngay lập tức.
    📘 Tham khảo: Config Rules.

🏆 Kết luận & Best Practices

🔥 Combo lý tưởng: Bắt đầu bằng VPC Flow Logs để xem traffic flow, sau đó kiểm tra NACLs (và Security Groups) để fix rules. Nếu cần sâu hơn, dùng VPC Reachability Analyzer (mới, path analysis).
💡 Mẹo DevOps: Enable Flow Logs mặc định cho production VPC để proactive monitoring!

Câu 1280
A company runs a new application on AWS Elastic Beanstalk. The company needs to deploy updates to the application. The updates must not cause any downtime for application users.

The deployment must forward a specified percentage of incoming client traffic to a new application version during an evaluation period.

Which deployment type will meet these requirements?
  1. A rolling
  2. B traffic-splitting
  3. C in-place
  4. D immutable
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 AWS Elastic Beanstalk 📦, một dịch vụ PaaS giúp triển khai và quản lý ứng dụng web một cách dễ dàng. Công ty đang chạy ứng dụng mới trên Elastic Beanstalk và cần deploy updates (cập nhật ứng dụng) mà không gây downtime (gián đoạn dịch vụ) cho người dùng.

Yêu cầu cụ thể:

  • Forward một tỷ lệ phần trăm traffic nhất định từ client đến phiên bản ứng dụng mới trong giai đoạn đánh giá (evaluation period).
  • Điều này giống như kỹ thuật canary deployment hoặc A/B testing, nơi traffic được phân bổ dần dần để kiểm tra phiên bản mới trước khi rollout hoàn toàn.

🛠️ Deployment types trong Elastic Beanstalk (cập nhật đến 2026): Elastic Beanstalk hỗ trợ nhiều chính sách triển khai (deployment policies) qua Auto Scaling Group (ASG) và Application Load Balancer (ALB), bao gồm Rolling, Immutable, Traffic Splitting, v.v. Chúng được cấu hình qua console, CLI hoặc .ebextensions.

📘 Tài liệu tham khảo:

✅ Đáp án đúng: traffic-splitting

Lý do lựa chọn:

  • Traffic-splitting là chính sách triển khai chính xác phù hợp nhất! 🏆 Nó sử dụng Application Load Balancer (ALB) để phân bổ traffic theo tỷ lệ phần trăm cụ thể (ví dụ: 10% traffic đến phiên bản mới trong evaluation period).
  • Không gây downtime vì traffic được split động giữa old và new target groups (TG cũ/mới). Sau evaluation, tự động chuyển 100% traffic sang new version nếu thành công.
  • Hỗ trợ blue/green-like deployment với kiểm soát tinh tế, lý tưởng cho zero-downtime và testing.
  • Cấu hình: Sử dụng DeploymentPolicy: TrafficSplitting trong .ebextensions/options.config, với tham số như EvaluationTime và splitTrafficOnPercentage.

📋 Giải thích tất cả các phương án (sử dụng emoji để phân biệt)

  • ❌ rolling
    Sai vì: Rolling triển khai theo batch (lô instances), thay thế dần instances cũ bằng mới trong ASG. Có thể gây downtime ngắn nếu batch size lớn, và không hỗ trợ split traffic theo % cụ thể. Nó chỉ đảm bảo high availability cơ bản, không có evaluation period với traffic routing chính xác. Phù hợp cho rolling updates đơn giản, nhưng không đáp ứng yêu cầu "forward specified percentage".

  • ✅ traffic-splitting
    Đúng vì: Như giải thích trên, đây là lựa chọn hoàn hảo! ALB listener rules tự động route % traffic (configurable từ 1-99%) đến new version trong thời gian đánh giá. Zero-downtime, rollback dễ dàng nếu vấn đề xảy ra. Đã được cập nhật tối ưu trong EB 2024-2026 với hỗ trợ Network Load Balancer (NLB) tốt hơn.

  • ❌ in-place
    Sai vì: In-place (hay All-at-Once) deploy trực tiếp lên instances hiện tại, dừng ứng dụng tạm thời trên mỗi instance. Gây downtime rõ rệt (dù ngắn), không có cơ chế split traffic hay evaluation. Chỉ phù hợp môi trường dev/test nhỏ, không dùng cho production zero-downtime.

  • ❌ immutable
    Sai vì: Immutable tạo fleet instances mới hoàn toàn song song với old fleet, deploy lên đó rồi swap URLs/environment. Zero-downtime, nhưng không split traffic theo %. Traffic chuyển all-or-nothing sau swap, không có giai đoạn evaluation với % cụ thể. Tốn chi phí hơn (double resources tạm thời) và không linh hoạt cho canary testing.

🧩 Tóm tắt so sánh nhanh: | Yếu tố | Rolling | Traffic-splitting | In-place | Immutable | |--------|---------|-------------------|----------|-----------| | Zero-downtime | Có thể | ✅ Có | ❌ Không | ✅ Có | | Split % traffic | ❌ Không | ✅ Có | ❌ Không | ❌ Không | | Evaluation period | ❌ Không | ✅ Có | ❌ Không | ❌ Không |

Lời khuyên DevOps 🚀: Sử dụng Traffic Splitting kết hợp CloudWatch alarms và X-Ray để monitor evaluation period. Test qua EB console trước khi apply production!