Ngân hàng đề — AWS Certified Developer Associate
Tìm thấy 1356 câu.
The developer needs to test the updated Lambda function before deploying the Lambda function to production. The testing must not affect any production users of the web application.
Which solution will meet these requirements in the MOST operationally efficient way?
- A Create a canary release deployment for the existing API stage. Deploy the API to the existing stage. Test the updated Lambda function by using the existing URL.
- B Update the API Gateway API endpoint type to private. Deploy the changes to the existing API stage. Test the API by using the existing URL.
- C Create a new test API stage in API Gateway. Add stage variables to deploy the updated Lambda function to only the test stage. Test the updated Lambda function by using the new stage URL.
- D Create a new AWS CloudFormation stack to deploy a copy of the entire production API and Lambda function. Use the stack's API URL to test the updated Lambda function.
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 kiểm tra (test) một phiên bản cập nhật của AWS Lambda function đang được sử dụng làm backend cho API Gateway (kết nối với ứng dụng web).
Developer cần test trước khi deploy lên production, đảm bảo không ảnh hưởng đến người dùng production. Giải pháp phải là MOST operationally efficient (hiệu quả vận hành nhất), nghĩa là:
- Tiết kiệm tài nguyên, thời gian, chi phí.
- Dễ quản lý, ít thay đổi infrastructure.
- Sử dụng tính năng native của AWS (theo best practices DevOps trên AWS đến 2026).
🛠️ Bối cảnh kỹ thuật (cập nhật AWS 2024-2026):
API Gateway hỗ trợ stages (môi trường như dev/test/prod) để deploy và test riêng biệt. Kết hợp stage variables để chỉ định Lambda alias/version cụ thể cho từng stage (ví dụ: $LATEST cho test, production alias cho prod). Lambda hỗ trợ versioning và aliases để test an toàn. Không cần duplicate toàn bộ stack.
📘 Tài liệu tham khảo:
- AWS API Gateway Stages
- API Gateway Stage Variables
- Lambda Versions & Aliases
- AWS Well-Architected Framework: Operational Excellence Pillar (DevOps best practices).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a new test API stage in API Gateway. Add stage variables to deploy the updated Lambda function to only the test stage. Test the updated Lambda function by using the new stage URL.
Lý do (hiệu quả vận hành nhất):
🟢 Tạo stage mới (test stage) chỉ mất vài phút qua Console/CLI/CDK, không ảnh hưởng stage production.
🟢 Stage variables (ví dụ: lambdaAlias: "test-alias") cho phép integration chỉ point đến Lambda version mới riêng cho test stage, trong khi prod giữ nguyên alias cũ.
🟢 Test qua URL mới (ví dụ: https://api-id.execute-api.region.amazonaws.com/test/), an toàn 100% với prod users.
🟢 Tiết kiệm nhất: Không duplicate resources, hỗ trợ canary/blue-green sau test, phù hợp CI/CD (CodePipeline). Theo AWS 2026, đây là best practice cho API lifecycle management.
🔍 Giải thích chi tiết tất cả các phương án
Dưới đây là phân tích từng lựa chọn giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể bằng tiếng Việt.
-
Create a canary release deployment for the existing API stage. Deploy the API to the existing stage. Test the updated Lambda function by using the existing URL.
❌ Sai vì: Canary deployment (tính năng API Gateway) sẽ thay đổi stage production hiện tại, gửi một phần traffic thực tế đến Lambda mới. Điều này có nguy cơ ảnh hưởng production users (dù tỷ lệ nhỏ), vi phạm yêu cầu "không ảnh hưởng". Không efficient vì phải rollback nếu test fail, và không tách biệt hoàn toàn môi trường test. -
Update the API Gateway API endpoint type to private. Deploy the changes to the existing API stage. Test the API by using the existing URL.
❌ Sai vì: Chuyển endpoint sang private (sử dụng VPC interface endpoints) chỉ kiểm soát truy cập mạng (không public), không giải quyết vấn đề test Lambda mới mà không ảnh hưởng prod. Deploy vẫn lên stage hiện tại, ảnh hưởng toàn bộ users. Không liên quan đến versioning/test, làm phức tạp hóa không cần thiết (thêm VPC config). -
Create a new test API stage in API Gateway. Add stage variables to deploy the updated Lambda function to only the test stage. Test the updated Lambda function by using the new stage URL.
✅ Đúng (như đã giải thích ở trên). Đây là giải pháp native, zero-downtime, low-cost của API Gateway. Stage variables đảm bảo Lambda integration động (ví dụ: mapping template${stageVariables.lambdaAlias}), test độc lập hoàn hảo. -
Create a new AWS CloudFormation stack to deploy a copy of the entire production API and Lambda function. Use the stack's API URL to test the updated Lambda function.
❌ Sai vì: Duplicate toàn bộ stack (API + Lambda) qua CloudFormation tốn kém (double resources/chi phí), thời gian dài (provisioning mới), và khó maintain (sync config giữa stacks). Không efficient so với stage variables (chỉ cần publish Lambda version mới). Theo AWS best practices 2026, tránh "stack explosion" – ưu tiên shared resources qua stages/aliases.
How can the developer achieve this with MINIMAL impact on users?
- A Change the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to use the newly deployed version. If too many errors are encountered, point the alias back to the previous version.
- B Change the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to direct 10% of users to the newly deployed version. If too many errors are encountered, send 100% of traffic to the previous version.
- C Do not make any changes to the application. Deploy the new version of the code. If too many errors are encountered, point the application back to the previous version using the version number in the Amazon Resource Name (ARN).
- D Create three aliases: new, existing, and router. Point the existing alias to the current version. Have the router alias direct 100% of users to the existing alias. Update the application to use the router alias. Deploy the new version of the code. Point the new alias to this version. Update the router alias to direct 10% of users to the new alias. If too many errors are encountered, send 100% of traffic to the existing alias.
Xem giải thích
🧩 Phân tích câu hỏi trắc nghiệm AWS Lambda
📘 Nội dung câu hỏi được giải thích chi tiết:
Câu hỏi tập trung vào việc một lập trình viên (developer) muốn triển khai khả năng rollback (quay lại phiên bản cũ) cho hàm AWS Lambda khi gặp lỗi từ bản deploy mới, đồng thời đảm bảo tác động tối thiểu (MINIMAL impact) đến người dùng.
🛠️ Bối cảnh chính: AWS Lambda hỗ trợ versions (phiên bản immutable) và aliases (bí danh có thể chỉ định traffic weight). Khi deploy code mới, Lambda tự tạo version mới (không ghi đè $LATEST ngay lập tức). Để rollback an toàn, cần cơ chế gradual traffic shifting (chuyển dần traffic, ví dụ 10% trước) nhằm test và giảm thiểu ảnh hưởng đến users. Không dùng $LATEST trực tiếp vì dễ bị ảnh hưởng toàn bộ khi deploy mới. Giải pháp phải đơn giản, không thay đổi lớn app code.
✅ Đáp án đúng:
Change the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to direct 10% of users to the newly deployed version. If too many errors are encountered, send 100% of traffic to the previous version.
Lý do chọn đáp án này (theo kiến thức AWS mới nhất 2026):
🟢 Đây là cách tối ưu nhất sử dụng Lambda Aliases với weighted traffic routing (chuyển 10% traffic sang version mới để canary testing/blue-green deployment). Nếu lỗi, chỉ cần update alias weight về 100% version cũ – rollback tức thì, zero downtime, minimal impact (chỉ 10% users bị ảnh hưởng ban đầu). Không cần thay đổi code phức tạp sau.
📈 Lợi ích: Hỗ trợ gradual rollout, tích hợp với AWS Lambda Console/CLI/API (cập nhật alias routingConfig). Phù hợp DevOps best practices DOP-C02.
🛠️ Phân tích tất cả các phương án (đúng/sai):
-
❌ Phương án SAI:
Change the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to use the newly deployed version. If too many errors are encountered, point the alias back to the previous version.
Giải thích sai: Chuyển 100% traffic ngay sang version mới → toàn bộ users bị ảnh hưởng nếu lỗi, không minimal impact. Rollback bằng alias đơn giản nhưng thiếu gradual testing, vi phạm yêu cầu "minimal impact". -
✅ Phương án ĐÚNG: (Như đã phân tích ở trên – sử dụng 10% traffic shift để test an toàn).
-
❌ Phương án SAI:
Do not make any changes to the application. Deploy the new version of the code. If too many errors are encountered, point the application back to the previous version using the version number in the Amazon Resource Name (ARN).
Giải thích sai: App dùng $LATEST ARN mặc định → deploy mới ghi đè toàn bộ, không có version cũ để rollback. Để dùng specific version ARN cần thay đổi code/app (ví dụ API Gateway integration), mâu thuẫn "do not make changes" và không gradual, impact lớn. -
❌ Phương án SAI:
Create three aliases: new, existing, and router. Point the existing alias to the current version. Have the router alias direct 100% of users to the existing alias. Update the application to use the router alias. Deploy the new version of code. Point the new alias to this version. Update the router alias to direct 10% of users to the new alias. If too many errors are encountered, send 100% of traffic to the existing alias.
Giải thích sai: Quá phức tạp (3 aliases: new/existing/router) không cần thiết. Lambda chỉ hỗ trợ một alias routing đến 2 versions max (không chain aliases như vậy). Tăng operational overhead, dễ lỗi config, không minimal so với single alias đơn giản.
📚 Tài liệu tham khảo (AWS cập nhật 2026):
- AWS Lambda Developer Guide: Versions and aliases – Chi tiết traffic shifting (0-100%).
- AWS DOP-C02 Exam Guide: Lambda deployment strategies.
- AWS Blog: Canary deployments with Lambda aliases.
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ụ CLI, comment nhé!
What code updates will grant these new users access to the API?
- A The createDeployment method must be called so the API can be redeployed to include the newly created API key.
- B The updateAuthorizer method must be called to update the API's authorizer to include the newly created API key.
- C The importApiKeys method must be called to import all newly created API keys into the current stage of the API.
- D The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan.
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 API Gateway sử dụng chế độ xác thực native API key validation cho một REST service. 🛠️ Công ty đã triển khai trang đăng ký mới, nơi người dùng có thể sign up và tạo API key mới thông qua lệnh CreateApiKey. API key này được gửi cho người dùng mới, nhưng khi họ gọi API, họ nhận lỗi 403 Forbidden. Trong khi đó, người dùng hiện tại (existing users) vẫn hoạt động bình thường.
Vấn đề cốt lõi: API key mới chưa được cấu hình đầy đủ để truy cập API. Trong API Gateway, việc chỉ tạo API key bằng CreateApiKey là không đủ. API key cần được liên kết với Usage Plan phù hợp (đã được associate với stage/method của API) để kiểm soát quota, throttling và xác thực. Người dùng cũ thành công vì key của họ đã được associate trước đó. Câu hỏi yêu cầu code updates (cập nhật code) để cấp quyền truy cập cho user mới.
Kiến thức AWS cập nhật (2026): Theo tài liệu AWS mới nhất, quy trình API key đầy đủ bao gồm: Tạo key → Tạo Usage Plan → Associate key với Usage Plan (createUsagePlanKey) → Associate plan với resources. Không redeploy hay update authorizer cho API key validation thuần túy.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan.
Lý do:
- Sau khi tạo API key bằng CreateApiKey, bạn PHẢI gọi createUsagePlanKey để liên kết key đó với Usage Plan đã tồn tại (Usage Plan này phải được associate với stage/method của API).
- Nếu không associate, API Gateway sẽ từ chối key mới dù nó hợp lệ → dẫn đến 403 Forbidden.
- User cũ ok vì key của họ đã associate sẵn. Đây là bước bắt buộc theo best practice AWS để enforce usage limits và security.
- Code update: Sau CreateApiKey, gọi
createUsagePlanKey({usagePlanId: 'xxx', keyId: 'new-key-id', keyType: 'API_KEY'}).
📋 Giải thích tất cả các phương án (đúng/sai)
-
❌ [SAI] The createDeployment method must be called so the API can be redeployed to include the newly created API key.
Lý do sai: createDeployment dùng để deploy changes cho API definition (như thêm method, integration). API key KHÔNG được lưu trong deployment snapshot. Redeploy không ảnh hưởng đến API keys hay Usage Plans → không giải quyết 403. (Chỉ cần khi thay đổi resources.) -
❌ [SAI] The updateAuthorizer method must be called to update the API's authorizer to include the newly created API key.
Lý do sai: Authorizers (như Lambda/Cognito) dùng cho token-based auth (JWT, IAM), KHÔNG áp dụng cho native API key validation. API key validation là cơ chế riêng, không liên quan authorizer → updateAuthorizer vô ích và có thể gây lỗi config. -
❌ [SAI] The importApiKeys method must be called to import all newly created API keys into the current stage of the API.
Lý do sai: importApiKeys là method cũ (deprecated ở phiên bản mới), dùng để import bulk keys từ file CSV vào Usage Plan. Nó KHÔNG tự động associate keys với stage/resources. Hơn nữa, key đã tạo bằng CreateApiKey không cần "import" → không fix vấn đề associate. -
✅ [ĐÚNG] The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan.
Lý do đúng: Như giải thích trên, đây là bước thiếu duy nhất. Associate key vào Usage Plan (đã link với API stage) sẽ enable key ngay lập tức, fix 403. Hoàn hảo cho automation trong registration flow.
📘 Tài liệu tham khảo (AWS cập nhật 2026)
- AWS API Gateway Developer Guide: Control access to a REST API with API keys – Chi tiết Usage Plan association.
- API Reference: createUsagePlanKey – Method chính thức.
- Best Practices: AWS Well-Architected Framework – Reliability pillar: Automate API key lifecycle với SDK/CLI (e.g., AWS SDK v3 for JavaScript/Python).
- Exam Tips (DOP-C02): Câu hỏi kiểu này test kiến thức về API Gateway throttling/quota enforcement.
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần code sample, hỏi thêm nhé!
A manager finds out that some engineers modified the security groups of a few EC2 instances for testing purposes. A developer needs to determine what modifications occurred.
Which solution will meet this requirement?
- A Add a Conditions section statement in the source YAML file of the template. Run the CloudFormation stack.
- B Perform a drift detection operation on the CloudFormation stack.
- C Execute a change set for the CloudFormation stack.
- D Use Amazon Detective to detect the modifications.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh việc quản lý hạ tầng AWS bằng AWS CloudFormation, một dịch vụ tự động hóa việc triển khai và quản lý tài nguyên AWS qua các template (ở đây là YAML). Template này tạo ra Amazon VPC security groups (nhóm bảo mật cho VPC) và Amazon EC2 security groups (nhóm bảo mật cho instances EC2).
Vấn đề phát sinh: Một số kỹ sư đã thay đổi thủ công security groups của vài EC2 instances để test, dẫn đến sự không đồng bộ giữa trạng thái thực tế của tài nguyên (actual resources) và định nghĩa trong CloudFormation stack.
Yêu cầu: Developer cần xác định chính xác những thay đổi (modifications) nào đã xảy ra trên security groups đó.
Mục tiêu là tìm giải pháp hiệu quả nhất để phát hiện sự lệch lạc (drift) mà không cần can thiệp thêm vào template hoặc stack hiện tại. Đây là tình huống phổ biến trong DevOps, nhấn mạnh tính năng drift detection của CloudFormation (cập nhật ổn định đến năm 2026, hỗ trợ toàn diện cho các tài nguyên như security groups).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Perform a drift detection operation on the CloudFormation stack.
Lý do:
- Drift detection là tính năng chuyên biệt của CloudFormation (ra mắt từ 2018 và được cải tiến liên tục đến 2026), dùng để so sánh trạng thái thực tế của stack (actual configuration trên AWS) với template gốc (expected configuration).
- Nó sẽ quét toàn bộ stack, xác định chính xác những thay đổi trên security groups (như rules inbound/outbound bị sửa thủ công), và báo cáo chi tiết qua AWS Console, CLI hoặc API (ví dụ:
aws cloudformation detect-stack-drift). - Hoàn hảo cho trường hợp này vì security groups thuộc VPC/EC2 được hỗ trợ đầy đủ, giúp developer xác định modifications nhanh chóng mà không ảnh hưởng đến stack đang chạy.
- 🛠️ Quy trình đơn giản: Chọn stack > Actions > Detect drift > Xem báo cáo drift status (IN_SYNC hoặc DRIFTED) và chi tiết thay đổi.
📋 Giải thích tất cả các phương án (đúng/sai)
-
❌ [SAI] Add a Conditions section statement in the source YAML file of the template. Run the CloudFormation stack.
Phương án này không đúng vì phần Conditions trong CloudFormation chỉ dùng để điều kiện hóa việc tạo tài nguyên (ví dụ: tạo resource A nếu parameter = true), không liên quan đến việc phát hiện thay đổi đã xảy ra thủ công. Việc chỉnh sửa YAML và chạy lại stack chỉ deploy mới, có thể ghi đè thay đổi nhưng không xác định được modifications cũ, dẫn đến mất dữ liệu audit. -
✅ [ĐÚNG] Perform a drift detection operation on the CloudFormation stack.
Như đã giải thích ở trên: Hoàn toàn chính xác, đây là giải pháp tối ưu, nhanh chóng và không xâm lấn để phát hiện drift trên security groups. -
❌ [SAI] Execute a change set for the CloudFormation stack.
Không phù hợp vì Change sets dùng để xem trước thay đổi trước khi update stack (preview impacts), không quét trạng thái hiện tại để tìm modifications thủ công. Nó chỉ so sánh template mới với stack cũ, bỏ qua drift từ thay đổi ngoài CloudFormation, nên không giúp xác định những sửa test đã làm. -
❌ [SAI] Use Amazon Detective để detect the modifications.
Sai lầm vì Amazon Detective (dịch vụ bảo mật ra mắt 2019, cập nhật 2026) tập trung vào phân tích hành vi bảo mật, threat detection qua logs (CloudTrail, VPC Flow Logs, GuardDuty), không phải audit cấu hình tài nguyên như security groups. Nó có thể phát hiện hành vi bất thường nhưng không chi tiết hóa modifications cụ thể trên CloudFormation stack.
📘 Tài liệu tham khảo (kiến thức cập nhật đến 2026)
- AWS CloudFormation Drift Detection: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-drift.html – Hướng dẫn chính thức về detect-stack-drift, hỗ trợ security groups.
- CloudFormation Best Practices: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html – Nhấn mạnh drift detection cho IaC compliance.
- Exam Topic DOP-C02: Phần Stack management & Drift (AWS Certified DevOps Engineer - Professional, version 2026).
- CLI Reference:
aws cloudformation detect-stack-drift --stack-name <stack>.
🛠️ Lời khuyên DevOps: Luôn kích hoạt CloudTrail để log tất cả API calls liên quan security groups, kết hợp drift detection định kỳ qua Lambda/EventBridge cho automation!
Given that multiple modes of IAM access are present for this EC2 instance, which of the following is correct?
- A The EC2 instance will only be able to list the S3 buckets.
- B The EC2 instance will only be able to list the contents of one S3 bucket at a time.
- C The EC2 instance will be able to perform all actions on any S3 bucket.
- D The EC2 instance will not be able to perform any S3 action on any S3 bucket.
Xem giải thích
🧩 Phân tích chi tiết câu hỏi
Câu hỏi tập trung vào cơ chế xác thực IAM đa nguồn (multiple modes of IAM access) trên một Amazon EC2 instance. Cụ thể:
- Một IAM role được gắn vào EC2 instance, và role này có chính sách explicitly denies (từ chối rõ ràng) tất cả các hành động API của Amazon S3 (tức là
"Effect": "Deny", "Action": "s3:*"). - Trên EC2 instance còn có credentials file (thường là
~/.aws/credentials), chứa IAM access key ID và secret access key thuộc về một principal (IAM user hoặc tương tự) cho phép full administrative access (quyền quản trị đầy đủ, có thể bao gồms3:* Allow). - Khi EC2 instance thực hiện các lệnh gọi đến S3, hệ thống phải quyết định credentials nào được sử dụng và policy nào apply, theo credential provider chain của AWS SDK/CLI (thứ tự ưu tiên: Environment vars → Shared credentials file → Config file → Instance metadata/IMDS cho role).
📘 Điểm cốt lõi theo IAM policy evaluation logic (cập nhật 2026):
- Explicit Deny luôn có precedence cao nhất (thắng mọi Allow từ bất kỳ nguồn nào khác).
- Với instance role, credentials tạm thời từ IMDS (Instance Metadata Service) được ưu tiên nếu không có static creds conflict, nhưng khi có multiple sources, AWS đánh giá tất cả applicable policies cho session/request. Role deny S3:* sẽ block toàn bộ, bất kể static creds có full admin.
- Không có sự kết hợp policy giữa static creds (IAM user) và instance role; role deny apply trực tiếp cho context EC2, override allow từ creds file.
🛠️ Tình huống thực tế: Ứng dụng trên EC2 gọi S3 API → Credential chain chọn creds → Policy evaluation → Explicit Deny từ role chặn hết.
✅ Đáp án đúng: The EC2 instance will not be able to perform any S3 action on any S3 bucket.
Lý do lựa chọn:
- Theo nguyên tắc IAM (cập nhật Well-Architected Framework 2026), explicit Deny trong instance role override mọi Allow, kể cả từ static credentials full admin trong file. Role được thiết kế để kiểm soát chặt chẽ access từ EC2, và deny S3:* block tất cả actions (ListBuckets, GetObject, PutObject,...).
- Multiple modes không mix policy; role deny là "final veto", đảm bảo security principle of least privilege. EC2 không thể thực hiện bất kỳ S3 action nào.
📋 Giải thích tất cả các phương án
-
❌ [SAI] The EC2 instance will only be able to list the S3 buckets.
Phương án này sai vì explicit Denys3:*bao gồm cảs3:ListBucketsvàs3:ListAllMyBuckets. Không có quyền list nào được giữ lại, dù static creds có allow. -
❌ [SAI] The EC2 instance will only be able to list the contents of one S3 bucket at a time.
Sai hoàn toàn. Denys3:*chặn cảs3:ListBucket(list contents) cho mọi bucket. Không có ngoại lệ "one at a time" hay partial access từ static creds. -
❌ [SAI] The EC2 instance will be able to perform all actions on any S3 bucket.
Sai vì bỏ qua explicit Deny từ role. Static creds full admin bị override; IAM không cho phép "all actions" khi có deny conflict ở layer instance role. -
✅ [ĐÚNG] The EC2 instance will not be able to perform any S3 action on any S3 bucket.
Đúng như giải thích trên. Deny precedence đảm bảo zero access S3 từ EC2.
📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2026)
- IAM Policy Evaluation Logic: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html (Explicit Deny > Allow).
- EC2 Instance Role & Credentials: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html (Role override static creds in multi-mode).
- Credential Provider Chain: https://docs.aws.amazon.com/sdkref/latest/guide/feature-credentials-provider-chain.html (IMDS/role ưu tiên security).
- AWS Exam DOP-C02 Guide: Explicit Deny examples trong Security domain.
🛡️ Lời khuyên DevOps: Luôn dùng instance roles thay static keys để tránh override risks; test với IAM Policy Simulator!
A developer needs to implement encrypted username and password credentials.
Which solution will meet these requirements?
- A Remove the user credentials from the Lambda environment. Implement IAM database authentication.
- B Move the user credentials from Lambda environment variables to AWS Systems Manager Parameter Store.
- C Move the user credentials from Lambda environment variables to AWS Key Management Service (AWS KMS).
- D Move the user credentials from the Lambda environment to an encrypted .txt file. Store the file in an S3 bucket.
Xem giải thích
🧩 Giải thích nội dung câu hỏi
Câu hỏi xoay quanh một công ty đang sử dụng AWS Lambda để tự động chuyển các file từ Amazon S3 bucket sang SFTP server của công ty. Lambda hiện đang kết nối đến SFTP server bằng credentials (tên người dùng và mật khẩu), và các credentials này được lưu trữ trực tiếp trong Lambda environment variables – một cách không an toàn vì environment variables không được mã hóa mặc định.
Yêu cầu chính: Developer cần triển khai cách lưu trữ credentials được mã hóa (encrypted username và password) để đảm bảo tính bảo mật cao hơn, tuân thủ nguyên tắc least privilege và best practices của AWS về quản lý secrets.
Vấn đề cốt lõi là chuyển từ lưu trữ plaintext trong env vars sang giải pháp mã hóa chuyên dụng, dễ tích hợp với Lambda mà không làm gián đoạn chức năng kết nối SFTP.
(Kiến thức cập nhật 2026: AWS khuyến nghị sử dụng dịch vụ quản lý secrets như SSM Parameter Store với KMS integration để mã hóa, thay vì env vars – theo AWS Well-Architected Framework Security Pillar).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Move the user credentials from Lambda environment variables to AWS Systems Manager Parameter Store.
Lý do:
- AWS Systems Manager Parameter Store (nay là phần của AWS Systems Manager) hỗ trợ lưu trữ SecureString – loại parameter được tự động mã hóa bằng AWS KMS (không cần cấu hình thêm).
- Lambda có tích hợp native qua IAM role (permissions như
ssm:GetParametervàssm:GetParameters), cho phép Lambda retrieve credentials động tại runtime mà không lưu trữ lâu dài. - Giải pháp này an toàn, scalable, audit trail (CloudTrail ghi log), và tuân thủ zero-trust model của AWS. Không cần thay đổi code nhiều, chỉ cần gọi SDK
GetParameterthay vì đọc env var. - Best practice 2026: AWS ưu tiên Parameter Store hoặc Secrets Manager cho secrets như username/password SFTP.
🛠️ 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. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể dựa trên tính khả thi, bảo mật và tích hợp AWS:
-
❌ [SAI] Remove the user credentials from the Lambda environment. Implement IAM database authentication.
Lý do sai: IAM database authentication chỉ áp dụng cho RDS/Aurora (MySQL/PostgreSQL), không hỗ trợ SFTP server (giao thức SSH-based). SFTP yêu cầu username/password truyền thống, không dùng IAM tokens. Giải pháp này không liên quan và sẽ làm Lambda không kết nối được SFTP. -
✅ [ĐÚNG] Move the user credentials from Lambda environment variables to AWS Systems Manager Parameter Store.
Lý do đúng: Như đã giải thích ở trên – mã hóa tự động qua SecureString + KMS, tích hợp liền mạch với Lambda qua IAM role. Không có downtime, dễ rotate secrets, và hỗ trợ hierarchical paths (ví dụ:/prod/sftp/creds). Đây là recommended solution cho non-relational secrets. -
❌ [SAI] Move the user credentials from Lambda environment variables to AWS Key Management Service (AWS KMS).
Lý do sai: KMS chỉ quản lý encryption keys (CMK), không lưu trữ secrets như username/password trực tiếp. Bạn không thể "store" credentials trong KMS; nó chỉ encrypt/decrypt data. Sử dụng KMS sai cách này sẽ gây lỗi và không giải quyết yêu cầu lưu trữ encrypted creds. -
❌ [SAI] Move the user credentials from the Lambda environment to an encrypted .txt file. Store the file in an S3 bucket.
Lý do sai: Mặc dù S3 hỗ trợ server-side encryption (SSE-KMS/SSE-S3), file .txt vẫn cần quyền truy cập S3 qua IAM, và Lambda phải download file mỗi lần – tăng latency, rủi ro exposure nếu bucket public hoặc misconfigured. Không có rotation tự động, audit kém hơn Parameter Store, vi phạm best practices (AWS khuyên tránh lưu secrets trong S3 objects).
📘 Tài liệu tham khảo
- AWS Documentation (2026): Systems Manager Parameter Store – Hướng dẫn SecureString và Lambda integration.
- AWS Lambda Best Practices: Handling Secrets in Lambda – Khuyến nghị di chuyển từ env vars sang SSM/Secrets Manager.
- AWS Well-Architected Framework: Security Pillar – Parameter Store for Secrets.
- Exam Topic DOP-C02: Secrets Management trong DevOps Professional (phiên bản mới nhất).
Hy vọng phân tích này giúp bạn nắm vững kiến thức! 🚀 Nếu cần ví dụ code Lambda retrieve Parameter Store, hãy hỏi thêm nhé!
Which solution meets these requirements?
- A Add the permissions to an IAM policy. Attach the policy to a role. Attach the role to the EC2 instance profile.
- B Add the permissions inline to an IAM group. Attach the group to the EC2 instance profile.
- C Add the permissions to an IAM policy. Attach the policy to a user. Attach the user to the EC2 instance profile.
- D Add the permissions to an IAM policy. Use IAM web identity federation to access the S3 bucket with the policy.
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 best practices bảo mật AWS khi cấp quyền đọc (read access) cho một ứng dụng batch chạy trên Amazon EC2 instance truy cập Amazon S3 bucket.
Developer cần tuân thủ nguyên tắc bảo mật cao nhất: không hardcode credentials, sử dụng cơ chế tạm thời và tự động hóa quyền truy cập.
Ứng dụng chạy trên EC2 nên ưu tiên IAM Roles gắn với Instance Profile để EC2 tự động assume role và lấy temporary credentials qua metadata service (IMDSv2 theo khuyến nghị mới nhất 2023-2026).
Điều này tránh chia sẻ long-term keys, giảm rủi ro lộ thông tin (least privilege principle).
📘 Tài liệu tham khảo:
- AWS IAM Roles for Amazon EC2 (cập nhật 2024).
- AWS Security Best Practices (Well-Architected Framework 2023+).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Add the permissions to an IAM policy. Attach the policy to a role. Attach the role to the EC2 instance profile.
🛠️ Lý do chi tiết:
- Tạo IAM Policy chứa quyền
s3:GetObject(read access). - Gắn policy vào IAM Role (ví dụ:
S3ReadRole). - Gắn role vào EC2 Instance Profile (tạo profile nếu chưa có).
- EC2 instance tự động sử dụng role qua Instance Metadata Service (IMDSv2), lấy temporary STS credentials (hết hạn sau 1 giờ, tự renew).
- Đây là best practice AWS (zero long-term credentials), tuân thủ least privilege và dễ quản lý (detach/attach policy linh hoạt). Áp dụng từ AWS phiên bản hiện tại đến 2026.
📋 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 một cách chi tiết, giữ nguyên nội dung gốc bằng tiếng Anh:
-
Add the permissions to an IAM policy. Attach the policy to a role. Attach the role to the EC2 instance profile.
✅ Đúng 🏆: Như giải thích trên, đây là phương pháp chuẩn AWS cho EC2. Instance Profile chỉ hỗ trợ roles (không phải user/group), đảm bảo credentials tạm thời và an toàn. Không cần code thay đổi, SDK/AWS CLI tự detect. -
Add the permissions inline to an IAM group. Attach the group to the EC2 instance profile.
❌ Sai 🚫: IAM Groups không thể attach trực tiếp vào Instance Profile (chỉ hỗ trợ roles). Inline policy trên group cũng không áp dụng cho EC2. Sử dụng group không phù hợp cho service principals như EC2 (dành cho users). Vi phạm best practices. -
Add the permissions to an IAM policy. Attach the policy to a user. Attach the user to the EC2 instance profile.
❌ Sai 🚫: Instance Profile chỉ chấp nhận IAM Roles, không attach users. User có long-term credentials (access keys), phải hardcode vào EC2 – rủi ro cao (không rotate tự động, dễ lộ). Không theo security best practices. -
Add the permissions to an IAM policy. Use IAM web identity federation to access the S3 bucket with the policy.
❌ Sai 🚫: Web Identity Federation dùng cho external identities (OIDC như GitHub Actions, Google), không phải EC2 instance nội bộ. EC2 dùng service role thay vì federation. Phức tạp hóa không cần thiết, không phải best practice cho trường hợp này.
🛠️ Lời khuyên DevOps: Luôn dùng AWS IAM Access Analyzer kiểm tra policy và enable IMDSv2 trên EC2 để chống SSRF attacks (cập nhật 2024). Test bằng aws sts get-caller-identity trên instance!
📘 Nguồn bổ sung: Instance Profiles & IMDSv2 (AWS 2026 compliant).
If a batch contains no orders, the Lambda function must publish to an Amazon Simple Notification Service (Amazon SNS) topic as soon as possible.
Which combination of steps will meet this requirement with the LEAST implementation effort? (Choose two.)
- A Update the existing Lambda function's code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
- B Create a new Lambda function as an Amazon Kinesis data stream consumer. Configure the new Lambda function to track orders and to publish to the SNS topic when a batch contains no orders.
- C Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
- D Schedule a new Lambda function to analyze Amazon CloudWatch metrics every 24 hours to identify batches that contain no orders. Configure the Lambda function to publish to the SNS topic.
- E Modify the existing Lambda function to log orders to an Amazon Kinesis data stream.
Xem giải thích
🧩 Phân tích chi tiết câu hỏi
📘 Nội dung câu hỏi:
Câu hỏi tập trung vào một ứng dụng nhận các batch orders (lô đơn hàng) từ các đối tác hàng ngày, được xử lý bởi AWS Lambda function. Yêu cầu chính là: Nếu batch không chứa orders nào (số lượng = 0), Lambda phải publish thông báo đến Amazon SNS topic NGAY LẬP TỨC (as soon as possible).
Mục tiêu là chọn kết hợp 2 bước đáp ứng yêu cầu với ít nỗ lực triển khai nhất (LEAST implementation effort).
🛠️ Bối cảnh kỹ thuật: Lambda xử lý batch theo lịch (có thể trigger hàng ngày). Không cần thay đổi lớn kiến trúc, ưu tiên tận dụng dịch vụ AWS có sẵn như CloudWatch để giám sát metric thời gian thực, giảm code custom.
✅ Đáp án đúng (Chọn 2)
Các phương án đúng là:
- Update the existing Lambda function's code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
- Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
Lý do lựa chọn:
🧩 Kết hợp này tối ưu nhất vì:
- Chỉ cần thêm vài dòng code vào Lambda hiện tại để publish custom metric vào CloudWatch (sử dụng
putMetricDataAPI – rất đơn giản, không cần thư viện ngoài). Metric này ghi nhận số orders/batch cho từng partner. - CloudWatch Alarm tự động giám sát metric thời gian thực (near real-time), kích hoạt ngay khi giá trị = 0 và gửi notification trực tiếp đến SNS topic (hỗ trợ native integration).
✅ LEAST effort: Không tạo resource mới phức tạp, tận dụng Lambda + CloudWatch (miễn phí cho metric cơ bản). Đáp ứng "as soon as possible" vì metric publish tức thì và alarm trigger trong 1-2 phút.
(Cập nhật AWS 2023-2026: CloudWatch hỗ trợ custom metrics high-resolution cho Lambda, alarms với stateless/stateless evaluation cho độ trễ thấp hơn).
🔍 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, đánh dấu ✅ (đúng) hoặc ❌ (sai), kèm giải thích chi tiết bằng tiếng Việt:
-
Update the existing Lambda function's code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner.
✅ Đúng. Phương án này chỉ yêu cầu chỉnh sửa nhẹ Lambda hiện tại để gọiCloudWatch.putMetricData()với dimension (partner/batch size). Metric được publish ngay sau xử lý batch, cung cấp dữ liệu realtime cho alarm. Ít effort cao nhất, không thay đổi luồng chính. -
Create a new Lambda function as an Amazon Kinesis data stream consumer. Configure the new Lambda function to track orders and to publish to the SNS topic when a batch contains no orders.
❌ Sai. Tạo Lambda mới làm consumer Kinesis đòi hỏi thiết lập Kinesis stream (thêm chi phí/config), code track orders phức tạp (stateful tracking). Effort cao, không tận dụng Lambda hiện tại, và Kinesis overkill cho batch hàng ngày (batch processing phù hợp hơn S3/EventBridge). -
Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.
✅ Đúng. Alarm CloudWatch native hỗ trợ SNS action (chọn topic trong console/CLI). Threshold = 0 trên custom metric kích hoạt ngay lập tức (evaluation period 1 phút). Zero code, chỉ config alarm – hoàn hảo kết hợp với metric từ Lambda. -
Schedule a new Lambda function to analyze Amazon CloudWatch metrics every 24 hours to identify batches that contain no orders. Configure the Lambda function to publish to the SNS topic.
❌ Sai. Schedule EventBridge hàng ngày KHÔNG đáp ứng "as soon as possible" (delay 24h). Tạo Lambda mới để query metrics (sử dụngGetMetricStatistics) + publish SNS effort cao, dễ miss realtime. Không hiệu quả so với alarm tự động. -
Modify the existing Lambda function to log orders to an Amazon Kinesis data stream.
❌ Sai. Chỉ log vào Kinesis không đủ – vẫn cần consumer riêng (như Lambda khác) để detect batch rỗng và publish SNS. Effort cao hơn (setup stream + consumer), không đơn giản như metric trực tiếp. Kinesis phù hợp streaming liên tục, không phải batch discrete.
📘 Tài liệu tham khảo (AWS cập nhật 2026)
- CloudWatch Custom Metrics & Lambda Integration: AWS Docs - Publishing Custom Metrics & Lambda Metrics.
- CloudWatch Alarms to SNS: Alarms Actions (hỗ trợ SNS native).
- Exam Prep DOP-C02: AWS Certified DevOps Engineer Professional guide (2023+), phần Monitoring & Logging.
🛠️ Mẹo thi: Ưu tiên giải pháp "serverless-native" với least config/code cho realtime requirements!
What is the cause of this issue?
- A The data in the table's partition key column is not evenly distributed.
- B The LSI's capacity is different from the table's capacity.
- C The application is not implementing exponential backoff retry logic while interacting with the DynamoDB API.
- D The application has the IAM permission to query the DynamoDB table but not to query the LSI.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một tình huống thực tế trong AWS DynamoDB: Một lập trình viên đang phát triển ứng dụng sử dụng bảng DynamoDB có cấu hình Local Secondary Index (LSI). Trong quá trình kiểm thử ứng dụng, hệ thống báo lỗi ProvisionedThroughputExceededException (nghĩa là vượt quá dung lượng throughput đã cung cấp). Tuy nhiên, tổng số yêu cầu từ bộ test không vượt quá giới hạn dung lượng provisioned của bảng.
🛠️ Vấn đề cốt lõi: Lỗi này thường liên quan đến cách DynamoDB phân bổ và quản lý throughput ở mức partition (không phải tổng thể). DynamoDB tự động chia bảng thành các partition dựa trên partition key, và mỗi partition có giới hạn RCU (Read Capacity Units) / WCU (Write Capacity Units) riêng (khoảng 3.000 RCU và 1.000 WCU mỗi partition ở chế độ provisioned). Nếu dữ liệu không phân bố đều (hot partition), một partition có thể bị quá tải dù tổng capacity vẫn dư thừa. LSI chia sẻ cùng capacity với bảng chính, nên truy vấn LSI cũng ảnh hưởng đến partition tương ứng.
📘 Kiến thức cập nhật (AWS 2024-2026): Theo tài liệu DynamoDB mới nhất, LSI vẫn chia sẻ 100% read/write capacity của bảng gốc (không provision riêng như GSI). Hot partitions gây throttle ngay cả ở on-demand mode nếu burst limits bị vượt (xem AWS re:Post và DynamoDB Developer Guide).
✅ Đáp án đúng và lý do chọn
Đáp án đúng: The data in the table's partition key column is not evenly distributed.
Lý do chi tiết:
- DynamoDB phân bổ throughput dựa trên partition key. Nếu dữ liệu tập trung vào một vài giá trị partition key (hot partition), partition đó sẽ vượt giới hạn RCU/WCU cục bộ → gây ProvisionedThroughputExceededException, dù tổng requests của bảng không vượt capacity.
- LSI sử dụng cùng partition key với bảng chính, nên truy vấn LSI cũng "đánh" vào cùng partition → làm trầm trọng hóa vấn đề hot partition.
- Đây là nguyên nhân phổ biến nhất trong testing, phù hợp với mô tả "không vượt tổng capacity". Giải pháp: Sử dụng composite key tốt hơn hoặc random suffix cho partition key.
📋 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, giữ nguyên văn bản gốc bằng tiếng Anh:
-
✅ The data in the table's partition key column is not evenly distributed.
Giải thích đúng: Như đã nêu ở trên, đây chính là nguyên nhân gốc rễ. Phân bố không đều dẫn đến hot partition, gây throttle cục bộ trên LSI hoặc bảng chính dù tổng capacity OK. AWS khuyến nghị thiết kế partition key để đảm bảo even distribution (ví dụ: thêm random ID). -
❌ The LSI's capacity is different from the table's capacity.
Giải thích sai: LSI không có capacity riêng mà chia sẻ hoàn toàn read/write capacity với bảng chính (tỷ lệ 100%). Không tồn tại sự khác biệt capacity giữa LSI và table. Nếu provision table 10 RCU, LSI cũng dùng từ 10 RCU đó. (Xác nhận từ DynamoDB Limits). -
❌ The application is not implementing exponential backoff retry logic while interacting with the DynamoDB API.
Giải thích sai: Exponential backoff là best practice để retry sau throttle (theo AWS SDK), giúp ứng dụng phục hồi tự động. Tuy nhiên, nó không phải nguyên nhân gây lỗi throttle mà chỉ là cách xử lý sau lỗi. Vấn đề ở đây là throttle xảy ra ngay từ đầu do hot partition, không phải thiếu retry logic. -
❌ The application has the IAM permission to query the DynamoDB table but not to query the LSI.
Giải thích sai: IAM permissions kiểm soát quyền truy cập (như dynamodb:Query), nhưng ProvisionedThroughputExceededException là lỗi throughput, không phải AccessDenied. LSI dùng cùng IAM policy với table (không cần permission riêng). Nếu thiếu quyền, sẽ báo AccessDeniedException thay vì throttle.
📘 Tài liệu tham khảo (AWS chính thức, cập nhật 2024-2026)
- DynamoDB Developer Guide - LSI: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LSI.html (xác nhận shared capacity).
- Best Practices for Partition Keys: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-uniform-load.html (hot partitions).
- Error Handling: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.ProvisionedThroughputExceededException.
- AWS re:Invent 2024 Sessions (DynamoDB deep dive): Nhấn mạnh partition balancing ở provisioned mode.
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 hoặc thiết kế table, hãy hỏi nhé!
The developer deploys some changes and can see the new artifacts in the S3 bucket. However, the changes do not appear on the webpage that the CloudFront distribution delivers.
How should the developer resolve this issue?
- A Configure S3 Object Lock to update to the latest version of the files every time an S3 object is updated.
- B Configure the S3 bucket to clear all old objects from the bucket before new artifacts are uploaded.
- C Set CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3.
- D Set CloudFront to modify the distribution origin after the artifacts have been deployed to Amazon S3.
Xem giải thích
🧩 Giải thích 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 quản lý website phân phối nội dung qua Amazon CloudFront, với các artifact tĩnh lưu trữ trong Amazon S3 bucket. Sau khi deploy thay đổi, artifact mới đã xuất hiện trong S3 bucket, nhưng không hiển thị trên webpage do CloudFront phân phối.
🔍 Vấn đề cốt lõi: CloudFront sử dụng cơ chế caching (bộ nhớ đệm) để tăng tốc độ và giảm chi phí truy cập, nên nó vẫn phục vụ nội dung cũ từ cache thay vì fetch dữ liệu mới từ S3 origin ngay lập tức. Giải pháp cần tập trung vào việc xóa cache cũ hoặc invalidate (vô hiệu hóa) cache trên CloudFront để buộc nó tải nội dung mới từ S3. Đây là vấn đề phổ biến trong kiến trúc S3 + CloudFront (cập nhật đến AWS 2026, với CloudFront hỗ trợ invalidation nhanh hơn qua Lambda@Edge và CloudFront Functions).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Set CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3.
🛠️ Lý do chi tiết:
- Sau khi upload artifact mới lên S3, CloudFront vẫn giữ cache cũ (dựa trên TTL - Time To Live).
- Invalidation là cách chuẩn của AWS để yêu cầu CloudFront xóa cache cho các object cụ thể (hoặc path như
/*), buộc lần truy cập tiếp theo sẽ fetch từ S3 origin. - Quy trình: Sử dụng AWS Console, CLI (
aws cloudfront create-invalidation), SDK, hoặc tự động hóa qua CI/CD (CodePipeline, Lambda). - Hiệu quả ngay lập tức, chi phí thấp (miễn phí 1.000 invalidation/tháng đầu, sau $0.005/10.000 paths). Phù hợp với best practice DevOps cho deployment immutable artifacts.
📋 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, với nội dung gốc giữ nguyên tiếng Anh:
-
❌ Configure S3 Object Lock to update to the latest version of the files every time an S3 object is updated.
Giải thích sai: S3 Object Lock dùng để khóa object (immutable, không cho xóa/sửa trong retention period), thường cho compliance (WORM - Write Once Read Many). Nó không tự động update version hay ảnh hưởng đến CloudFront cache. Upload mới sẽ tạo object mới, nhưng cache CloudFront vẫn giữ nội dung cũ. Không liên quan đến vấn đề caching. -
❌ Configure the S3 bucket to clear all old objects from the bucket before new artifacts are uploaded.
Giải thích sai: S3 không có cơ chế tự động clear old objects khi upload mới (trừ dùng Lifecycle policies cho versioning/deletion, nhưng chậm và không realtime). Việc xóa thủ công old objects vẫn không giải quyết cache hiện tại trên CloudFront (cache có thể tồn tại hàng giờ/ngày). Rủi ro mất dữ liệu và không scale cho production. -
✅ Set CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3.
Giải thích đúng: Như đã phân tích ở trên, invalidation trực tiếp xóa cache edge locations, buộc CloudFront fetch fresh content từ S3. Đây là giải pháp chuẩn AWS, hỗ trợ wildcard (/*) cho toàn bộ site, tích hợp CI/CD (AWS 2026 vẫn khuyến nghị với Field-Level Encryption và Origin Access Control - OAC). -
❌ Set CloudFront to modify the distribution origin after the artifacts have been deployed to Amazon S3.
Giải thích sai: Thay đổi origin (như path S3) yêu cầu update distribution, dẫn đến propagation delay (15-30 phút toàn cầu). Nó không xóa cache cũ, chỉ ảnh hưởng request mới sau thay đổi. Không giải quyết vấn đề ngay lập tức và gây downtime tiềm ẩn.
📘 Tài liệu tham khảo
- AWS Documentation: CloudFront Invalidation (cập nhật 2024-2026).
- AWS Best Practices: Deploying Static Websites with S3 + CloudFront & Managing Cache Behavior.
- Exam Guide DOP-C02 (DevOps Pro): Topic "Deployment Strategies" (thi 2024-2026).
- Thực hành: Sử dụng AWS CLI
aws cloudfront create-invalidation --distribution-id EDI... --paths "/*".
Hy vọng phân tích này giúp bạn ôn thi hiệu quả! 🚀 Nếu cần demo code, hãy hỏi thêm.