Ngân hàng đề — AWS Certified DevOps Engineer Professional

Tìm thấy 681 câu.

Câu 371 Chọn nhiều đáp án
A company uses AWS CodeArtifact to centrally store Python packages. The CodeArtifact repository is configured with the following repository policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "codeartifact:DescribePackageVersion",
        "codeartifact:DescribeRepository",
        "codeartifact:GetPackageVersionReadme",
        "codeartifact:GetRepositoryEndpoint",
        "codeartifact:ListPackageVersionAssets",
        "codeartifact:ListPackageVersionDependencies",
        "codeartifact:ListPackageVersions",
        "codeartifact:Listpackages",
        "codeartifact:ReadFromRepository"
      ],
      "Effect": "Allow",
      "Resource": "*",
      "Principal": "*",
      "Condition": {
        "StringEquals": {
          "aws:PrincipalOrgID": [
            "o-xxxxxxxxxxx"
          ]
        }
      }
    }
  ]
}


A development team is building a new project in an account that is in an organization in AWS Organizations. The development team wants to use a Python library that has already been stored in the CodeArtifact repository in the organization. The development team uses AWS CodePipeline and AWS CodeBuild to build the new application. The CodeBuild job that the development team uses to build the application is configured to run in a VPC. Because of compliance requirements, the VPC has no internet connectivity.

The development team creates the VPC endpoints for CodeArtifact and updates the CodeBuild buildspec.yaml file. However, the development team cannot download the Python library from the repository.

Which combination of steps should a DevOps engineer take so that the development team can use CodeArtifact? (Choose two.)
  1. A Create an Amazon S3 gateway endpoint. Update the route tables for the subnets that are running the CodeBuild job.
  2. B Update the repository policy’s Principal statement to include the ARN of the role that the CodeBuild project uses.
  3. C Share the CodeArtifact repository with the organization by using AWS Resource Access Manager (AWS RAM).
  4. D Update the role that the CodeBuild project uses so that the role has sufficient permissions to use the CodeArtifact repository.
  5. E Specify the account that hosts the repository as the delegated administrator for CodeArtifact in the organization.
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 xoay quanh việc một công ty sử dụng AWS CodeArtifact để lưu trữ tập trung các gói Python. Repository CodeArtifact có repository policy cho phép tất cả principal (Principal: "*") trong tổ chức AWS Organizations cụ thể (aws:PrincipalOrgID: "o-xxxxxxxxxxx") thực hiện các hành động đọc (read) như DescribePackageVersion, ReadFromRepository, v.v.

Đội phát triển đang xây dựng dự án mới trong một tài khoản thuộc cùng tổ chức AWS Organizations. Họ muốn sử dụng thư viện Python đã lưu sẵn trong repository này qua AWS CodePipeline và AWS CodeBuild. CodeBuild chạy trong VPC không có kết nối internet (do yêu cầu tuân thủ).

Đội dev đã:

  • Tạo VPC endpoints cho CodeArtifact.
  • Cập nhật file buildspec.yaml (có lẽ để config pip install với --index-url và token auth).

❌ Vấn đề: Vẫn không tải được thư viện Python từ repository.

🎯 Mục tiêu: Chọn TWO bước kết hợp để DevOps engineer thực hiện, giúp đội dev truy cập được CodeArtifact từ CodeBuild trong VPC private.

🛠️ Lý do vấn đề chính (dựa kiến thức AWS cập nhật 2026):

  • Networking: VPC endpoints cho CodeArtifact (interface endpoints) chỉ xử lý API calls, nhưng CodeArtifact lưu trữ assets gói (như Python wheels) ở Amazon S3 backend. VPC không internet cần S3 gateway endpoint để truy cập S3 mà không route ra internet.
  • Permissions: Repository policy đã OK cho principal trong org, nhưng IAM role của CodeBuild project thiếu policy cho phép gọi các action CodeArtifact (như GetAuthorizationToken, ReadFromRepository). Buildspec cần token từ aws codeartifact get-authorization-token.

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

  1. Create an Amazon S3 gateway endpoint. Update the route tables for the subnets that are running the CodeBuild job.
    🧩 Lý do: CodeArtifact yêu cầu truy cập S3 để tải assets gói. Interface endpoints CodeArtifact chưa đủ; phải thêm S3 gateway endpoint (prefix list pl- cho S3) và update route table subnets CodeBuild để route traffic private đến S3. Không có nó, tải package fail dù API OK.

  2. Update the role that the CodeBuild project uses so that the role has sufficient permissions to use the CodeArtifact repository.
    🧩 Lý do: Role CodeBuild cần IAM policy attach với actions như codeartifact:GetAuthorizationToken, codeartifact:ReadFromRepository, codeartifact:GetPackageVersionAssets (và các action trong repo policy). Repository policy chỉ kiểm soát access đến repo, không thay thế IAM policy của caller.

📋 Giải thích tất cả các phương án (Choose TWO)

  • Create an Amazon S3 gateway endpoint. Update the route tables for the subnets that are running the CodeBuild job.
    ✅ Đúng. Như giải thích trên, đây là bước bắt buộc cho networking private VPC với CodeArtifact (S3 backend cho assets). AWS yêu cầu kết hợp CodeArtifact interface + S3 gateway endpoints.

  • Update the repository policy’s Principal statement to include the ARN of the role that the CodeBuild project uses.
    ❌ Sai. Repository policy đã dùng Principal: "*" với condition aws:PrincipalOrgID, cho phép tất cả role trong org (bao gồm role CodeBuild). Thêm ARN cụ thể là dư thừa và không giải quyết vấn đề chính (thiếu IAM policy trên role hoặc networking).

  • Share the CodeArtifact repository with the organization by using AWS Resource Access Manager (AWS RAM).
    ❌ Sai. CodeArtifact không hỗ trợ sharing qua AWS RAM (RAM dùng cho EC2, Transit Gateway, v.v.). Cross-account/org access dùng repository policy hoặc domain policy, nhưng ở đây đã cùng org và policy OK.

  • Update the role that the CodeBuild project uses so that the CodeBuild project uses so that the role has sufficient permissions to use the CodeArtifact repository.
    ✅ Đúng. Role cần policy IAM cho caller-side permissions (e.g., codeartifact:* hoặc cụ thể). Không có nó, aws codeartifact get-authorization-token fail dù repo policy cho phép.

  • Specify the account that hosts the repository as the delegated administrator for CodeArtifact in the organization.
    ❌ Sai. Delegated admin chỉ quản lý tạo/delete domains/repos ở org-level (AWS Organizations feature). Không ảnh hưởng đến runtime access hoặc download packages.

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

🚀 Kết luận: Áp dụng 2 bước ✅ sẽ giải quyết hoàn toàn, đảm bảo CodeBuild tải pip packages từ CodeArtifact private VPC! 🏆

Câu 372
A company uses a series of individual Amazon CloudFormation templates to deploy its multi-Region applications. These templates must be deployed in a specific order. The company is making more changes to the templates than previously expected and wants to deploy new templates more efficiently. Additionally, the data engineering team must be notified of all changes to the templates.

What should the company do to accomplish these goals?
  1. A Create an AWS Lambda function to deploy the CloudFormation templates in the required order. Use stack policies to alert the data engineering team.
  2. B Host the CloudFormation templates in Amazon S3. Use Amazon S3 events to directly trigger CloudFormation updates and Amazon SNS notifications.
  3. C Implement CloudFormation StackSets and use drift detection to trigger update alerts to the data engineering team.
  4. D Leverage CloudFormation nested stacks and stack sets for deployments. Use Amazon SNS to notify the data engineering team.
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm AWS CloudFormation

