Ngân hàng đề — AWS Certified DevOps Engineer Professional
Tìm thấy 681 câu.
The company has experienced issues when it tries to revert templates to a previous version. To prevent these issues, the company must have the ability to review template modifications before the modifications are deployed to production.
Which solution will meet these requirements with the LEAST operational overhead?
- A Configure a connection in AWS CodeConnections to a Git repository. Store the templates in the Git repository. Configure a pull request workflow to review template modifications. Configure AWS CloudFormation Git sync for the stacks.
- B Add a manual review action in the pipeline to review modifications to the template code before the stack deployments.
- C Update the pipeline to invoke an AWS Lambda function to check the template modifications before the stack deployments.
- D Configure a connection in AWS CodeConnections to a Git repository. Store the templates in the Git repository. Configure the pipeline to include a source action that uses the connection. Add a manual review action to the pipeline to review template modifications before the stack deployments.
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 CodePipeline để tải các AWS CloudFormation templates lên Amazon S3 bucket, sau đó deploy các CloudFormation stacks với tên khớp với tên template. 🔄
Vấn đề chính: Khi cố gắng revert (hoàn tác) templates về phiên bản cũ, họ gặp sự cố.
Yêu cầu: Cần cơ chế review (xem xét) các thay đổi template trước khi deploy vào production, đồng thời đảm bảo giải pháp có LEAST operational overhead (ít nhất công sức vận hành). 🛡️
Mục tiêu là tích hợp quy trình review tự động hóa cao, tránh manual intervention thủ công, đặc biệt hỗ trợ revert dễ dàng qua version control. Điều này phù hợp với best practices DevOps trên AWS, sử dụng Git-based workflow để quản lý IaC (Infrastructure as Code). 📈
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Configure a connection in AWS CodeConnections to a Git repository. Store the templates in the Git repository. Configure a pull request workflow to review template modifications. Configure AWS CloudFormation Git sync for the stacks.
Lý do:
Giải pháp này sử dụng AWS CodeConnections (nay là AWS Connector for Git) để kết nối Git repo (như GitHub, Bitbucket), lưu templates trong Git để version control tự động. Pull Request (PR) workflow cho phép review changes trước khi merge, đảm bảo chất lượng. Đặc biệt, AWS CloudFormation Git sync (tính năng mới từ 2023-2024, cập nhật đến 2026) cho phép stacks sync trực tiếp từ Git branch, tự động deploy khi PR được approve/merge mà không cần CodePipeline.
✅ Least overhead: Tự động hóa hoàn toàn qua Git + native CloudFormation, hỗ trợ revert dễ dàng bằng git revert/checkout. Không cần manual actions hay custom code, giảm vận hành tối đa. Hoàn hảo cho production safety! 🚀
📋 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 tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể dựa trên AWS best practices (2026).
✅ Configure a connection in AWS CodeConnections to a Git repository. Store the templates in the Git repository. Configure a pull request workflow to review template modifications. Configure AWS CloudFormation Git sync for the stacks.
Giải pháp lý tưởng: Kết hợp Git version control + PR review + CloudFormation Git sync (deploy trực tiếp từ Git mà không cần pipeline riêng). Overhead thấp nhất vì native integration, tự động revert qua Git history. Phù hợp yêu cầu! 🌟
❌ Add a manual review action in the pipeline to review modifications to the template code before the stack deployments.
Sai vì chỉ thêm manual approval stage vào CodePipeline hiện tại. Mỗi deploy đều cần con người can thiệp thủ công → high operational overhead (phụ thuộc nhân sự, dễ lỗi, không scale). Không giải quyết revert issues từ S3 (vẫn thiếu version control thực thụ). 😩
❌ Update the pipeline to invoke an AWS Lambda function to check the template modifications before the stack deployments.
Sai vì yêu cầu custom Lambda function để "check" changes → tăng overhead (phát triển/maintain code, handle edge cases như diff templates). Không native, không hỗ trợ review collaborative, revert vẫn khó từ S3. Lambda chỉ là workaround kém hiệu quả. 🐛
❌ Configure a connection in AWS CodeConnections to a Git repository. Store the templates in the Git repository. Configure the pipeline to include a source action that uses the connection. Add a manual review action to the pipeline to review template modifications before the stack deployments.
Sai vì dù dùng Git source qua CodeConnections, vẫn thêm manual review action vào pipeline → overhead cao (manual approve mỗi PR/deploy). Không tận dụng Git sync native, vẫn phụ thuộc pipeline thủ công, kém tự động hóa so với đáp án đúng. 🤏
📘 Tài liệu tham khảo
- AWS CloudFormation Git Sync: AWS Documentation - Git sync for CloudFormation stacks (Cập nhật 2024-2026, hỗ trợ PR-based deployments).
- AWS CodeConnections (AWS Connector for Git): AWS Developer Tools - Connectors.
- CodePipeline Best Practices: AWS DevOps Guide - IaC with Git.
- Exam Prep DOP-C02: AWS Certified DevOps Engineer Professional (2024-2026 syllabus, domain 4: Automation).
Kiến thức dựa trên AWS re:Invent 2025 updates – Git sync là giải pháp khuyến nghị cho IaC review! 🔗
When pull requests are merged into the main branch, the pull requests are deployed by using the main_branch pipeline.
The company's developers need test results for all submitted pull requests as quickly as possible from the pull_request pipeline. The company wants to ensure that the main_branch pipeline’s test results finish and that each deployment is complete before the next pipeline execution.
Which solution will meet these requirements?
- A Configure the pull_request pipeline to use PARALLEL mode. Configure the main_branch pipeline to use QUEUED mode.
- B Configure the pull_request pipeline to use SUPERSEDED mode. Configure the main_branch pipeline to use QUEUED mode.
- C Configure the pull_request pipeline to use PARALLEL mode. Configure the main_branch pipeline to use SUPERSEDED mode
- D Configure the pull_request pipeline to use QUEUED mode. Configure the main_branch pipeline to use SUPERSEDED mode.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh AWS CodePipeline trong mô hình trunk-based development, nơi công ty sử dụng hai pipeline tích hợp với Git provider:
- pull_request pipeline: Lọc branch cho feature branches (các nhánh tính năng từ pull request - PR).
- main_branch pipeline: Lọc branch cho main branch (nhánh chính).
Quy trình hiện tại: Khi PR được merge vào main branch, main_branch pipeline sẽ deploy.
Yêu cầu chính:
- ✅ Developers cần kết quả test từ pull_request pipeline cho tất cả PR nhanh nhất có thể (không chờ đợi, chạy độc lập).
- ✅ Với main_branch pipeline, phải đảm bảo test results hoàn thành và deployment complete trước khi pipeline execution tiếp theo bắt đầu (tránh chồng chéo, chạy tuần tự).
Vấn đề cốt lõi: Cấu hình Pipeline Execution Mode (PARALLEL, QUEUED, SUPERSEDED) cho từng pipeline để đáp ứng yêu cầu. Đây là tính năng của CodePipeline source stage khi tích hợp Git (như GitHub, Bitbucket), cho phép kiểm soát hành vi khi có trigger mới từ branch/commit.
🛠️ Các mode hoạt động (dựa trên docs AWS mới nhất 2024-2026):
- PARALLEL: Chạy execution mới song song với execution đang chạy (nhanh, không chờ).
- QUEUED: Queue execution mới (tối đa 5), chờ execution hiện tại hoàn thành 100% trước khi chạy tiếp (tuần tự an toàn).
- SUPERSEDED: Hủy execution hiện tại và thay bằng execution mới (nhanh nhưng có thể mất kết quả cũ).
✅ Đáp án đúng
Configure the pull_request pipeline to use PARALLEL mode. Configure the main_branch pipeline to use QUEUED mode.
Lý do lựa chọn:
- pull_request pipeline (PARALLEL): Cho phép test chạy ngay lập tức và song song cho mọi PR, đảm bảo developers nhận kết quả nhanh nhất mà không bị block hay hủy (phù hợp trunk-based, nhiều PR đồng thời).
- main_branch pipeline (QUEUED): Các execution mới (khi merge liên tục) sẽ queue chờ, đảm bảo test + deployment hoàn tất đầy đủ trước khi chạy tiếp theo, tránh race condition hoặc deployment chồng chéo.
- Kết hợp này tối ưu: Nhanh cho PR testing, an toàn cho main deployment.
📋 Phân tích tất cả các phương án
-
✅ Configure the pull_request pipeline to use PARALLEL mode. Configure the main_branch pipeline to use QUEUED mode.
Đúng hoàn toàn 🏆: Như giải thích trên, PARALLEL lý tưởng cho test PR nhanh (song song), QUEUED đảm bảo main pipeline hoàn thành sequential (test/deploy full trước next run). Đáp ứng 100% yêu cầu. -
❌ Configure the pull_request pipeline to use SUPERSEDED mode. Configure the main_branch pipeline to use QUEUED mode.
Sai: SUPERSEDED cho pull_request sẽ hủy test execution cũ khi PR mới trigger, dẫn đến mất kết quả test cho một số PR (không "nhanh nhất cho tất cả PR"). QUEUED cho main đúng nhưng không cứu vãn được phần pull_request. -
❌ Configure the pull_request pipeline to use PARALLEL mode. Configure the main_branch pipeline to use SUPERSEDED mode.
Sai: PARALLEL cho pull_request đúng (nhanh test), nhưng SUPERSEDED cho main sẽ hủy deployment đang chạy khi merge mới, không đảm bảo "test results finish và deployment complete" trước next execution (có thể mất dữ liệu deploy). -
❌ Configure the pull_request pipeline to use QUEUED mode. Configure the main_branch pipeline to use SUPERSEDED mode.
Sai toàn bộ 🚫: QUEUED cho pull_request làm chậm test results (phải chờ queue, không nhanh nhất). SUPERSEDED cho main hủy execution cũ, vi phạm yêu cầu hoàn thành full deployment.
📘 Tài liệu tham khảo (AWS docs cập nhật mới nhất 2026)
- AWS CodePipeline User Guide - Pipeline Execution Modes: Chi tiết PARALLEL/QUEUED/SUPERSEDED cho source triggers.
- AWS CodePipeline with Git Integration: Branch filters và execution behavior.
- Best Practices for Trunk-Based Development on AWS: Ví dụ thực tế về pipeline modes.
- Exam DOP-C02 (DevOps Pro 2024+): Topic Pipeline orchestration & execution controls.
Giải pháp này production-ready và scalable cho trunk-based! 🚀 Nếu cần demo CloudFormation, hỏi thêm nhé!
Which solution will meet these requirements?
- A Configure a CodePipeline V2 type pipeline that uses QUEUED mode. Add a trigger filter to the pipeline definition that includes all tags. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
- B Configure a CodePipeline V2 type pipeline that uses SUPERSEDED mode. Add a trigger filter to the pipeline definition that includes all branches. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
- C Configure a CodePipeline V1 type pipeline that uses SUPERSEDED mode. Add a trigger filter to the pipeline definition that includes all tags. Add a stage at the end of the pipeline to invoke the existing deployment pipeline.
- D Configure a CodePipeline V1 type pipeline that uses QUEUED mode. Add a trigger filter to the pipeline definition that includes all branches. Add a stage at the end of the pipeline to invoke the existing deployment pipeline.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi yêu cầu thiết kế một pipeline AWS CodePipeline để xuất bản (publish) container images lên Amazon ECR repository. Các yêu cầu cụ thể bao gồm:
- Pipeline phải chờ (wait) cho lần chạy trước hoàn thành trước khi bắt đầu lần chạy mới (tức là chế độ QUEUED mode).
- Pipeline chỉ kích hoạt khi có Git tags mới được push vào Git repository kết nối qua AWS CodeConnections (hỗ trợ GitHub, Bitbucket, v.v.).
- Pipeline hiện tại (existing deployment pipeline) phải tự động chạy khi có container images mới được publish lên ECR.
🛠️ Mục tiêu chính: Sử dụng CodePipeline V2 (phiên bản mới hỗ trợ triggers linh hoạt hơn từ năm 2023), chế độ QUEUED để tránh chạy song song, filter trigger trên tags (không phải branches), và sử dụng Amazon EventBridge để phát hiện sự kiện push image lên ECR nhằm kích hoạt deployment pipeline riêng biệt. Điều này đảm bảo tính độc lập và tuân thủ best practices DevOps trên AWS (cập nhật đến 2026).
✅ Đáp án đúng
Configure a CodePipeline V2 type pipeline that uses QUEUED mode. Add a trigger filter to the pipeline definition that includes all tags. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
Lý do lựa chọn:
- V2 type pipeline: CodePipeline V2 (ra mắt 2023) hỗ trợ triggers tự động qua AWS CodeConnections cho Git tags, branches, hoặc commits một cách linh hoạt, không cần webhook thủ công như V1.
- QUEUED mode: Đảm bảo pipeline chờ lần chạy trước hoàn tất, tránh xung đột khi nhiều tags push liên tiếp (mặc định là SUPERSEDED ở V2).
- Trigger filter includes all tags: Khớp chính xác yêu cầu "new Git tags are pushed", filter trên
tagevent qua CodeConnections. - EventBridge rule for ECR image pushes: ECR phát sự kiện
ImagePushed→ EventBridge rule → kích hoạt deployment pipeline. Đây là cách event-driven chuẩn, tách biệt hai pipeline, không phụ thuộc stage nội bộ.
❌ Giải thích tất cả các phương án
-
Configure a CodePipeline V2 type pipeline that uses QUEUED mode. Add a trigger filter to the pipeline definition that includes all tags. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
✅ Đúng (như giải thích ở trên). Đây là giải pháp hoàn chỉnh, tận dụng tính năng mới nhất của V2 triggers và EventBridge (2023+). -
Configure a CodePipeline V2 type pipeline that uses SUPERSEDED mode. Add a trigger filter to the pipeline definition that includes all branches. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
❌ Sai:- SUPERSEDED mode sẽ hủy bỏ (supersede) lần chạy trước nếu tag mới push, vi phạm yêu cầu "wait for previous run to finish".
- Filter includes all branches không khớp với trigger "new Git tags" (branches dùng cho push branch, không phải tags).
-
Configure a CodePipeline V1 type pipeline that uses SUPERSEDED mode. Add a trigger filter to the pipeline definition that includes all tags. Add a stage at the end of the pipeline to invoke the existing deployment pipeline.
❌ Sai (nhiều lỗi):- V1 type không hỗ trợ triggers/filter tự động cho CodeConnections/tags tốt như V2 (V1 dùng webhook/Source stage thủ công, kém linh hoạt).
- SUPERSEDED mode không chờ previous run.
- Add stage to invoke pipeline không phải "response to publication of new images" (vì stage chạy trước push ECR), và không event-driven (dùng
aws codepipeline start-pipeline-executionkém hiệu quả).
-
Configure a CodePipeline V1 type pipeline that uses QUEUED mode. Add a trigger filter to the pipeline definition that includes all branches. Configure an Amazon EventBridge rule that matches container image pushes to start the existing deployment pipeline.
❌ Sai:- V1 type thiếu hỗ trợ triggers cho tags qua CodeConnections (cần Source stage poll thủ công).
- Filter includes all branches sai trigger (cần tags, không phải branches).
- Mặc dù có QUEUED đúng và EventBridge, nhưng V1 + branches làm toàn bộ không khớp.
📘 Tài liệu tham khảo
- AWS Docs: CodePipeline V2 triggers with CodeConnections (cập nhật 2025).
- CodePipeline execution modes (QUEUED vs SUPERSEDED).
- ECR Image Pushed events với EventBridge.
- AWS Exam Guide DOP-C02 (2024-2026): Phần CodePipeline V2 & Event-driven architectures.
- Best Practices: AWS Well-Architected Framework - DevOps Pillar (2025 edition).
🛠️ Lời khuyên: Trong thực tế, test pipeline V2 qua AWS Console và dùng CloudFormation cho IaC để deploy nhanh!
Which solution will meet these requirements with the LEAST operational overhead?
- A Enable AWS CloudTrail for control plane logging. Deploy Logstash as a ReplicaSet on the nodes to collect logs from the nodes. Use Amazon OpenSearch Service to store and analyze the logs for the control plane and the nodes.
- B Enable control plane logging for the EKS cluster. Send the logs to Amazon CloudWatch. Use CloudWatch Container Insights to collect logs for the nodes and the containers. Use CloudWatch Logs Insights to query and analyze the logs for the control plane and the nodes.
- C Enable API server control plane logging for the EKS cluster. Send the logs to Amazon S3 Deploy Kubernetes Event Exporter to the nodes to collect logs from the nodes. Send the logs to Amazon S3. Use Amazon Athena to query logs for the control plane and the nodes. Use Amazon QuickSight for visualization.
- D Use AWS Distro for OpenTelemetry to collect logs for the control plane and the nodes. Stream all the logs to Amazon Data Firehose. Use Amazon Redshift to analyze the aggregated log data for the control plane and the nodes.
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 triển khai logging toàn diện cho Amazon Elastic Kubernetes Service (EKS), bao gồm:
- Control plane: Phân tích các API requests đến Kubernetes control plane (như API server logs, audit logs, authenticator, controller manager, scheduler).
- Nodes: Giám sát hiệu suất container (container performance), bao gồm logs từ nodes và containers. Yêu cầu chính là giải pháp có ít operational overhead nhất (least operational overhead), nghĩa là ưu tiên các dịch vụ managed của AWS, giảm thiểu việc tự quản lý infrastructure, deployment DaemonSet/ReplicaSet, hoặc xử lý dữ liệu phức tạp.
📘 Tài liệu tham khảo: - AWS EKS Control Plane Logging: docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html (cập nhật 2024-2026).
- CloudWatch Container Insights: docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights.html.
✅ Đáp án đúng
Enable control plane logging for the EKS cluster. Send the logs to Amazon CloudWatch. Use CloudWatch Container Insights to collect logs for the nodes and the containers. Use CloudWatch Logs Insights to query and analyze the logs for the control plane and the nodes.
Lý do lựa chọn:
- Đây là giải pháp managed hoàn toàn bởi AWS, zero-effort deployment cho logging.
- Control plane logging của EKS tích hợp trực tiếp gửi logs (API, audit, etc.) đến CloudWatch Logs mà không cần config thêm.
- CloudWatch Container Insights tự động thu thập metrics/logs từ nodes/containers/pods (performance monitoring như CPU, memory, network), hỗ trợ EKS out-of-the-box với CloudWatch agent (tự động deploy).
- CloudWatch Logs Insights query/analyze logs unified (control plane + nodes) bằng ngôn ngữ query mạnh mẽ, không cần tool bên thứ ba.
- Least overhead: Không deploy pod tự quản lý, không ETL phức tạp, scale tự động. Phù hợp best practice AWS đến 2026.
🔍 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 tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể:
-
❌ [SAI] Enable AWS CloudTrail for control plane logging. Deploy Logstash as a ReplicaSet on the nodes to collect logs from the nodes. Use Amazon OpenSearch Service to store and analyze the logs for the control plane and the nodes.
- Lý do sai: CloudTrail chỉ log management events AWS (như CreateCluster), không phải Kubernetes API requests chi tiết (ví dụ: pod create/delete). Logstash là tool tự quản lý (deploy ReplicaSet), cần config pipeline phức tạp, high overhead. OpenSearch yêu cầu domain setup, mapping logs, không unified cho control plane/nodes. Overhead cao do tự quản lý collector và storage.
-
✅ [ĐÚNG] Enable control plane logging for the EKS cluster. Send the logs to Amazon CloudWatch. Use CloudWatch Container Insights to collect logs for the nodes and the containers. Use CloudWatch Logs Insights to query and analyze the logs for the control plane and the nodes.
- Lý do đúng: Như phần trên, fully managed, tích hợp native EKS + CloudWatch. Container Insights cover node/container performance (metrics/logs), Logs Insights query cross-log groups. Zero custom deployment, scale theo cluster.
-
❌ [SAI] Enable API server control plane logging for the EKS cluster. Send the logs to Amazon S3 Deploy Kubernetes Event Exporter to the nodes to collect logs from the nodes. Send the logs to Amazon S3. Use Amazon Athena to query logs for the control plane and nodes. Use Amazon QuickSight for visualization.
- Lý do sai: Chỉ enable API server logging (một phần control plane, thiếu audit/scheduler). Kubernetes Event Exporter là sidecar/DaemonSet tự deploy, config CRD phức tạp, overhead cao. S3 + Athena + QuickSight là ETL pipeline (partitioning, Glue crawler), không real-time, khó analyze performance metrics. Không least overhead.
-
❌ [SAI] Use AWS Distro for OpenTelemetry to collect logs for the control plane and the nodes. Stream all the logs to Amazon Data Firehose. Use Amazon Redshift to analyze the aggregated log data for the control plane and the nodes.
- Lý do sai: ADOT (AWS Distro for OpenTelemetry) hỗ trợ metrics/traces chủ yếu, logs cần config phức tạp (Collector DaemonSet cho control plane/nodes). Firehose + Redshift là data warehouse cho batch analytics, không phù hợp real-time logging/performance monitoring (latency cao, cost cao cho logs). Overhead lớn: deploy collector, schema Redshift, không native EKS integration cho control plane.
🛠️ Khuyến nghị triển khai
- Bật control plane logging qua AWS Console/CLI:
aws eks update-cluster-config --name cluster --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'. - Enable Container Insights:
aws eks update-cluster-config --region us-west-2 --name my-cluster --resources-vpc-config endpointPublicAccess=true,publicAccessCidrs='my-cidrs' --logging --cloudwatch-log-group=log-group-name. - Query Logs Insights:
fields @timestamp, @message | filter @message like /API/ | stats count(*) by bin(1h).
Giải pháp này đảm bảo tuân thủ AWS Well-Architected Framework (Operational Excellence pillar)! 🚀
Every employee has a unique IAM user. There are already pre-existing IAM policies for developer and database administrator job functions. All AWS resources are already tagged with appropriate project tags. All the IAM users are tagged with the appropriate project and job function.
The company must ensure that each employee can access only the project that the employee is working on.
Which solution will meet these requirements? (Choose three.)
- A For each project, create one IAM role for developers and one IAM role for database administrators. Tag the IAM roles with the corresponding projects and job functions.
- B Modify the pre-existing IAM policies to include a StringEquals ResourceTag condition for projects that match the PrincipalTag value. Attach the modified policies to the IAM roles for each job function.
- C Create an IAM policy that allows users to assume a role when the ResourceTag value matches the PrincipalTag value for project tags and job title tags. Attach the new policy to all IAM users.
- D Create an IAM policy that allows users to assume a role when the ResourceTag value matches the PrincipalTag value for project tags and job title tags. Attach the new policy to the IAM roles for each job function.
- E Tag the pre-existing IAM policies with the appropriate projects and job functions. Attach the modified policies to IAM roles for each job function.
- F For each project, create one IAM group for developers and one IAM group for database administrators. Add the appropriate users to each group so the users can assume their respective IAM roles.
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 thực thi nguyên tắc least privilege (quyền hạn tối thiểu) trong AWS IAM để kiểm soát truy cập dựa trên project và chức năng công việc (developers chỉ truy cập EC2, DBAs chỉ truy cập RDS).
✅ Yêu cầu chính:
- Mỗi nhân viên có IAM user riêng, đã được tag với project và job function phù hợp.
- Tất cả AWS resources (EC2, RDS) đã được tag với project.
- Có sẵn IAM policies cho developers và DBAs.
- Giải pháp phải đảm bảo mỗi nhân viên chỉ truy cập project mình đang làm, sử dụng Attribute-Based Access Control (ABAC) với tags trên principals (users/roles) và resources.
🛠️ Cách tiếp cận tốt nhất: Sử dụng IAM roles per project, PrincipalTag trên users/roles để match với ResourceTag trên roles/resources qua sts:AssumeRole và policy conditions. Điều này tuân thủ best practices AWS về scalability và least privilege (cập nhật đến 2024-2026, theo AWS IAM ABAC guidelines).
📘 Tài liệu tham khảo:
- AWS IAM Tutorial: Attribute-based access control (ABAC)
- Principal tags in IAM
- IAM policy condition keys for tags
✅ Đáp án đúng (Chọn 3 phương án sau - đây là giải pháp hoàn chỉnh theo thứ tự logic)
-
For each project, create one IAM role for developers and one IAM role for database administrators. Tag the IAM roles with the corresponding projects and job functions.
🟢 Lý do đúng: Tạo IAM roles riêng cho từng project (dev-role-projectX, dba-role-projectX) và tag roles với project + job function (e.g.,project:ProjectX,job:developer). Điều này cho phép sử dụng PrincipalTag của role khi assume, match với tags trên resources. Đây là bước nền tảng cho ABAC, tránh tạo policies riêng lẻ, dễ scale. -
Modify the pre-existing IAM policies to include a StringEquals ResourceTag condition for projects that match the PrincipalTag value. Attach the modified policies to the IAM roles for each job function.
🟢 Lý do đúng: Sửa pre-existing policies (dev policy chỉ EC2, dba policy chỉ RDS) thêm conditionStringEquals: "${aws:ResourceTag/project}": "${aws:PrincipalTag/project}". Attach vào roles tương ứng. Khi user assume role → principal là role (có tag project/job) → chỉ access resources match tag project của role. Đảm bảo least privilege per project. -
Create an IAM policy that allows users to assume a role when the ResourceTag value matches the PrincipalTag value for project tags and job title tags. Attach the new policy to all IAM users.
🟢 Lý do đúng: Tạo assume-role policy với conditionStringEquals: { "aws:ResourceTag/project": "${aws:PrincipalTag/project}", "aws:ResourceTag/job": "${aws:PrincipalTag/job}" }cho actionsts:AssumeRole. Attach vào tất cả IAM users. User chỉ assume được role match tag project/job của chính user (PrincipalTag), hoàn thiện chuỗi: user → assume role (match tag) → role access resource (match tag).
❌ Phân tích các phương án SAI (và lý do loại bỏ)
-
Create an IAM policy that allows users to assume a role when the ResourceTag value matches the PrincipalTag value for project tags and job title tags. Attach the new policy to the IAM roles for each job function.
🔴 Lý do sai: Attach assume-role policy vào roles thay vì users là không hợp lý. Roles không cần "assume chính mình" hoặc các role khác theo cách này; policy assume phải ở principals muốn assume (là users). Nếu attach vào roles, sẽ tạo vòng lặp vô nghĩa và không kiểm soát được user assume role. -
Tag the pre-existing IAM policies with the appropriate projects and job functions. Attach the modified policies to IAM roles for each job function.
🔴 Lý do sai: IAM policies không hỗ trợ PrincipalTag (tags chỉ áp dụng cho users/groups/roles/resources). Tag policy không ảnh hưởng đến condition matching. Việc này không enforce least privilege per project; chỉ attach policy mà không có condition tag sẽ cho quyền rộng. -
For each project, create one IAM group for developers and one IAM group for database administrators. Add the appropriate users to each group so the users can assume their respective IAM roles.
🔴 Lý do sai: Sử dụng groups thay vì tận dụng tags trên users trực tiếp (như yêu cầu đề bài). Groups yêu cầu quản lý thủ công (add/remove users), không scale và không dùng ABAC với PrincipalTag. Đề bài nhấn mạnh tags đã có sẵn trên users, nên ưu tiên tag-based thay vì group membership.
🛡️ Tóm tắt lợi ích giải pháp đúng: Hoàn toàn tự động hóa qua tags, zero-touch khi thêm user/project mới (chỉ tag là đủ), tuân thủ AWS Well-Architected Framework (Security Pillar). Không cần SCPs hay resource policies phức tạp! 🚀
Which solution will meet these requirements?
- A Add the EC2 instance to an Auto Scaling group. Set the minimum, maximum, and desired capacity to 1.
- B Add the EC2 instance to an Auto Scaling group. Configure a lifecycle hook to detach the EBS volume if the EC2 instance shuts down or terminates
- C Create an Amazon CloudWatch alarm for the StatusCheckFailed_System metric. Add an EC2 action to recover the instance when the alarm state is in ALARM
- D Create an Amazon CloudWatch alarm for the NetworkOut metric. Add an EC2 action to recover the instance when the alarm state is in INSUFFICIENT_DATA.
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ăng tính resilient (khả năng phục hồi) cho một instance Amazon EC2 đang chạy website môi trường phát triển (development environment) và database, sử dụng Amazon EBS làm lưu trữ.
- Vấn đề chính: Instance dễ bị ảnh hưởng bởi hardware issues (lỗi phần cứng underlying), đặc biệt khi AWS phát hiện instance mất kết nối mạng (lost network connectivity).
- Yêu cầu: Cần giải pháp tự động recover (khôi phục) instance EC2 mà không cần can thiệp thủ công.
- Recover ở đây nghĩa là AWS sẽ stop instance và start lại trên hardware mới lành mạnh, giữ nguyên EBS volume và IP (nếu Elastic IP).
- Bối cảnh AWS: EC2 có hai loại status check:
- StatusCheckFailed_Instance: Vấn đề hypervisor/network (instance vẫn chạy nhưng không reachable).
- StatusCheckFailed_System: Vấn đề hệ thống guest OS/hardware (phù hợp với yêu cầu). Giải pháp phải tận dụng CloudWatch alarms kết hợp EC2 actions để tự động hóa, theo best practices AWS mới nhất (2024-2026).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create an Amazon CloudWatch alarm for the StatusCheckFailed_System metric. Add an EC2 action to recover the instance when the alarm state is in ALARM.
Lý do chi tiết:
- 🛠️ StatusCheckFailed_System metric: Metric này kích hoạt khi AWS phát hiện hệ thống instance gặp vấn đề nghiêm trọng (như hardware failure dẫn đến mất network connectivity). Đây chính là trigger phù hợp với yêu cầu.
- 📈 CloudWatch alarm: Khi metric >=1 (ALARM state) trong khoảng thời gian chỉ định (ví dụ: 2 phút), alarm sẽ trigger EC2 recovery action – AWS tự động stop/start instance trên host mới, giữ nguyên data EBS và metadata.
- 🚀 Ưu điểm:
- Tự động, nhanh chóng (thường <5 phút).
- Không thay đổi instance ID, EBS attach tự động.
- Hỗ trợ fully updated đến 2026 (EC2 Instance Recovery via CloudWatch vẫn là feature core).
- Đây là giải pháp official AWS cho resilience hardware-level mà không cần ASG hay thay đổi architecture.
📋 Phân tích tất cả các phương án
Dưới đây là phân tích từng lựa chọn giữ nguyên văn bản gốc bằng tiếng Anh. Tôi đánh dấu ✅/❌ và giải thích rõ ràng lý do đúng/sai dựa trên AWS docs mới nhất.
-
❌ Add the EC2 instance to an Auto Scaling group. Set the minimum, maximum, and desired capacity to 1.
Giải thích sai: Auto Scaling Group (ASG) với min/max/desired=1 chỉ launch instance mới nếu instance hiện tại terminate hoặc fail health check. Nó không tự động recover instance đang chạy khi hardware fail/mất network (instance vẫn "healthy" theo ASG ELB health check). Phải thủ công terminate mới scale up, không đáp ứng yêu cầu tự động recover. Không phù hợp cho single-instance resilience. -
❌ Add the EC2 instance to an Auto Scaling group. Configure a lifecycle hook to detach the EBS volume if the EC2 instance shuts down or terminates.
Giải thích sai: Lifecycle hook chỉ custom action khi scale in/out (terminate/shutdown), như detach EBS. Nhưng ASG không detect hardware/network failure để trigger hook tự động. Hook còn tăng rủi ro data loss (detach EBS), trái ngược yêu cầu giữ EBS intact. Không giải quyết recover mà còn phức tạp hóa. -
✅ Create an Amazon CloudWatch alarm for the StatusCheckFailed_System metric. Add an EC2 action to recover the instance when the alarm state is in ALARM.
Giải thích đúng: Như phần trên, metric này chính xác detect system/hardware failure (bao gồm mất network). EC2 action recover tự động (reboot trên host mới), hoàn hảo cho yêu cầu. Đã test và recommend trong AWS Well-Architected Framework (Reliability pillar). -
❌ Create an Amazon CloudWatch alarm for the NetworkOut metric. Add an EC2 action to recover the instance when the alarm state is in INSUFFICIENT_DATA.
Giải thích sai: NetworkOut là metric outbound traffic bytes, không liên quan đến network connectivity check (có thể thấp do app idle, không phải hardware fail). INSUFFICIENT_DATA state nghĩa là thiếu data (không phải ALARM), nên không trigger action. Sai metric + sai state = không hoạt động.
📘 Tài liệu tham khảo (AWS cập nhật 2024-2026)
- EC2 Status Checks & Recovery: Monitor your instances using status checks – Chi tiết StatusCheckFailed_System và recover action.
- CloudWatch Alarms for EC2: Actions for Amazon EC2 alarms – Hướng dẫn tạo alarm + recover.
- AWS Well-Architected: Reliability Pillar – Recommend CloudWatch cho instance recovery (framework v3+).
- Best Practice: Kết hợp với Elastic IP cho zero-downtime network (EC2 docs).
Giải pháp này đảm bảo high availability mà không over-engineer! Nếu cần demo CloudFormation, hãy hỏi thêm. 🚀
Which solution will meet these requirements?
- A Configure AWS Systems Manager Patch Manager and AWS Config with defined patch baselines and compliance rules that run Systems Manager Automation documents.
- B Access each EC2 instance by using SSH keys. Check for and apply security updates by using package managers. Verify the installations.
- C Configure Auto Scaling groups that have scaling policies based on Amazon CloudWatch metrics. Configure Auto Scaling launch templates that launch new instances by using the latest AMIs that contain new security patches.
- D Use AWS CloudFormation to recreate EC2 instances with the latest AMI every time a new patch becomes available. Use AWS CloudTrail logs to monitor patch compliance and to send alerts for non-compliant instances.
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ự động hóa việc giám sát và thực thi tuân thủ vá bảo mật (security patches) cho một fleet các instance Amazon EC2 đang chạy ứng dụng quan trọng và dữ liệu nhạy cảm. 🔒 Công ty cần giải pháp tự động để:
- Theo dõi tình trạng vá lỗi bảo mật trên toàn bộ fleet EC2.
- Đảm bảo các instance luôn cập nhật patches mới nhất để chống lỗ hổng (vulnerabilities) và tuân thủ tiêu chuẩn ngành (industry standards) cũng như quy định pháp lý (regulations).
- Không chỉ dừng ở việc áp dụng patches mà còn enforce compliance (thực thi tuân thủ), nghĩa là phát hiện và khắc phục tự động các instance không đạt chuẩn.
Vấn đề cốt lõi: Tự động hóa quy trình patching ở quy mô lớn (fleet-wide) mà không cần can thiệp thủ công, phù hợp với DevOps best practices trên AWS. 🛠️ Đây là chủ đề phổ biến trong kỳ thi AWS Certified DevOps Engineer Professional (DOP-C02), liên quan đến AWS Systems Manager (SSM) và các dịch vụ quản lý compliance.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Configure AWS Systems Manager Patch Manager and AWS Config with defined patch baselines and compliance rules that run Systems Manager Automation documents.
Lý do chọn đáp án này (dựa trên kiến thức AWS cập nhật đến 2026):
🔹 AWS Systems Manager Patch Manager là dịch vụ chuyên dụng để tự động quét, áp dụng và báo cáo patches cho EC2 instances (hỗ trợ Windows, Linux, và các OS khác). Nó sử dụng patch baselines (quy tắc định nghĩa patches phê duyệt, phê duyệt thử nghiệm, và lịch trình) để enforce patching.
🔹 AWS Config tích hợp để giám sát compliance qua compliance rules (quy tắc tùy chỉnh), tự động chạy Systems Manager Automation documents (như AWS-RunPatchBaseline) để khắc phục instance không tuân thủ.
🔹 Giải pháp này fully automated, scalable cho fleet lớn, hỗ trợ maintenance windows để tránh downtime, và tích hợp với Amazon EventBridge để alerting. Đây là recommended solution theo AWS Well-Architected Framework (Pillar: Security & Operations).
📘 Tài liệu tham khảo:
- AWS Systems Manager Patch Manager (cập nhật 2024-2026).
- AWS Config Patch Compliance Rules.
- AWS DOP-C02 Exam Guide: Domain 3 (Automation & Optimization).
📋 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 ✅ cho đúng, ❌ cho sai, và giải thích rõ ràng lý do bằng tiếng Việt dựa trên tính tự động hóa, scalability, và compliance enforcement.
-
Configure AWS Systems Manager Patch Manager and AWS Config with defined patch baselines and compliance rules that run Systems Manager Automation documents.
✅ Đúng hoàn toàn. Như đã giải thích ở trên, đây là giải pháp chuẩn AWS cho automated patching và compliance monitoring. Patch baselines định nghĩa patches cần áp dụng, AWS Config kiểm tra và tự động remediate qua Automation documents. Hoàn hảo cho fleet lớn, không downtime lớn, và tuân thủ đầy đủ. 🏆 Best practice! -
Access each EC2 instance by using SSH keys. Check for and apply security updates by using package managers. Verify the installations.
❌ Sai. Phương án này hoàn toàn thủ công (manual SSH vào từng instance, dùng yum/apt để check/update), không scalable cho fleet lớn (hàng trăm/thousands instances). Không có monitoring tự động hay enforcement compliance, dễ lỗi con người và không đáp ứng yêu cầu "automated solution". 😩 Không phù hợp DevOps. -
Configure Auto Scaling groups that have scaling policies based on Amazon CloudWatch metrics. Configure Auto Scaling launch templates that launch new instances by using the latest AMIs that contain new security patches.
❌ Sai một phần. Auto Scaling + launch templates với latest AMIs chỉ đảm bảo instances mới có patches (qua AMI baking), nhưng không monitor/enforce patches trên instances hiện tại (existing fleet). Scaling policies dựa CloudWatch chỉ scale, không patching. Fleet cũ vẫn vulnerable nếu không terminate/replace thủ công. 🚫 Không giải quyết compliance cho toàn bộ fleet đang chạy. -
Use AWS CloudFormation to recreate EC2 instances with the latest AMI every time a new patch becomes available. Use AWS CloudTrail logs to monitor patch compliance and to send alerts for non-compliant instances.
❌ Sai. CloudFormation recreate instances gây downtime cao (phải terminate cũ, launch mới), không automated patching mà là "nuke and pave" (phá hủy tái tạo) – không thực tế cho critical apps. CloudTrail chỉ audit API calls, không monitor patch compliance (không quét software level). Alerting kém, thiếu enforcement tự động. ⚠️ Không scalable và rủi ro cao.
🛠️ Kết luận & Best Practices bổ sung
Giải pháp đúng tận dụng AWS-native services để đạt zero-touch patching và compliance as code. Để triển khai thực tế:
- Thiết lập Patch Manager với approval rules (critical/security patches auto-approve).
- Dùng AWS Config rule
ssm-patch-complianceđể remediate. - Tích hợp với AWS Security Hub cho tổng quan vulnerabilities.
💡 Tip thi DOP-C02: Luôn ưu tiên SSM Patch Manager cho EC2 patching; tránh manual hoặc ASG-only solutions. Nếu cần hỗ trợ hybrid (on-prem), dùng SSM Fleet Manager (cập nhật 2025).
The company must implement an automated solution to detect issues in the new deployment and to initiate a rollback if necessary.
Which solution will meet these requirements with the LEAST operational overhead?
- A Set up Amazon CloudWatch Application Insights for the ECS cluster. Create an Amazon EventBridge rule to invoke an AWS Lambda function to analyze the task states. Program the Lambda function to use the ECS UpdateService API call to initiate a rollback if a specific percentage of tasks fail.
- B Set up Amazon CloudWatch Application Insights for the ECS cluster. Configure Application Insights to monitor key performance indicators of the microservices in the critical user journeys and API calls. Create CloudWatch alarms based on the insights. Use Amazon EventBridge to invoke an AWS Step Functions workflow to evaluate the alarms. Configure the workflow to initiate a rollback if necessary by using the alarms' built-in integration with Amazon ECS.
- C Create CloudWatch Synthetics canaries that simulate critical user journeys and API calls. Implement AWS X-Ray tracing for all the microservices Configure X-Ray to send traces to CloudWatch. Create CloudWatch alarms based on error rates and latency metrics. Create an AWS Lambda function to analyze the traces and to initiate a rollback if necessary by using the alarms' built-in integration with Amazon ECS.
- D Create CloudWatch Synthetics canaries that simulate critical user journeys and API calls. Configure the canaries to run against the new deployment. Create CloudWatch alarms that are invoked when canaries fail. Use the alarms’ built-in integration with Amazon ECS to initiate a rollback if the alarms are invoked before traffic is routed to the new deployment.
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 triển khai một ứng dụng microservices trên Amazon Elastic Container Service (Amazon ECS) cluster. Sau mỗi lần deploy (triển khai phiên bản mới), công ty cần validate (kiểm tra) các critical user journeys (hành trình người dùng quan trọng) và API endpoints trước khi route traffic (chuyển hướng lưu lượng) sang phiên bản mới. Giải pháp phải tự động hóa việc phát hiện vấn đề và rollback (hoàn tác) nếu cần, đồng thời đảm bảo LEAST operational overhead (ít chi phí vận hành nhất).
🛠️ Yêu cầu chính:
- Sử dụng blue/green deployment ngầm định trên ECS (với AWS CodeDeploy) để test phiên bản xanh (new) trước khi switch traffic từ xanh dương (blue - old).
- Validate bằng cách simulate user journeys và API calls.
- Tích hợp tự động rollback qua alarms mà không cần code custom nhiều.
- Kiến thức cập nhật 2026: ECS hỗ trợ CloudWatch Synthetics canaries tích hợp trực tiếp với alarms cho blue/green deployments, cho phép hook alarms vào deployment lifecycle để validate và rollback mà không cần Lambda hay workflow phức tạp (AWS re:Invent 2024-2025 updates nhấn mạnh zero-code integrations).
📘 Tài liệu tham khảo:
- AWS Docs: ECS Blue/Green Deployments with CodeDeploy
- CloudWatch Synthetics Canaries for ECS Validation
- Alarms Integration with ECS Deployments
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
Create CloudWatch Synthetics canaries that simulate critical user journeys and API calls. Configure the canaries to run against the new deployment. Create CloudWatch alarms that are invoked when canaries fail. Use the alarms’ built-in integration with Amazon ECS to initiate a rollback if the alarms are invoked before traffic is routed to the new deployment.
Lý do 🏆:
- Giải pháp này sử dụng CloudWatch Synthetics canaries để simulate chính xác user journeys và API calls trên phiên bản mới (green deployment).
- Alarms được trigger khi canary fail, và built-in integration với ECS (qua CodeDeploy hooks) tự động rollback trước khi route traffic, không cần code custom.
- Least operational overhead vì zero-code: chỉ config canaries + alarms, không Lambda/Step Functions/EventBridge phức tạp. Hoàn hảo cho automated validation trong ECS blue/green (cập nhật 2025+).
🔍 Phân tích tất cả các phương án (đúng/sai)
-
❌ Phương án SAI 1:
Set up Amazon CloudWatch Application Insights for the ECS cluster. Create an Amazon EventBridge rule to invoke an AWS Lambda function to analyze the task states. Program the Lambda function to use the ECS UpdateService API call to initiate a rollback if a specific percentage of tasks fail.
Giải thích sai: CloudWatch Application Insights chỉ monitor metrics tổng quát (như CPU/memory), không simulate user journeys/API calls cụ thể. Phải custom Lambda + EventBridge + ECS API để rollback → operational overhead cao (code, maintain Lambda). Không validate trước route traffic chính xác. -
❌ Phương án SAI 2:
Set up Amazon CloudWatch Application Insights for the ECS cluster. Configure Application Insights to monitor key performance indicators of the microservices in the critical user journeys and API calls. Create CloudWatch alarms based on the insights. Use Amazon EventBridge to invoke an AWS Step Functions workflow to evaluate the alarms. Configure the workflow to initiate a rollback if necessary by using the alarms' built-in integration with Amazon ECS.
Giải thích sai: Application Insights theo dõi KPI metrics nhưng không simulate journeys/API (chỉ reactive, không proactive validation). Alarms không có built-in integration trực tiếp với ECS như mô tả (phải qua Step Functions + EventBridge) → overhead lớn với workflow phức tạp, không least effort. -
❌ Phương án SAI 3:
Create CloudWatch Synthetics canaries that simulate critical user journeys and API calls. Implement AWS X-Ray tracing for all the microservices Configure X-Ray to send traces to CloudWatch. Create CloudWatch alarms based on error rates and latency metrics. Create an AWS Lambda function to analyze the traces and to initiate a rollback if necessary by using the alarms' built-in integration with Amazon ECS.
Giải thích sai: Synthetics canaries tốt cho simulation, nhưng thêm X-Ray tracing + custom Lambda để analyze traces → overhead cao (setup tracing toàn bộ microservices, code Lambda). Alarms không có built-in rollback qua Lambda như vậy; phức tạp hơn cần thiết so với direct integration. -
✅ Phương án ĐÚNG:
Create CloudWatch Synthetics canaries that simulate critical user journeys and API calls. Configure the canaries to run against the new deployment. Create CloudWatch alarms that are invoked when canaries fail. Use the alarms’ built-in integration with Amazon ECS to initiate a rollback if the alarms are invoked before traffic is routed to the new deployment.
Giải thích đúng: ✅ Hoàn chỉnh, proactive validation bằng canaries trên new deployment. Alarms trigger → built-in ECS integration (CodeDeploy hooks) tự động rollback pre-traffic-switch. Least overhead: chỉ config, không custom code/orchestration.
🛡️ Kết luận: Giải pháp đúng tận dụng native integrations AWS mới nhất, đảm bảo DevOps best practices cho ECS microservices! 🚀
All logs that the applications produce must be sent to a central location. The logs must be encrypted with keys that the company manages.
Which solution meets these requirements with the LEAST operational overhead?
- A In the central log account, enable logs as the data source in CloudWatch. Add the organization ID to the source account list. Create a CloudFormation StackSet by using the template provided by CloudWatch to enable central monitoring in all the organization's accounts.
- B Create an Amazon S3 bucket in the central log account. Create an Amazon Data Firehose stream in the central log account. Set the S3 bucket as the destination of the Firehose stream. Create a log subscription in the central log account. Set the Firehose stream as a target of the subscription. Store the subscription log ARN in AWS Systems Manager Parameter Store for each project to use to send logs to the S3 bucket.
- C Create an Amazon S3 bucket in each account. Create an Amazon OpenSearch Service cluster in the central log account. Create an Amazon Simple Queue Service (Amazon SQS) queue in the central log account. Create an S3 trigger that sends events to the SQS queue each time a new file is uploaded to the S3 bucket. Create a Lambda function that processes each file and sends each file to the OpenSearch Service cluster.
- D Create an Amazon S3 bucket in the central log account. Create an Amazon Data Firehose stream in each account. Set the S3 bucket as the destination of the Firehose streams. Create a log subscription in each account with the Firehose streams as a target.
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ập trung hóa logs (centralized logging) từ các ứng dụng chạy trên Amazon EC2 instances (có CloudWatch agent) và AWS Lambda functions nằm trong nhiều AWS accounts thuộc cùng một AWS Organizations. Tất cả logs phải được gửi đến một central log account dành riêng, đồng thời mã hóa bằng keys do công ty quản lý (tức là customer-managed KMS keys). Yêu cầu chính là giải pháp phải có operational overhead thấp nhất (least operational overhead), nghĩa là dễ triển khai, tự động hóa cao, không cần quản lý thủ công ở từng account.
Các ràng buộc chính:
- Logs từ EC2 (qua CloudWatch agent) và Lambda (native CloudWatch Logs).
- Cross-account logging trong Organizations.
- Encryption với CMK (Customer Managed Keys).
- Tối ưu hóa vận hành: Sử dụng tính năng native AWS để tự động hóa qua Organizations và StackSets.
📘 Kiến thức AWS cập nhật 2026: AWS CloudWatch hỗ trợ Cross-Account Observability và Centralized Logging qua feature logs data source trong central account, kết hợp CloudFormation StackSets để tự động enable logging cross-account cho toàn Organizations (không cần IAM roles thủ công phức tạp). Điều này tích hợp sẵn encryption với KMS CMK. (Nguồn: AWS CloudWatch Documentation - Centralized Logging và CloudWatch Logs Central Logging with StackSets).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Phương án đầu tiên (In the central log account, enable logs as the data source in CloudWatch. Add the organization ID to the source account list. Create a CloudFormation StackSet by using the template provided by CloudWatch to enable central monitoring in all the organization's accounts.).
Lý do 🛠️:
- Giải pháp này sử dụng tính năng native CloudWatch Centralized Logging (cập nhật mới nhất), chỉ cần enable logs data source ở central account, thêm Organization ID để tự động bao quát tất cả member accounts.
- Sử dụng CloudFormation StackSet template do AWS cung cấp sẵn để deploy IAM roles và subscriptions cross-account chỉ với một lần hành động, tự động propagate đến toàn Organizations → least overhead.
- Hỗ trợ logs từ EC2 (CloudWatch agent) và Lambda tự động, encryption với CMK được cấu hình ở central (KMS multi-account access).
- Không cần tạo resources thủ công ở từng account, giảm vận hành tối đa.
📋 Phân tích tất cả các phương án
-
Phương án 1 (Đúng ✅):
In the central log account, enable logs as the data source in CloudWatch. Add the organization ID to the source account list. Create a CloudFormation StackSet by using the template provided by CloudWatch to enable central monitoring in all the organization's accounts.
🟢 Đúng vì: Như giải thích trên, đây là cách tối ưu nhất với StackSet tự động hóa toàn Organizations, hỗ trợ encryption CMK native, phù hợp EC2/Lambda logs. Overhead thấp nhất (one-click deploy). -
Phương án 2 (Sai ❌):
Create an Amazon S3 bucket in the central log account. Create an Amazon Data Firehose stream in the central log account. Set the S3 bucket as the destination of the Firehose stream. Create a log subscription in the central log account. Set the Firehose stream as a target of the subscription. Store the subscription log ARN in AWS Systems Manager Parameter Store for each project to use to send logs to the S3 bucket.
🔴 Sai vì: Log subscription phải tạo ở source account (không phải central account), không thể tạo subscription ở central để pull logs từ các account khác. Phải lưu ARN thủ công vào SSM Parameter Store cho từng project → overhead cao, không tự động, không scale với Organizations. -
Phương án 3 (Sai ❌):
Create an Amazon S3 bucket in each account. Create an Amazon OpenSearch Service cluster in the central log account. Create an Amazon Simple Queue Service (Amazon SQS) queue in the central log account. Create an S3 trigger that sends events to the SQS queue each time a new file is uploaded to the S3 bucket. Create a Lambda function that processes each file and sends each file to the OpenSearch Service cluster.
🔴 Sai vì: Yêu cầu tạo S3 bucket ở mỗi account → overhead cực cao (quản lý thủ công/multi-account). Sử dụng OpenSearch + SQS + Lambda + S3 events là kiến trúc phức tạp, không native cho CloudWatch logs (EC2/Lambda logs cần export thủ công sang S3 trước). Không tối ưu encryption CMK central, dễ lỗi scale. -
Phương án 4 (Sai ❌):
Create an Amazon S3 bucket in the central log account. Create an Amazon Data Firehose stream in each account. Set the S3 bucket as the destination of the Firehose streams. Create a log subscription in each account with the Firehose streams as a target.
🔴 Sai vì: Phải tạo Firehose + log subscription ở mỗi account → overhead lớn (thủ công deploy/replicate IAM roles cross-account cho từng account). Không tận dụng Organizations/StackSets tự động, khó quản lý KMS CMK permissions multi-account. Ít hiệu quả hơn native CloudWatch.
Kết luận 🎯: Phương án 1 là lựa chọn best practice từ AWS, đảm bảo tuân thủ least overhead và encryption requirements. Khuyến nghị thực hành trên AWS Console để verify!
Which combination of steps will meet these requirements? (Choose three.)
- A Use an advanced tier Parameter Store parameter to store the database credentials in the central AWS account.
- B Create an IAM role in the AWS account that hosts the CI/CD pipeline. Add the full ARN of the parameter to the IAM policy that is associated with the IAM role.
- C Use a standard tier Parameter Store parameter to store the database credentials in the central AWS account.
- D Use an AWS KMS managed key to encrypt the parameter. Grant decrypt permissions for the KMS key to the AWS account that hosts the CI/CD pipeline.
- E Use a customer managed AWS KMS key to encrypt the parameter. Grant decrypt permissions for the customer managed key to the AWS account that hosts the CI/CD pipeline.
- F Create an AWS Resource Access Manager (AWS RAM) resource share in the central AWS account. Share the parameter with the account that hosts the CI/CD pipeline.
Xem giải thích
🧩 Giải thích nội dung câu hỏi
Câu hỏi yêu cầu một DevOps Engineer triển khai pipeline CI/CD trong một tài khoản AWS (gọi là CI/CD account). Pipeline này cần truy cập các thông tin nhạy cảm như database credentials, được lưu trữ trong AWS Systems Manager (SSM) Parameter Store của một tài khoản trung tâm (central account) riêng biệt. Nhiệm vụ là tạo và tích hợp parameter này để CI/CD account có thể sử dụng an toàn, tuân thủ nguyên tắc least privilege và cross-account access.
📌 Yêu cầu chính: Chọn 3 bước kết hợp để đáp ứng, tập trung vào tier parameter phù hợp, mã hóa KMS, và chia sẻ tài nguyên cross-account. Đây là tình huống thực tế trong multi-account strategy (như AWS Organizations), nơi dữ liệu nhạy cảm được centralize để quản lý tập trung và giảm rủi ro.
✅ Đáp án đúng (chọn 3):
- Use an advanced tier Parameter Store parameter to store the database credentials in the central AWS account.
- Use a customer managed AWS KMS key to encrypt the parameter. Grant decrypt permissions for the customer managed key to the AWS account that hosts the CI/CD pipeline.
- Create an AWS Resource Access Manager (AWS RAM) resource share in the central AWS account. Share the parameter with the account that hosts the CI/CD pipeline.
Lý do chọn các đáp án đúng (dựa trên tài liệu AWS cập nhật 2024-2026):
- Advanced tier là bắt buộc cho cross-account sharing qua RAM, hỗ trợ versioning và KMS customer-managed. Standard tier chỉ dùng nội bộ account.
- Customer-managed KMS key (CMK) cần thiết để encrypt Advanced parameter và grant decrypt cross-account (AWS-managed key không hỗ trợ).
- AWS RAM là cách chính thức share SSM Advanced parameters cross-account, cho phép CI/CD account assume role và GetParameter an toàn.
Kết hợp 3 bước này tạo luồng: Tạo parameter Advanced + CMK → Share via RAM → CI/CD account attach policy và assume role để access. 🛠️
📋 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 giá đúng/sai với lý do cụ thể bằng tiếng Việt:
-
Use an advanced tier Parameter Store parameter to store the database credentials in the central AWS account.
✅ Đúng. Advanced tier hỗ trợ cross-account access qua AWS RAM, versioning, và tích hợp CMK. Đây là yêu cầu bắt buộc cho sensitive data chia sẻ giữa các account (Standard tier không hỗ trợ RAM sharing). -
Create an IAM role in the AWS account that hosts the CI/CD pipeline. Add the full ARN of the parameter to the IAM policy that is associated with the IAM role.
❌ Sai. Chỉ thêm ARN vào IAM policy trong CI/CD account không đủ cho cross-account access. Parameter Store yêu cầu cơ chế sharing chính thức như RAM (cho Advanced tier), nếu không sẽ bị từ chối với lỗi "AccessDeniedException". Cần kết hợp RAM + role trust policy. -
Use a standard tier Parameter Store parameter to store the database credentials in the central AWS account.
❌ Sai. Standard tier KHÔNG hỗ trợ cross-account sharing qua RAM hoặc bất kỳ cách nào khác. Nó chỉ dùng nội bộ account, giới hạn 10.000 parameters/account miễn phí. Advanced tier mới đáp ứng yêu cầu central account → CI/CD account. -
Use an AWS KMS managed key to encrypt the parameter. Grant decrypt permissions for the KMS key to the AWS account that hosts the CI/CD pipeline.
❌ Sai. AWS-managed KMS key (mặc định) không cho phép grant cross-account decrypt permissions. Chỉ customer-managed KMS key (CMK) mới hỗ trợ key policy cross-account cho Advanced parameters. -
Use a customer managed AWS KMS key to encrypt the parameter. Grant decrypt permissions for the customer managed key to the AWS account that hosts the CI/CD pipeline.
✅ Đúng. Advanced tier Parameter Store yêu cầu CMK để encrypt. Grantkms:Decryptqua key policy cho principal (account/role) của CI/CD account, đảm bảo an toàn mã hóa cross-account. -
Create an AWS Resource Access Manager (AWS RAM) resource share in the central AWS account. Share the parameter with the account that hosts the CI/CD pipeline.
✅ Đúng. AWS RAM là dịch vụ chuẩn để share SSM Advanced parameters cross-account (ra mắt 2021, cập nhật 2024). Central account tạo share → CI/CD account accept → Attach permission "SSM GetParameter" vào role pipeline (như CodePipeline/CodeBuild).
📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2024-2026)
- AWS SSM Parameter Store Advanced Tier 🛠️ (Cross-account via RAM + CMK).
- Share SSM Parameters with RAM.
- KMS Cross-Account Access.
- AWS Well-Architected Framework: DevOps Pillar (multi-account secrets management).
Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần ví dụ code IAM policy, hãy hỏi thêm.