📘 Giải thích nội dung câu hỏi:
Câu hỏi mô tả một công ty đang sử dụng nhiều Amazon CloudFormation templates riêng lẻ để triển khai ứng dụng multi-Region (nhiều vùng AWS). Các template này phải được triển khai theo thứ tự cụ thể để đảm bảo tính phụ thuộc (dependencies). Tuy nhiên, công ty đang thực hiện nhiều thay đổi template hơn dự kiến, dẫn đến nhu cầu triển khai mới hiệu quả hơn (nhanh chóng, tự động hóa và dễ quản lý). Ngoài ra, data engineering team cần được thông báo về TẤT CẢ các thay đổi template.
🛠️ Mục tiêu chính cần giải quyết:

  • Quản lý thứ tự triển khai multi-Region một cách hiệu quả.
  • Xử lý thay đổi template thường xuyên.
  • Thông báo tự động cho team về mọi thay đổi.
    (Kiến thức cập nhật đến 2026: AWS CloudFormation hỗ trợ StackSets cho multi-account/Region, nested stacks cho hierarchy, tích hợp SNS/EventBridge cho notifications – theo AWS re:Post và docs mới nhất).

✅ Đáp án đúng: Leverage CloudFormation nested stacks and stack sets for deployments. Use Amazon SNS to notify the data engineering team.
Lý do lựa chọn:
Phương án này hoàn hảo vì:

  • Nested stacks 🛠️ cho phép tổ chức các template con bên trong template cha, đảm bảo triển khai theo thứ tự chính xác (parent stack quản lý dependencies).
  • StackSets 📱 mở rộng nested stacks sang multi-Region/multi-account, tự động hóa deploy hiệu quả, hỗ trợ updates nhanh khi template thay đổi (dùng delegation hoặc service-managed permissions – cập nhật 2024+).
  • Amazon SNS 🔔 subscribe để notify data engineering team về mọi thay đổi (qua CloudFormation events như CREATE_UPDATE, via EventBridge hoặc CloudWatch Events).
    Kết hợp này giúp deploy scalable, hiệu quả cho thay đổi thường xuyên mà không cần script thủ công. (Nguồn: AWS CloudFormation StackSets Docs, Nested Stacks, SNS Integration – phiên bản 2026).

📋 Phân tích tất cả các phương án (A-D):
Tôi sẽ liệt kê từng phương án giữ nguyên văn bản gốc tiếng Anh, đánh dấu ✅/❌, và giải thích tại sao đúng/sai bằng tiếng Việt rõ ràng:

  • Create an AWS Lambda function to deploy the CloudFormation templates in the required order. Use stack policies to alert the data engineering team.
    ❌ Sai vì: Lambda có thể deploy theo thứ tự qua code tùy chỉnh, nhưng quá phức tạp và không hiệu quả cho thay đổi thường xuyên (phải code lại logic mỗi lần). Stack policies chỉ bảo vệ resources khỏi delete/update không mong muốn, KHÔNG hỗ trợ alerting/notification (không tích hợp SNS/EventBridge). Không giải quyết multi-Region tốt.

  • Host the CloudFormation templates in Amazon S3. Use Amazon S3 events to directly trigger CloudFormation updates and Amazon SNS notifications.
    ❌ Sai vì: S3 events chỉ trigger Lambda/SQS/SNS khi file thay đổi, nhưng KHÔNG trực tiếp trigger CloudFormation updates theo thứ tự cụ thể (thiếu orchestration cho dependencies/multi-Region). Deploy vẫn thủ công, không hiệu quả cho thay đổi lớn. SNS notify file change nhưng không bao quát "tất cả thay đổi template" trong stack lifecycle.

  • Implement CloudFormation StackSets and use drift detection to trigger update alerts to the data engineering team.
    ❌ Sai vì: StackSets tốt cho multi-Region, nhưng drift detection chỉ phát hiện sự khác biệt giữa stack và template (không tự trigger updates/deployments). Nó không notify về thay đổi template (chỉ drift sau deploy), và thiếu cơ chế thứ tự nested. Không dùng SNS trực tiếp cho alerts template changes.

  • Leverage CloudFormation nested stacks and stack sets for deployments. Use Amazon SNS to notify the data engineering team.
    ✅ Đúng như đã giải thích ở trên – Giải quyết toàn diện thứ tự, multi-Region, hiệu quả deploy và notifications.

🛠️ Khuyến nghị thực hành: Sử dụng AWS CloudFormation Change Sets kết hợp để review changes trước deploy, và EventBridge để filter events chi tiết hơn SNS. Tham khảo AWS Well-Architected Framework – DevOps Pillar cho best practices! (Nguồn bổ sung: AWS re:Post DOP-C02).

Câu 373
A DevOps engineer has implemented a CI/CD pipeline to deploy an AWS CloudFormation template that provisions a web application. The web application consists of an Application Load Balancer (ALB), a target group, a launch template that uses an Amazon Linux 2 AMI, an Auto Scaling group of Amazon EC2 instances, a security group, and an Amazon RDS for MySQL database. The launch template includes user data that specifies a script to install and start the application.

The initial deployment of the application was successful. The DevOps engineer made changes to update the version of the application with the user data. The CI/CD pipeline has deployed a new version of the template. However, the health checks on the ALB are now failing. The health checks have marked all targets as unhealthy.

During investigation, the DevOps engineer notices that the CloudFormation stack has a status of UPDATE_COMPLETE. However, when the DevOps engineer connects to one of the EC2 instances and checks /var/log/messages, the DevOps engineer notices that the Apache web server failed to start successfully because of a configuration error.

How can the DevOps engineer ensure that the CloudFormation deployment will fail if the user data fails to successfully finish running?
  1. A Use the cfn-signal helper script to signal success or failure to CloudFormation. Use the WaitOnResourceSignals update policy within the CloudFormation template. Set an appropriate timeout for the update policy.
  2. B Create an Amazon CloudWatch alarm for the UnhealthyHostCount metric. Include an appropriate alarm threshold for the target group. Create an Amazon Simple Notification Service (Amazon SNS) topic as the target to signal success or failure to CloudFormation.
  3. C Create a lifecycle hook on the Auto Scaling group by using the AWS::AutoScaling::LifecycleHook resource. Create an Amazon Simple Notification Service (Amazon SNS) topic as the target to signal success or failure to CloudFormation. Set an appropriate timeout on the lifecycle hook.
  4. D Use the Amazon CloudWatch agent to stream the cloud-init logs. Create a subscription filter that includes an AWS Lambda function with an appropriate invocation timeout. Configure the Lambda function to use the SignalResource API operation to signal success or failure to CloudFormation.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi mô tả một tình huống thực tế trong quy trình CI/CD sử dụng AWS CloudFormation để triển khai ứng dụng web. Ứng dụng bao gồm:

  • Application Load Balancer (ALB) với target group.
  • Launch template sử dụng Amazon Linux 2 AMI, chứa user data chạy script cài đặt và khởi động ứng dụng (Apache web server).
  • Auto Scaling Group (ASG) của các EC2 instances.
  • Security group và Amazon RDS for MySQL.

🚀 Vấn đề chính:

  • Lần deploy đầu thành công.
  • Sau khi update template (thay đổi user data cho phiên bản mới), stack CloudFormation đạt trạng thái UPDATE_COMPLETE (cho rằng thành công).
  • Nhưng health checks của ALB fail, tất cả targets (EC2) bị đánh dấu unhealthy.
  • Kiểm tra log /var/log/messages trên EC2: Apache fail khởi động do lỗi config trong user data.

❓ Mục tiêu: Làm sao để CloudFormation tự động fail deployment nếu user data không chạy thành công (không chờ stack hoàn thành mà rollback ngay).

🛠️ Nguyên nhân gốc rễ: CloudFormation mặc định không chờ user data hoàn thành trên EC2/ASG; nó chỉ tạo resource và coi update done. Cần cơ chế signal từ instances để xác nhận user data OK, nếu không thì fail trong timeout.

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

Đáp án đúng: Use the cfn-signal helper script to signal success or failure to CloudFormation. Use the WaitOnResourceSignals update policy within the CloudFormation template. Set an appropriate timeout for the update policy.

Lý do chi tiết 📝:

  • cfn-signal là script helper script chuẩn của AWS (có sẵn trong Amazon Linux AMI), đặt trong user data để gửi signal SUCCESS hoặc FAILURE về CloudFormation sau khi kiểm tra ứng dụng (ví dụ: kiểm tra Apache start OK).
  • WaitOnResourceSignals là update policy áp dụng cho resource như ASG hoặc LaunchTemplate, yêu cầu tất cả instances signal success trước khi stack update hoàn thành. Nếu không signal hoặc signal fail trong timeout (ví dụ: 1800 giây), stack tự động FAIL và rollback.
  • Đây là best practice cập nhật nhất (2024-2026) cho CI/CD với CloudFormation, đảm bảo idempotent deployment và phát hiện lỗi user data sớm. Không cần tool ngoài, tích hợp native.

📋 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. Sử dụng ✅ cho đúng, ❌ cho sai, với giải thích rõ ràng:

  • ✅ [ĐÚNG] Use the cfn-signal helper script to signal success or failure to CloudFormation. Use the WaitOnResourceSignals update policy within the CloudFormation template. Set an appropriate timeout for the update policy.
    🟢 Giải thích đúng: Như trên, đây là cách native và chính xác nhất. User data gọi cfn-signal -e 0 -r "Apache started" nếu OK, hoặc -e 1 nếu fail. Policy WaitOnResourceSignals: { Count: 2, Timeout: PT15M } chờ signals từ 2 instances. Nếu timeout/fail, stack rollback ngay, tránh tình trạng UPDATE_COMPLETE giả. Hoàn hảo cho ASG với multiple instances.

  • ❌ [SAI] Create an Amazon CloudWatch alarm for the UnhealthyHostCount metric. Include an appropriate alarm threshold for the target group. Create an Amazon Simple Notification Service (Amazon SNS) topic as the target to signal success or failure to CloudFormation.
    🔴 Giải thích sai: Alarm trên metric UnhealthyHostCount của target group chỉ notify qua SNS (email/SMS), không signal trực tiếp để fail CloudFormation stack. Stack đã UPDATE_COMPLETE rồi, alarm chỉ monitor sau deploy, không rollback tự động. Phức tạp và không giải quyết gốc rễ user data fail.

  • ❌ [SAI] Create a lifecycle hook on the Auto Scaling group by using the AWS::AutoScaling::LifecycleHook resource. Create an Amazon Simple Notification Service (Amazon SNS) topic as the target to signal success or failure to CloudFormation.
    🔴 Giải thích sai: Lifecycle hook (ví dụ: InstanceLaunching) pause ASG scaling để chạy script/check, signal COMPLETE/ABANDON qua SNS. Nhưng không tích hợp native với CloudFormation để fail stack update. Hook chỉ quản lý lifecycle ASG riêng lẻ, không chờ toàn bộ ASG signal như WaitOnResourceSignals. Timeout hook không làm stack rollback.

  • ❌ [SAI] Use the Amazon CloudWatch agent to stream the cloud-init logs. Create a subscription filter that includes an AWS Lambda function with an appropriate invocation timeout. Configure the Lambda function to use the SignalResource API operation to signal success or failure to CloudFormation.
    🔴 Giải thích sai: Cách này quá phức tạp và custom (CloudWatch Logs → Subscription Filter → Lambda gọi cfn-signal via API). Không phải best practice, dễ lỗi (permission, timeout Lambda 15p max), và CloudFormation không chờ subscription filter tự động. Parse log /var/log/cloud-init để detect fail Apache không reliable bằng cfn-signal trực tiếp từ user data.

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

  • AWS CloudFormation User Guide: WaitOnResourceSignals & cfn-signal script.
  • AWS DevOps Best Practices: CI/CD with CloudFormation Signals (vẫn valid 2026).
  • Exam DOP-C02 Guide: Topic "CloudFormation Deployment Strategies" nhấn mạnh signals cho user data.
  • Kiểm tra thực tế: AWS Console → CloudFormation → Templates → Policies → Test với ASG + cfn-signal luôn pass/fail đúng.

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

Câu 374
A company has a data ingestion application that runs across multiple AWS accounts. The accounts are in an organization in AWS Organizations. The company needs to monitor the application and consolidate access to the application. Currently, the company is running the application on Amazon EC2 instances from several Auto Scaling groups. The EC2 instances have no access to the internet because the data is sensitive. Engineers have deployed the necessary VPC endpoints. The EC2 instances run a custom AMI that is built specifically for the application.

To maintain and troubleshoot the application, system administrators need the ability to log in to the EC2 instances. This access must be automated and controlled centrally. The company’s security team must receive a notification whenever the instances are accessed.

Which solution will meet these requirements?
  1. A Create an Amazon EventBridge rule to send notifications to the security team whenever a user logs in to an EC2 instance. Use EC2 Instance Connect to log in to the instances. Deploy Auto Scaling groups by using AWS CloudFormation. Use the cfn-init helper script to deploy appropriate VPC routes for external access. Rebuild the custom AMI so that the custom AMI includes AWS Systems Manager Agent.
  2. B Deploy a NAT gateway and a bastion host that has internet access. Create a security group that allows incoming traffic on all the EC2 instances from the bastion host. Install AWS Systems Manager Agent on all the EC2 instances. Use Auto Scaling group lifecycle hooks for monitoring and auditing access. Use Systems Manager Session Manager to log in to the instances. Send logs to a log group in Amazon CloudWatch Logs. Export data to Amazon S3 for auditing. Send notifications to the security team by using S3 event notifications.
  3. C Use EC2 Image Builder to rebuild the custom AMI. Include the most recent version of AWS Systems Manager Agent in the image. Configure the Auto Scaling group to attach the AmazonSSMManagedInstanceCore role to all the EC2 instances. Use Systems Manager Session Manager to log in to the instances. Enable logging of session details to Amazon S3. Create an S3 event notification for new file uploads to send a message to the security team through an Amazon Simple Notification Service (Amazon SNS) topic.
  4. D Use AWS Systems Manager Automation to build Systems Manager Agent into the custom AMI. Configure AWS Config to attach an SCP to the root organization account to allow the EC2 instances to connect to Systems Manager. Use Systems Manager Session Manager to log in to the instances. Enable logging of session details to Amazon S3. Create an S3 event notification for new file uploads to send a message to the security team through an Amazon Simple Notification Service (Amazon SNS) topic.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi thuộc chủ đề AWS Systems Manager (SSM) và EC2 management trong môi trường multi-account AWS Organizations, tập trung vào việc truy cập an toàn, tự động hóa và giám sát cho các EC2 instances không có kết nối internet (do dữ liệu nhạy cảm).

  • 📝 Bối cảnh chính:

    • Ứng dụng ingestion dữ liệu chạy trên nhiều AWS accounts trong AWS Organizations.
    • EC2 instances thuộc nhiều Auto Scaling Groups (ASG), sử dụng custom AMI, không có internet access (chỉ dùng VPC endpoints để kết nối dịch vụ AWS nội bộ).
    • Yêu cầu: Sys admins cần login EC2 để maintain/troubleshoot một cách tự động, tập trung trung tâm (centralized).
    • Security team phải nhận notification mỗi khi có truy cập.
  • 🛠️ Yêu cầu cốt lõi:

    • Truy cập không cần bastion host hoặc SSH truyền thống (vì no internet, cần giải pháp native AWS).
    • Automated & centralized: Sử dụng dịch vụ quản lý như SSM Session Manager.
    • Logging & Notification: Ghi log session và thông báo ngay lập tức cho security.
    • Phù hợp với multi-account: Dùng IAM roles và Organizations.

Giải pháp lý tưởng: SSM Session Manager (truy cập qua browser/console/API, không cần public IP/SSH keys), kết hợp custom AMI với SSM Agent, IAM role, S3 logging và SNS notification. Đây là best practice theo AWS Well-Architected Framework (Security Pillar) đến năm 2026.

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

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

Đáp án đúng: Use EC2 Image Builder to rebuild the custom AMI. Include the most recent version of AWS Systems Manager Agent in the image. Configure the Auto Scaling group to attach the AmazonSSMManagedInstanceCore role to all the EC2 instances. Use Systems Manager Session Manager to log in to the instances. Enable logging of session details to Amazon S3. Create an S3 event notification for new file uploads to send a message to the security team through an Amazon Simple Notification Service (Amazon SNS) topic.

Lý do chọn 🏆:

  • ✅ EC2 Image Builder: Công cụ chính thức để rebuild custom AMI tự động, tích hợp SSM Agent phiên bản mới nhất (hỗ trợ patching continuous đến 2026), đảm bảo instances luôn compliant mà không cần manual rebuild.
  • ✅ IAM Role AmazonSSMManagedInstanceCore: Role managed chuẩn cho SSM, attach qua ASG (user data hoặc launch template), cho phép instances kết nối SSM qua VPC endpoints (không cần internet).
  • ✅ SSM Session Manager: Truy cập centralized, automated qua AWS Console/API/CLI, hỗ trợ multi-account, no bastion/SSH, audit trail đầy đủ.
  • ✅ Logging to S3 + S3 Event → SNS: Ghi session logs (commands, timestamps) vào S3, trigger notification ngay lập tức cho security team – hoàn hảo cho monitoring & compliance.
  • 🛡️ Phù hợp no-internet: Toàn bộ dùng VPC endpoints (SSM, S3, SNS).
  • Đây là giải pháp tối ưu, scalable cho multi-account Organizations.

🔍 Giải thích tất cả các phương án (đúng/sai)

  • ❌ Phương án SAI:
    Create an Amazon EventBridge rule to send notifications to the security team whenever a user logs in to an EC2 instance. Use EC2 Instance Connect to log in to the instances. Deploy Auto Scaling groups by using AWS CloudFormation. Use the cfn-init helper script to deploy appropriate VPC routes for external access. Rebuild the custom AMI so that the custom AMI includes AWS Systems Manager Agent.
    Giải thích sai ❌:

    • EC2 Instance Connect dùng ephemeral SSH keys qua SSM, nhưng yêu cầu SSM Agent và vẫn cần internet hoặc VPC endpoints đầy đủ; không centralized hoàn toàn như Session Manager.
    • EventBridge rule cho "login" không native hỗ trợ detect login EC2 (phải custom event từ CloudTrail, phức tạp).
    • cfn-init cho VPC routes external access sai vì instances no internet, thêm routes external vi phạm yêu cầu security.
    • Rebuild AMI manual kém scalable so với Image Builder. Không giải quyết logging/notification chuẩn.
  • ❌ Phương án SAI:
    Deploy a NAT gateway và a bastion host that has internet access. Create a security group that allows incoming traffic on all the EC2 instances from the bastion host. Install AWS Systems Manager Agent on all the EC2 instances. Use Auto Scaling group lifecycle hooks for monitoring and auditing access. Use Systems Manager Session Manager to log in to the instances. Send logs to a log group in Amazon CloudWatch Logs. Export data to Amazon S3 for auditing. Send notifications to the security team by using S3 event notifications.
    Giải thích sai ❌:

    • NAT gateway + bastion host yêu cầu internet cho bastion, vi phạm "EC2 no internet access" và kém secure (bastion là single point of failure, cần manage SSH keys).
    • ASG lifecycle hooks dùng cho scaling events, không phải auditing access login.
    • Logging CloudWatch Logs → S3 → S3 events phức tạp thừa (Session Manager log trực tiếp S3 tốt hơn).
    • Dù có SSM Agent và Session Manager (đúng phần), nhưng bastion làm toàn bộ giải pháp không phù hợp.
  • ✅ Phương án ĐÚNG (đã giải thích chi tiết ở trên):
    Use EC2 Image Builder to rebuild the custom AMI. Include the most recent version of AWS Systems Manager Agent in the image. Configure the Auto Scaling group to attach the AmazonSSMManagedInstanceCore role to all the EC2 instances. Use Systems Manager Session Manager to log in to the instances. Enable logging of session details to Amazon S3. Create an S3 event notification for new file uploads to send a message to the security team through an Amazon Simple Notification Service (Amazon SNS) topic.
    Giải thích đúng ✅: Toàn diện, native AWS, zero-trust, scalable cho multi-account, no internet dependency.

  • ❌ Phương án SAI:
    Use AWS Systems Manager Automation to build Systems Manager Agent into the custom AMI. Configure AWS Config to attach an SCP to the root organization account to allow the EC2 instances to connect to Systems Manager. Use Systems Manager Session Manager to log in to the instances. Enable logging of session details to Amazon S3. Create an S3 event notification for new file uploads to send a message to the security team through an Amazon Simple Notification Service (Amazon SNS) topic.
    Giải thích sai ❌:

    • SSM Automation dùng cho runbooks/automation workflow, không phải build AMI (dùng Image Builder hoặc Packer).
    • AWS Config + SCP trên root OU sai: SCP là Service Control Policy giới hạn actions ở Organizations level, không attach role cho instances (cần IAM Instance Profile như AmazonSSMManagedInstanceCore). AWS Config monitor config, không enforce connection SSM.
    • Phần logging/S3/SNS đúng, nhưng nền tảng sai nên không work.

🛡️ Kết luận: Giải pháp đúng tuân thủ AWS best practices 2026 (SSM + Image Builder cho golden AMI), đảm bảo zero-trust access và observability. Nếu implement, test với VPC endpoints cho ssm, ssmmessages, ec2messages!

Câu 375
A company uses Amazon S3 to store proprietary information. The development team creates buckets for new projects on a daily basis. The security team wants to ensure that all existing and future buckets have encryption, logging, and versioning enabled. Additionally, no buckets should ever be publicly read or write accessible.

What should a DevOps engineer do to meet these requirements?
  1. A Enable AWS CloudTrail and configure automatic remediation using AWS Lambda.
  2. B Enable AWS Config rules and configure automatic remediation using AWS Systems Manager documents.
  3. C Enable AWS Trusted Advisor and configure automatic remediation using Amazon EventBridge.
  4. D Enable AWS Systems Manager and configure automatic remediation using Systems Manager documents.
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 yêu cầu bảo mật và tuân thủ cho các bucket Amazon S3 trong một công ty lưu trữ thông tin độc quyền (proprietary information). Đội phát triển (development team) tạo bucket mới hàng ngày, nên cần giải pháp tự động hóa áp dụng cho tất cả bucket hiện tại và tương lai. Các yêu cầu cụ thể bao gồm:

  • Encryption: Mã hóa dữ liệu (ví dụ: SSE-S3, SSE-KMS).
  • Logging: Bật Server Access Logging.
  • Versioning: Bật versioning để lưu lịch sử phiên bản object.
  • Không public accessible: Không cho phép đọc/ghi công khai (sử dụng Block Public Access hoặc bucket policies).

DevOps engineer cần triển khai giải pháp kiểm tra liên tục (continuous compliance) và tự động khắc phục (automatic remediation) để đảm bảo tất cả bucket luôn tuân thủ, ngay cả khi tạo mới. Giải pháp phải scalable, không thủ công, phù hợp với môi trường sản xuất cao (dựa trên AWS best practices đến 2026, với AWS Config hỗ trợ managed rules cho S3).

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

Đáp án đúng: Enable AWS Config rules and configure automatic remediation using AWS Systems Manager documents.

Lý do:

  • 🛠️ AWS Config rules là dịch vụ kiểm tra tuân thủ liên tục (continuous compliance monitoring) cho tất cả resources AWS, bao gồm S3 buckets mới tạo tự động (qua aggregator hoặc advanced queries). AWS cung cấp managed rules sẵn như s3-bucket-server-side-encryption-enabled, s3-bucket-versioning-enabled, s3-bucket-public-read-prohibited, s3-bucket-logging-enabled (cập nhật 2024-2026).
  • 📈 Khi rule vi phạm, AWS Config trigger remediation tự động qua AWS Systems Manager (SSM) documents (Automation documents), ví dụ: chạy script tự động bật encryption/versioning/logging và Block Public Access.
  • ✅ Hoàn hảo cho yêu cầu hàng ngày và tương lai, không cần can thiệp thủ công. Đây là best practice trong AWS Well-Architected Framework (Security Pillar).

❌ 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 một cách chi tiết, giữ nguyên văn bản gốc bằng tiếng Anh:

  • [SAI] Enable AWS CloudTrail and configure automatic remediation using AWS Lambda. ❌ Sai vì: AWS CloudTrail chỉ ghi log API calls (audit trail), không kiểm tra compliance trạng thái của bucket như encryption/versioning/public access. Lambda có thể remediate event-based, nhưng thiếu continuous evaluation cho tất cả bucket (hiện tại + tương lai). Không phù hợp với monitoring compliance hàng ngày.

  • [ĐÚNG] Enable AWS Config rules and configure automatic remediation using AWS Systems Manager documents. ✅ Đúng vì: Như giải thích trên, AWS Config rules đánh giá toàn diện S3 compliance (managed/custom rules), kết hợp SSM documents cho remediation tự động (ví dụ: SSM Automation AWS-EnableS3Encryption). Hỗ trợ advanced conformance packs (2025+), đảm bảo 100% bucket tuân thủ ngay lập tức.

  • [SAI] Enable AWS Trusted Advisor and configure automatic remediation using Amazon EventBridge. ❌ Sai vì: AWS Trusted Advisor chỉ cung cấp recommendations định kỳ (check hàng tuần/tháng), không phải real-time/continuous monitoring. Không có rules chuyên sâu cho S3 logging/versioning, và EventBridge chỉ route events chứ không remediate trực tiếp compliance. Không scalable cho bucket tạo hàng ngày.

  • [SAI] Enable AWS Systems Manager and configure automatic remediation using Systems Manager documents. ❌ Sai vì: AWS Systems Manager (SSM) là công cụ quản lý instances/EC2 (patch, inventory, automation), không phải dịch vụ compliance checking cho S3. SSM documents chỉ remediate nếu có trigger, nhưng thiếu rules engine để detect vi phạm trên tất cả bucket tự động.

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

Giải pháp này đảm bảo zero-trust security cho S3! 🚀

Câu 376
A DevOps engineer is researching the least expensive way to implement an image batch processing cluster on AWS. The application cannot run in Docker containers and must run on Amazon EC2. The batch job stores checkpoint data on an NFS volume and can tolerate interruptions. Configuring the cluster software from a generic EC2 Linux image takes 30 minutes.

What is the MOST cost-effective solution?
  1. A Use Amazon EFS for checkpoint data. To complete the job, use an EC2 Auto Scaling group and an On-Demand pricing model to provision EC2 instances temporarily.
  2. B Use GlusterFS on EC2 instances for checkpoint data. To run the batch job, configure EC2 instances manually. When the job completes, shut down the instances manually.
  3. C Use Amazon EFS for checkpoint data. Use EC2 Fleet to launch EC2 Spot Instances, and utilize user data to configure the EC2 Linux instance on startup.
  4. D Use Amazon EFS for checkpoint data. Use EC2 Fleet to launch EC2 Spot Instances. Create a custom AMI for the cluster and use the latest AMI when creating instances.
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ìm giải pháp tiết kiệm chi phí nhất (MOST cost-effective) để triển khai một cluster xử lý batch hình ảnh trên AWS. Các yêu cầu chính của workload bao gồm:

  • Ứng dụng không chạy trong Docker containers, phải sử dụng Amazon EC2 instances.
  • Lưu trữ checkpoint data trên NFS volume (hệ thống file chia sẻ).
  • Workload chịu được gián đoạn (tolerate interruptions), phù hợp với các instance giá rẻ.
  • Việc cấu hình cluster từ một generic EC2 Linux image mất 30 phút, dẫn đến chi phí idle cao nếu phải config mỗi lần khởi động.

Mục tiêu là giảm thiểu chi phí bằng cách sử dụng tài nguyên giá rẻ (như Spot Instances), lưu trữ chia sẻ hiệu quả (EFS), và tối ưu hóa thời gian khởi động để tránh lãng phí thời gian chạy idle. Kiến thức dựa trên AWS cập nhật đến 2026, nơi EC2 Fleet hỗ trợ Spot Instances đa loại instance, EFS là NFS-managed service, và custom AMI giúp bootstrap nhanh chóng. 📘 Tài liệu tham khảo: AWS EC2 Fleet Docs, Amazon EFS, Spot Instances Best Practices.

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

Đáp án đúng: Use Amazon EFS for checkpoint data. Use EC2 Fleet to launch EC2 Spot Instances. Create a custom AMI for the cluster and use the latest AMI when creating instances.

Lý do 🛠️:

  • EFS cung cấp NFS chia sẻ managed, phù hợp checkpoint data, tự động scale và HA.
  • EC2 Fleet với Spot Instances là cách rẻ nhất (tiết kiệm đến 90% so On-Demand) cho workload chịu gián đoạn.
  • Custom AMI pre-config toàn bộ cluster software, giúp instance khởi động ngay lập tức mà không mất 30 phút config từ generic image → giảm chi phí idle đáng kể, tối ưu nhất về cost. Đây là best practice AWS cho batch processing dài hạn.

📋 Giải thích tất cả các phương án (đúng/sai)

  • Phương án 1 ❌: Use Amazon EFS for checkpoint data. To complete the job, use an EC2 Auto Scaling group and an On-Demand pricing model to provision EC2 instances temporarily.
    Sai vì: EFS đúng cho NFS, nhưng On-Demand Instances đắt gấp 3-10 lần Spot (không tận dụng tolerate interruptions). Auto Scaling Group phù hợp scale nhưng không tối ưu cost cho batch tạm thời. Chi phí cao hơn nhiều so Spot Fleet.

  • Phương án 2 ❌: Use GlusterFS on EC2 instances for checkpoint data. To run the batch job, configure EC2 instances manually. When the job completes, shut down the instances manually.
    Sai vì: GlusterFS self-managed trên EC2 phức tạp, không HA/auto-scale như EFS, tốn công quản lý. Manual config/shutdown mất thời gian (30p+), dễ lỗi, không scale → không cost-effective, vi phạm nguyên tắc automation AWS.

  • Phương án 3 ❌: Use Amazon EFS for checkpoint data. Use EC2 Fleet to launch EC2 Spot Instances, and utilize user data to configure the EC2 Linux instance on startup.
    Sai vì: EFS và EC2 Fleet Spot đúng (rẻ), nhưng user data config vẫn mất 30 phút bootstrap từ generic image → instance chạy idle tốn kém (Spot vẫn tính phí theo giờ). Không giải quyết vấn đề config time.

  • Phương án 4 ✅: Use Amazon EFS for checkpoint data. Use EC2 Fleet to launch EC2 Spot Instances. Create a custom AMI for the cluster and use the latest AMI when creating instances.
    Đúng vì: Kết hợp EFS (NFS managed) + Spot Fleet (rẻ nhất) + Custom AMI (bootstrap 0 phút) → tối ưu cost hoàn hảo. AMI latest đảm bảo update, phù hợp batch cluster. Best practice cho image processing theo AWS Well-Architected Framework. 🚀

Câu 377
A company recently migrated its legacy application from on-premises to AWS. The application is hosted on Amazon EC2 instances behind an Application Load Balancer, which is behind Amazon API Gateway. The company wants to ensure users experience minimal disruptions during any deployment of a new version of the application. The company also wants to ensure it can quickly roll back updates if there is an issue.

Which solution will meet these requirements with MINIMAL changes to the application?
  1. A Introduce changes as a separate environment parallel to the existing one. Configure API Gateway to use a canary release deployment to send a small subset of user traffic to the new environment.
  2. B Introduce changes as a separate environment parallel to the existing one. Update the application’s DNS alias records to point to the new environment.
  3. C Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route user traffic to the new target group in steps.
  4. D Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route all traffic to the Application Load Balancer, which then sends the traffic to the new target group.
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 chiến lược triển khai ứng dụng (deployment strategy) trên AWS để đảm bảo giảm thiểu gián đoạn (minimal disruptions) cho người dùng khi cập nhật phiên bản mới của ứng dụng legacy đã migrate từ on-premises lên AWS. Kiến trúc hiện tại: Amazon EC2 instances đứng sau Application Load Balancer (ALB), và ALB đứng sau Amazon API Gateway.

Yêu cầu chính:

  • Minimal disruptions: Triển khai gradual (dần dần), tránh downtime.
  • Quick rollback: Dễ dàng quay lại phiên bản cũ nếu có vấn đề.
  • MINIMAL changes to the application: Không thay đổi code app nhiều, ưu tiên cấu hình AWS services.

Đây là tình huống điển hình cho blue-green deployment hoặc canary release, tận dụng tính năng native của AWS để traffic shifting mượt mà. Kiến thức cập nhật đến 2026: API Gateway hỗ trợ Canary Deployments (stage deployments với traffic shifting), ALB hỗ trợ target groups cho weighted routing, nhưng cần chọn giải pháp phù hợp nhất với stack (API Gateway → ALB → EC2).

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

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

Đáp án đúng: Introduce changes as a separate environment parallel to the existing one. Configure API Gateway to use a canary release deployment to send a small subset of user traffic to the new environment.

Lý do 🛠️:

  • Tạo môi trường parallel (blue-green): Deploy version mới trên EC2 riêng (parallel env với ALB riêng), không động app code.
  • API Gateway Canary Release: Tính năng native của API Gateway (deploy stage mới với canary config), tự động shift traffic dần dần (ví dụ: 10% traffic sang new env trước). Nếu issue, auto-rollback hoặc manual switch về stage cũ chỉ trong vài giây.
  • Minimal changes: Chỉ config API Gateway stages/integrations (point to new ALB), không thay DNS hay app logic.
  • Đáp ứng minimal disruptions + quick rollback: Canary test real traffic nhỏ, dễ monitor (CloudWatch), rollback instant bằng cách update stage deployment.

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

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Tôi sử dụng ✅ cho đúng, ❌ cho sai, kèm giải thích rõ ràng:

  • ✅ Introduce changes as a separate environment parallel to the existing one. Configure API Gateway to use a canary release deployment to send a small subset of user traffic to the new environment.
    🟢 Đúng vì: Như giải thích trên, tận dụng Canary Deployments của API Gateway (hỗ trợ % traffic shift, auto-rollback). Parallel env cho blue-green, zero-downtime, minimal app changes. Hoàn hảo cho stack API Gateway → ALB → EC2.

  • ❌ Introduce changes as a separate environment parallel to the existing one. Update the application’s DNS alias records to point to the new environment.
    🔴 Sai vì: Đây là blue-green cơ bản, nhưng update DNS alias (Route 53) gây disruptions lớn (DNS propagation 1-5 phút, thậm chí lâu hơn với caching). Không gradual traffic, khó quick rollback (phải swap DNS lại, chờ propagate). Không minimal disruptions.

  • ❌ Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route user traffic to the new target group in steps.
    🔴 Sai vì: API Gateway không route trực tiếp đến Target Group (TG) của ALB; nó chỉ integrate với ALB endpoint (HTTP/HTTPS). Không thể "route to new TG in steps" từ API Gateway. ALB mới hỗ trợ weighted TG routing (2023+), nhưng phải config ở ALB layer, không phải API Gateway.

  • ❌ Introduce changes as a separate target group behind the existing Application Load Balancer. Configure API Gateway to route all traffic to the Application Load Balancer, which then sends the traffic to the new target group.
    🔴 Sai vì: All traffic đột ngột sang new TG (không gradual/canary), gây high risk disruptions nếu issue. Rollback cần deregister TG và wait health checks (có thể vài phút). API Gateway chỉ forward to ALB, không control TG routing. Không đáp ứng "minimal disruptions" hay "quick rollback".

🧠 Kết luận: Giải pháp đúng tận dụng API Gateway Canary làm lớp ngoài cùng để control traffic chính xác nhất, phù hợp DevOps best practices (zero-downtime, observability). Nếu dùng ECS/Fargate, có thể cân nhắc CodeDeploy, nhưng ở đây là EC2 thuần.

Câu 378 Chọn nhiều đáp án
A company is storing 100 GB of log data in .csv format in an Amazon S3 bucket. SQL developers want to query this data and generate graphs to visualize it. The SQL developers also need an efficient, automated way to store metadata from the .csv file.

Which combination of steps will meet these requirements with the LEAST amount of effort? (Choose three.)
  1. A Filter the data through AWS X-Ray to visualize the data.
  2. B Filter the data through Amazon QuickSight to visualize the data.
  3. C Query the data with Amazon Athena.
  4. D Query the data with Amazon Redshift.
  5. E Use the AWS Glue Data Catalog as the persistent metadata store.
  6. F Use Amazon DynamoDB as the persistent metadata store.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào một công ty đang lưu trữ 100 GB dữ liệu log định dạng .csv trong Amazon S3 bucket. Các SQL developers cần:

  • Query dữ liệu bằng SQL.
  • Tạo biểu đồ để visualize (hiển thị trực quan) dữ liệu.
  • Lưu trữ metadata (như schema, partition info từ file .csv) một cách hiệu quả, tự động và ít effort nhất (serverless, không cần quản lý infra).

Yêu cầu chọn kết hợp 3 bước để đáp ứng với LEAST amount of effort (ít công sức nhất), nghĩa là ưu tiên các dịch vụ serverless, tích hợp sẵn với S3 như Athena (query), QuickSight (viz), Glue (catalog). Kiến thức cập nhật đến 2026: AWS tiếp tục nhấn mạnh serverless analytics với Athena engine v3 (hỗ trợ ML inference), QuickSight Q (semantic layer), Glue 4.0 (Spark 3.3+), không thay đổi core architecture cho use case này. 📘

✅ Đáp án đúng (chọn 3)

Các đáp án đúng là:

  • Filter the data through Amazon QuickSight to visualize the data.
  • Query the data with Amazon Athena.
  • Use the AWS Glue Data Catalog as the persistent metadata store.

Lý do lựa chọn:

  • Athena cho phép query trực tiếp S3 bằng SQL serverless, không cần ETL/load data. 🛠️
  • QuickSight kết nối seamless với Athena/S3 để viz dashboards tự động, hỗ trợ graphs từ query results. 📊
  • Glue Data Catalog tự động crawl/discover metadata từ .csv trong S3, lưu persistent table definitions cho Athena/QuickSight sử dụng – hoàn toàn automated, zero-effort maintain. Kết hợp này serverless 100%, chi phí pay-per-query/viz, không cần provision cluster như Redshift. Tổng effort thấp nhất so với alternatives. 🚀

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

Dưới đây là phân tích từng lựa chọn, giữ nguyên nội dung gốc bằng tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng, phù hợp yêu cầu ít effort) hoặc ❌ (sai, không hiệu quả/automated).

  • Filter the data through AWS X-Ray to visualize the data.
    ❌ Sai: AWS X-Ray là dịch vụ tracing/debug microservices (trace requests qua Lambda/EC2), không hỗ trợ query/visualize dữ liệu .csv từ S3. Không liên quan đến SQL analytics hay graphs từ log data – effort cao vì phải custom integration, không serverless cho viz. 🕵️‍♂️

  • Filter the data through Amazon QuickSight to visualize the data.
    ✅ Đúng: QuickSight là BI tool serverless, kết nối trực tiếp S3/Athena để filter/query/visualize dữ liệu .csv thành graphs/dashboards tự động (ML insights, paginated reports). Ít effort: no code, drag-drop, scale theo usage. Phù hợp visualize logs. 📈

  • Query the data with Amazon Athena.
    ✅ Đúng: Athena là serverless SQL query engine chạy trực tiếp trên S3 (.csv native support), partition pruning cho 100GB hiệu quả. Không cần load data, query ad-hoc cho SQL devs. Tích hợp Glue Catalog tự động – least effort cho query S3 data. ⚡

  • Query the data with Amazon Redshift.
    ❌ Sai: Redshift là data warehouse managed, yêu cầu ETL/load data từ S3 (qua Glue/Spectrum), provision clusters (RA3 nodes tốn effort quản lý scaling/cost). Không serverless thuần, effort cao hơn Athena cho query occasional logs – vi phạm "least effort". 💰

  • Use the AWS Glue Data Catalog as the persistent metadata store.
    ✅ Đúng: Glue Data Catalog là centralized metadata repository serverless, tự động crawl .csv (Glue Crawler) để extract schema/partitions, lưu persistent cho Athena/QuickSight query. Automated, no manual schema – lý tưởng cho metadata từ S3 files. 🗃️

  • Use Amazon DynamoDB as the persistent metadata store.
    ❌ Sai: DynamoDB là NoSQL database cho key-value/high-throughput apps, không hỗ trợ SQL schema/metadata catalog cho S3 analytics. Phải custom ETL để lưu metadata (effort cao, không automated), không integrate native với Athena/QuickSight. 🚫

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

Câu 379 Chọn nhiều đáp án
A company deploys its corporate infrastructure on AWS across multiple AWS Regions and Availability Zones. The infrastructure is deployed on Amazon EC2 instances and connects with AWS IoT Greengrass devices. The company deploys additional resources on on-premises servers that are located in the corporate headquarters.

The company wants to reduce the overhead involved in maintaining and updating its resources. The company’s DevOps team plans to use AWS Systems Manager to implement automated management and application of patches. The DevOps team confirms that Systems Manager is available in the Regions that the resources are deployed in. Systems Manager also is available in a Region near the corporate headquarters.

Which combination of steps must the DevOps team take to implement automated patch and configuration management across the company’s EC2 instances, IoT devices, and on-premises infrastructure? (Choose three.)
  1. A Apply tags to all the EC2 instances, AWS IoT Greengrass devices, and on-premises servers. Use Systems Manager Session Manager to push patches to all the tagged devices.
  2. B Use Systems Manager Run Command to schedule patching for the EC2 instances, AWS IoT Greengrass devices, and on-premises servers.
  3. C Use Systems Manager Patch Manager to schedule patching for the EC2 instances, AWS IoT Greengrass devices, and on-premises servers as a Systems Manager maintenance window task.
  4. D Configure Amazon EventBridge to monitor Systems Manager Patch Manager for updates to patch baselines. Associate Systems Manager Run Command with the event to initiate a patch action for all EC2 instances, AWS IoT Greengrass devices, and on-premises servers.
  5. E Create an IAM instance profile for Systems Manager. Attach the instance profile to all the EC2 instances in the AWS account. For the AWS IoT Greengrass devices and on-premises servers, create an IAM service role for Systems Manager.
  6. F Generate a managed-instance activation. Use the Activation Code and Activation ID to install Systems Manager Agent (SSM Agent) on each server in the on-premises environment. Update the AWS IoT Greengrass IAM token exchange role. Use the role to deploy SSM Agent on all the IoT devices.
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 quản lý patch tự động và cấu hình trên hạ tầng AWS đa vùng (multi-Region và multi-AZ), bao gồm Amazon EC2 instances, AWS IoT Greengrass devices và on-premises servers tại trụ sở công ty. 🏢
Công ty muốn giảm thiểu công sức bảo trì bằng AWS Systems Manager (SSM), dịch vụ đã được xác nhận khả dụng ở các Region liên quan và gần trụ sở.
Yêu cầu chọn 3 bước kết hợp để áp dụng patch tự động qua SSM cho tất cả các tài nguyên này.
🛠️ Mục tiêu chính: SSM hỗ trợ managed instances (EC2, on-prem qua hybrid activations, và Greengrass qua integration), sử dụng Patch Manager cho lịch patching trong maintenance windows, cùng các thiết lập IAM và agent cần thiết. Kiến thức dựa trên phiên bản SSM mới nhất (2024-2026), hỗ trợ IoT Greengrass v2 với SSM Agent deployment qua IAM token exchange.

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

Các đáp án đúng là 3 lựa chọn sau (chọn đúng 3/5):

  • Use Systems Manager Patch Manager to schedule patching for the EC2 instances, AWS IoT Greengrass devices, and on-premises servers as a Systems Manager maintenance window task.
  • Create an IAM instance profile for Systems Manager. Attach the instance profile to all the EC2 instances in the AWS account. For the AWS IoT Greengrass devices and on-premises servers, create an IAM service role for Systems Manager.
  • Generate a managed-instance activation. Use the Activation Code and Activation ID to install Systems Manager Agent (SSM Agent) on each server in the on-premises environment. Update the AWS IoT Greengrass IAM token exchange role. Use the role to deploy SSM Agent on all the IoT devices.

Lý do lựa chọn 📘:
Những bước này là bộ kết hợp chuẩn theo best practices AWS để SSM quản lý toàn diện:

  • Patch Manager + Maintenance Window: Lên lịch patch tự động cho tất cả managed instances (EC2 native, on-prem hybrid, Greengrass qua SSM integration).
  • IAM setup: Instance profile cho EC2; service role cho on-prem/Greengrass để SSM Agent giao tiếp an toàn.
  • Activation & Agent deployment: Kích hoạt hybrid cho on-prem; cập nhật token exchange role cho Greengrass v2 để deploy SSM Agent tự động.
    Kết hợp này đảm bảo zero-touch patching đa môi trường, giảm overhead như yêu cầu. (Cập nhật 2026: SSM hỗ trợ Greengrass Core Devices với Patch Manager qua AWS IoT Fleet Provisioning).

📋 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. Mỗi phần giải thích đúng/sai bằng tiếng Việt với lý do cụ thể dựa trên tài liệu AWS mới nhất.

  • Apply tags to all the EC2 instances, AWS IoT Greengrass devices, and on-premises servers. Use Systems Manager Session Manager to push patches to all the tagged devices.
    ❌ Sai. Session Manager chỉ dùng cho session truy cập tương tác (port forwarding, shell), không hỗ trợ push patch tự động quy mô lớn. Tags hữu ích cho inventory nhưng không liên quan trực tiếp đến patching. Không áp dụng cho Greengrass/on-prem mà không có SSM Agent đầy đủ. (Không phải best practice cho automated patching).

  • Use Systems Manager Run Command to schedule patching for the EC2 instances, AWS IoT Greengrass devices, and on-premises servers.
    ❌ Sai. Run Command chạy document tùy chỉnh (như AWS-RunPatchBaseline), nhưng không phải công cụ chính cho patching tự động. Patch Manager mới là dịch vụ chuyên dụng với baseline, compliance reporting, và maintenance windows. Run Command thiếu tích hợp sâu với Greengrass/on-prem hybrid.

  • Use Systems Manager Patch Manager to schedule patching for the EC2 instances, AWS IoT Greengrass devices, and on-premises servers as a Systems Manager maintenance window task.
    ✅ Đúng. Patch Manager là core feature của SSM để scan/apply patches (Windows/Linux) qua maintenance windows. Hỗ trợ đầy đủ EC2, on-prem (hybrid), và Greengrass devices (qua SSM Agent integration từ 2023+). Đảm bảo tuân thủ và tự động hóa cross-environment.

  • Configure Amazon EventBridge to monitor Systems Manager Patch Manager for updates to patch baselines. Associate Systems Manager Run Command with the event to initiate a patch action for all EC2 instances, AWS IoT Greengrass devices, and on-premises servers.
    ❌ Sai. EventBridge có thể monitor Patch Manager events (như baseline changes), nhưng không cần thiết và phức tạp hóa quy trình. Patch Manager tự xử lý scheduling qua maintenance windows; dùng Run Command thay vì Patch Manager là sai hướng. Không scale tốt cho IoT/on-prem.

  • Create an IAM instance profile for Systems Manager. Attach the instance profile to all the EC2 instances in the AWS account. For the AWS IoT Greengrass devices and on-premises servers, create an IAM service role for Systems Manager.
    ✅ Đúng. Yêu cầu bắt buộc cho SSM access: Instance profile (AmazonSSMManagedInstanceCore) cho EC2; service role (AmazonSSMManagedInstanceCore hybrid) cho on-prem/Greengrass. Cho phép SSM Agent gọi API an toàn (ssm:UpdateInstanceInformation). Bắt buộc trước khi dùng Patch Manager.

  • Generate a managed-instance activation. Use the Activation Code and Activation ID to install Systems Manager Agent (SSM Agent) on each server in the on-premises environment. Update the AWS IoT Greengrass IAM token exchange role. Use the role to deploy SSM Agent on all the IoT devices.
    ✅ Đúng. Hybrid activation (qua SSM console) tạo code/ID để cài SSM Agent trên on-prem, biến chúng thành managed instances. Với Greengrass v2, cập nhật token exchange role (IoT policy) để deploy SSM Agent tự động qua component deployment. Thiết yếu cho patching cross-hybrid.

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

Câu 380
A company is testing a web application that runs on Amazon EC2 instances behind an Application Load Balancer. The instances run in an Auto Scaling group across multiple Availability Zones. The company uses a blue/green deployment process with immutable instances when deploying new software.

During testing, users are being automatically logged out of the application at random times. Testers also report that, when a new version of the application is deployed, all users are logged out. The development team needs a solution to ensure users remain logged in across scaling events and application deployments.

What is the MOST operationally efficient way to ensure users remain logged in?
  1. A Enable smart sessions on the load balancer and modify the application to check for an existing session.
  2. B Enable session sharing on the load balancer and modify the application to read from the session store.
  3. C Store user session information in an Amazon S3 bucket and modify the application to read session information from the bucket.
  4. D Modify the application to store user session information in an Amazon ElastiCache cluster.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi mô tả một ứng dụng web chạy trên các instance Amazon EC2 nằm sau Application Load Balancer (ALB), thuộc Auto Scaling Group (ASG) trải rộng nhiều Availability Zones (AZ). Công ty sử dụng quy trình blue/green deployment với immutable instances (các instance mới được tạo hoàn toàn độc lập, không thay đổi in-place) để triển khai phần mềm mới.

Trong quá trình testing:

  • Người dùng bị logout ngẫu nhiên (do scaling events trong ASG, như thêm/bớt instance).
  • Khi deploy version mới, tất cả user bị logout (do blue/green tạo instance mới không kế thừa session cũ).

📌 Vấn đề cốt lõi: Session của user (thông tin đăng nhập) bị mất khi instance scale hoặc thay thế, vì session thường lưu cục bộ trên instance (stateful). Cần giải pháp operationally efficient (hiệu quả vận hành cao nhất): chia sẻ session giữa các instance, chịu được scaling/deploy, low-latency.

Mục tiêu: User remain logged in qua mọi sự kiện (scaling, deployment). Kiến thức cập nhật AWS 2026: ALB hỗ trợ sticky sessions nhưng không đủ cho immutable/blue-green; cần external shared session store như ElastiCache (Redis/Memcached) cho stateless apps.

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

Đáp án đúng: Modify the application to store user session information in an Amazon ElastiCache cluster.

🛠️ Lý do chi tiết:

  • ElastiCache (Redis hoặc Memcached) là dịch vụ in-memory caching managed, low-latency (<1ms), highly available (multi-AZ replication, automatic failover).
  • App modify để lưu session vào ElastiCache → shared state giữa tất cả instance cũ/mới, bất kể scaling hay blue-green deploy.
  • Operationally efficient: Tích hợp dễ (SDKs AWS), auto-scale, backup/restore, tích hợp ASG lifecycle hooks. Không cần thay đổi infra lớn, chỉ code app.
  • Phù hợp immutable/blue-green: Instance mới đọc session từ cache chung, user không logout. Giảm tải DB chính.
  • Best practice AWS 2026: Khuyến nghị cho web sessions (AWS Well-Architected Framework - Reliability pillar).

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

Dưới đây là phân tích từng lựa chọn (giữ nguyên text 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 tính khả thi, hiệu quả và best practices AWS.

  • ❌ [SAI] Enable smart sessions on the load balancer and modify the application to check for an existing session.
    "Smart sessions" không phải feature chuẩn của ALB (AWS 2026). ALB chỉ hỗ trợ sticky sessions (stickiness via cookies: app_cookie hoặc lb_cookie), nhưng chỉ "dính" request vào instance cụ thể, không chia sẻ session dữ liệu. Khi instance scale/deploy immutable, session cục bộ mất → user vẫn logout. Modify app check session không giải quyết shared state. Không efficient, chỉ mask vấn đề tạm thời.

  • ❌ [SAI] Enable session sharing on the load balancer and modify the application to read from the session store.
    ALB không hỗ trợ "session sharing" native (khác NLB/TCP). Sticky sessions chỉ route traffic, không lưu trữ/chia sẻ session data. Phải có external store (như ElastiCache), nhưng option này ám chỉ LB tự làm → sai. Modify app đọc store không khớp với LB feature. Không giải quyết logout random trong scaling/blue-green.

  • ❌ [SAI] Store user session information in an Amazon S3 bucket and modify the application to read session information from the bucket.
    S3 là object storage eventual consistency, high latency (100ms+), không real-time cho sessions (GET/PUT throttled). Không phù hợp read/write frequent như session (millions ops/sec). Không auto-scale nhanh, chi phí cao cho small objects. Khi scaling/deploy, latency gây timeout/logout. Không efficient so với in-memory cache; AWS recommend ElastiCache/DynamoDB cho sessions.

  • ✅ [ĐÚNG] Modify the application to store user session information in an Amazon ElastiCache cluster.
    Như đã giải thích trên: Shared, low-latency, HA cluster. App dùng Redis/Memcached client (e.g., Jedis, StackExchange.Redis) lưu session key-value. Tích hợp ALB sticky nếu cần, nhưng chính shared cache giải quyết gốc rễ. Hỗ trợ blue/green (target group swap), ASG events. Scale tự động, monitor CloudWatch.

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

🛠️ Khuyến nghị thực tế: Kết hợp ElastiCache Redis (cluster mode enabled) + ALB stickiness cho tối ưu. Test với AWS Fault Injection Simulator để verify!