Ngân hàng đề — AWS Certified SysOps Administrator Associate
Tìm thấy 936 câu.
Which solution will meet these requirements?
- A Add a procstat monitoring configuration to the CloudWatch agent for the process. Create an Amazon EventBridge event rule that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
- B Add a StatsD monitoring configuration to the CloudWatch agent for the process. Create a CloudWatch alarm that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
- C Add a StatsD monitoring configuration to the CloudWatch agent for the process. Create an Amazon EventBridge event rule that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
- D Add a procstat monitoring configuration to the CloudWatch agent for the process. Create a CloudWatch alarm that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
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 một SysOps administrator giám sát một process (tiến trình) chạy trên các Amazon EC2 instances Linux. Khi process dừng (stops), hệ thống phải tự động khởi động lại (restart) process đó. Amazon CloudWatch agent đã được cài đặt sẵn trên tất cả các EC2 instances.
🛠️ Yêu cầu chính:
- Sử dụng CloudWatch agent để monitor process.
- Phát hiện khi process dừng và trigger action restart tự động qua AWS Systems Manager (SSM) Automation runbook.
- Giải pháp phải scalable cho nhiều EC2 instances (vì "all the EC2 instances"), nghĩa là chỉ restart trên instance bị ảnh hưởng, không ảnh hưởng các instance khác.
📈 Bối cảnh AWS (cập nhật 2026): CloudWatch agent hỗ trợ các plugin như procstat (monitor process-specific metrics như số threads, CPU/memory usage) và StatsD (cho custom app metrics qua protocol StatsD). Metrics từ agent được gửi đến CloudWatch Metrics. Để auto-remediate, dùng CloudWatch alarm hoặc EventBridge kết hợp SSM Automation (chạy script restart process, ví dụsystemctl restart myprocess).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
Add a procstat monitoring configuration to the CloudWatch agent for the process. Create an Amazon EventBridge event rule that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
Lý do 🏆:
- Procstat là plugin chính xác để monitor process trên Linux EC2 (thu thập metrics như
procstat_num_threads,procstat_cpu_utilization). Khi process stops, metrics giảm về 0 (ví dụ: num_threads = 0), cho phép detect sự cố. - Tạo CloudWatch alarm ngầm định (không ghi rõ nhưng cần thiết) trên metric procstat (ví dụ: alarm khi
num_threads < 1). Alarm state change (ALARM) sẽ emit event vào EventBridge (source:aws.cloudwatch). - EventBridge event rule match pattern event (dựa trên alarm name, dimensions như
InstanceId,procname), sau đó invoke SSM Automation runbook với input động InstanceId cụ thể → chỉ restart process trên EC2 instance bị ảnh hưởng. - Scalable cho nhiều instances: Không cần tạo alarm riêng từng instance; một alarm tổng hợp (sử dụng SEARCH expression '{CWAgent/procstat} num_threads AVG<1') trigger event chứa chi tiết instance → EventBridge xử lý dynamic targeting. Không delay lớn, tự động.
✅ Hoàn hảo cho SysOps best practice (monitor → detect → remediate tự động).
📋 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 text gốc). Mỗi phương án sai đều có lý do cụ thể dựa trên limitation của công cụ AWS.
-
✅ Add a procstat monitoring configuration to the CloudWatch agent for the process. Create an Amazon EventBridge event rule that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
Đúng vì: Procstat monitor process chính xác → metric detect stop → alarm emit event → EventBridge rule target instance cụ thể qua event details (dimensions.InstanceId) → SSM restart chỉ trên instance lỗi. Scalable, no false restart trên instances khác. (Như giải thích trên). -
❌ Add a StatsD monitoring configuration to the CloudWatch agent for the process. Create a CloudWatch alarm that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
Sai vì: StatsD chỉ dùng cho app emit custom metrics qua UDP protocol (như counters/gauges từ code), KHÔNG monitor process status (không track num_threads hay process alive/dead). Alarm trên StatsD metrics không detect được process stop. SSM action cũng fail vì không target đúng (static targets, restart nhầm instances khác). -
❌ Add a StatsD monitoring configuration to the CloudWatch agent for the process. Create an Amazon EventBridge event rule that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
Sai vì: StatsD không phù hợp monitor process (như trên). EventBridge cần event source đáng tin cậy (từ alarm trên procstat metrics), nhưng StatsD không tạo metric detect process stop → rule không trigger đúng. Vô dụng. -
❌ Add a procstat monitoring configuration to the CloudWatch agent for the process. Create a CloudWatch alarm that initiates an AWS Systems Manager Automation runbook to restart the process after the process stops.
Sai vì: Procstat đúng cho monitor, nhưng CloudWatch alarm direct SSM action KHÔNG scalable cho nhiều instances. Alarm action SSM yêu cầu targets static (tag hoặc InstanceId list cố định lúc tạo alarm). Với "all EC2 instances", alarm tổng hợp trigger → SSM chạy trên TẤT CẢ instances (restart nhầm), hoặc phải tạo alarm riêng từng instance (không feasible). EventBridge mới dynamic từ event data.
📘 Tài liệu tham khảo (AWS docs cập nhật 2026)
- CloudWatch agent procstat config: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Procstat-Configuration.html (metrics như num_threads detect process stop).
- CloudWatch alarm SSM actions (limitation static targets): https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmActions_SSM.html.
- EventBridge for CloudWatch alarm events: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatch-Alarms-EventBridge.html (event detail chứa dimensions.InstanceId cho dynamic targeting).
- SSM Automation example (restart process): https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-ec2-restart.html (custom runbook cho Linux process).
- Exam guide: AWS Certified DevOps Engineer - Professional (DOP-C02) & SysOps (SOA-C02), phần Monitoring & Automation (2024-2026, no major changes).
What should a SysOps administrator do to reduce the downtime of the application during failover?
- A Create an RDS for MariaDB DB cluster that has multiple writer instances. Configure the application to retry failed queries on another primary node during maintenance events.
- B Configure the RDS maintenance window settings to pool connections while a failover is in process.
- C Configure an Amazon ElastiCache write-through cache for the database. Configure the application to connect to the cache instead of directly to the database.
- D Create an RDS proxy that is associated with the database. Configure the application to connect to the proxy instead of directly to the database.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi tập trung vào vấn đề downtime (thời gian gián đoạn) của ứng dụng khi sử dụng Amazon RDS for MariaDB Multi-AZ.
- Tình huống: Ứng dụng kết nối trực tiếp với RDS MariaDB Multi-AZ (cấu hình có standby replica để đảm bảo high availability). Mỗi khi xảy ra failover (chuyển đổi primary instance) trong sự kiện planned maintenance (bảo trì có kế hoạch), ứng dụng bị unavailable (không khả dụng) trong vài phút.
- Nguyên nhân chính: Khi failover, endpoint của primary instance thay đổi (từ instance gốc sang standby), dẫn đến các kết nối TCP hiện tại bị ngắt. Ứng dụng phải reconnect (kết nối lại), thường mất thời gian do timeout, retry logic chưa tối ưu, và pool connection bị drain.
- Mục tiêu: Giảm thiểu downtime bằng cách xử lý failover mượt mà hơn, đặc biệt trong maintenance window (cửa sổ bảo trì, thường 30-60 phút, có thể lên đến 2 giờ theo AWS best practices đến 2026).
- Bối cảnh AWS cập nhật 2026: RDS Multi-AZ DB instances (synchronous replication) vẫn cần giải pháp connection management để giảm failover time từ ~60-120 giây xuống dưới 60 giây. RDS Proxy là giải pháp chính thức được khuyến nghị (ra mắt 2020, cải tiến liên tục với hỗ trợ MariaDB đến version 10.6+).
📘 Tài liệu tham khảo:
- AWS RDS Proxy Documentation: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html (cập nhật 2025-2026).
- RDS Multi-AZ Failover Best Practices: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Replicate.html#USER_Replicate.Failover.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create an RDS proxy that is associated with the database. Configure the application to connect to the proxy instead of directly to the database.
Lý do chi tiết 🛠️:
- RDS Proxy là dịch vụ connection pooling và multiplexing chuyên dụng cho RDS (hỗ trợ MariaDB Multi-AZ). Nó giữ nguyên kết nối với database backend, tự động xử lý failover bằng cách chuyển hướng traffic đến instance mới mà không làm gián đoạn client connections.
- Lợi ích giảm downtime:
- Connection multiplexing: Hàng nghìn client chia sẻ ít kết nối backend → Giảm overhead.
- Failover handling: Proxy detect failover trong <60 giây, retry transactions tự động với IAM auth và secrets rotation.
- Trong maintenance: Ứng dụng connect qua proxy endpoint (ổn định), tránh reconnect thủ công → Downtime giảm từ phút xuống giây.
- Cập nhật 2026: RDS Proxy hỗ trợ global databases, Aurora Serverless v2 integration, và observability với CloudWatch Enhanced Metrics (CPU, connections).
❌ Phân tích tất cả các phương án (đúng/sai)
-
Phương án A (SAI):
Create an RDS for MariaDB DB cluster that has multiple writer instances. Configure the application to retry failed queries on another primary node during maintenance events.
Giải thích sai: ❌ RDS for MariaDB không hỗ trợ Multi-AZ DB cluster với multiple writer instances (chỉ có ở Aurora MySQL/MariaDB với cluster endpoints). MariaDB Multi-AZ chỉ có một writer primary + standby reader. Việc retry thủ công phức tạp, không tự động, và không giảm downtime failover (vẫn mất phút để detect + switch). -
Phương án B (SAI):
Configure the RDS maintenance window settings to pool connections while a failover is in process.
Giải thích sai: ❌ Maintenance window chỉ scheduling bảo trì (ví dụ: 30 phút hàng tuần), không có tính năng pool connections. Pooling phải làm ở client-side (như PgBouncer) hoặc RDS Proxy. Cấu hình window không ảnh hưởng đến failover connection handling. -
Phương án C (SAI):
Configure an Amazon ElastiCache write-through cache for the database. Configure the application to connect to the cache instead of directly to the database.
Giải thích sai: ❌ ElastiCache write-through dùng cho caching read-heavy workloads (sync write cache + DB), không giải quyết failover RDS. Cache vẫn cần connect DB, và nếu DB failover, cache invalidation/rebuild gây thêm latency. Không phù hợp cho transactional apps cần consistency cao (MariaDB OLTP). -
Phương án D (ĐÚNG):
Create an RDS proxy that is associated with the database. Configure the application to connect to the proxy instead of directly to the database.
Giải thích đúng: ✅ Như đã phân tích ở trên, RDS Proxy là giải pháp chuẩn AWS cho vấn đề này, giảm downtime >90% trong failover/maintenance. Ứng dụng chỉ cần đổi connection string sang proxy target.
🛠️ Khuyến nghị triển khai thêm: Sử dụng RDS Proxy với IAM database authentication và application retry logic (exponential backoff). Test failover qua AWS Console hoặc CLI: aws rds failover-db-cluster. Chi phí Proxy ~0.015$/connection-hour (2026 pricing).
Which services or features can the administrator use to investigate where the requests are coming from? (Choose two.)
- A AWS CloudTrail data events
- B Amazon EventBridge
- C AWS Health Dashboard
- D Amazon S3 server access logging
- E AWS Trusted Advisor
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 tình huống một SysOps administrator phát hiện hàng triệu yêu cầu LIST (cụ thể là các API calls như ListObjects hoặc ListBuckets) trên một Amazon S3 bucket. Mục tiêu là điều tra nguồn gốc các yêu cầu này đến từ đâu (ví dụ: IP address, user agent, principal ID, v.v.).
LIST requests thường là các lệnh liệt kê objects trong bucket, có thể do công cụ scan, bot, hoặc ứng dụng không tối ưu gây ra, dẫn đến chi phí cao và hiệu suất kém. Administrator cần các services hoặc features ghi log chi tiết về nguồn gốc request (who, where, how). Câu hỏi yêu cầu chọn TWO lựa chọn phù hợp nhất từ AWS services/features để investigate (điều tra).
🛠️ Bối cảnh AWS cập nhật đến 2026: S3 Server Access Logging và CloudTrail Data Events vẫn là các công cụ chính cho auditing S3 requests (không thay đổi lớn từ 2023-2026). Chúng cung cấp dữ liệu granular về requests mà không cần agent.
✅ Đáp án đúng (Chọn TWO)
Hai lựa chọn đúng là:
AWS CloudTrail data events và Amazon S3 server access logging.
Lý do lựa chọn:
- Những tính năng này ghi log chi tiết các S3 requests, bao gồm LIST operations, với thông tin nguồn gốc như requester IP, user agent, ARN của principal, bucket name, request time, giúp trace chính xác "requests coming from where".
- Chúng là công cụ chuẩn cho troubleshooting S3 access patterns theo AWS Well-Architected Framework (Operations Pillar). ✅
📋 Giải thích tất cả các phương án (Đúng/Sai)
Dưới đây là phân tích từng lựa chọn một cách chi tiết. Tôi giữ nguyên văn bản gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với lý do đúng/sai dựa trên chức năng thực tế:
-
✅ [ĐÚNG] AWS CloudTrail data events
Đây là lựa chọn đúng vì CloudTrail Data Events (khi enable cho S3) ghi lại chi tiết các API calls nhưListBuckethoặcListObjects(LIST requests). Log bao gồm principal ID, IP address, user agent, request parameters, lưu trong S3 và có thể query qua Athena. Hoàn hảo để investigate nguồn gốc. (Enable qua CloudTrail console > Data events > S3). -
❌ [SAI] Amazon EventBridge
Sai vì EventBridge là event bus để route events từ AWS services (như S3 events: ObjectCreated, ObjectAccessed), nhưng không ghi log chi tiết LIST requests hay nguồn gốc IP/user agent. Nó chỉ forward events reactive, không phải auditing tool. -
❌ [SAI] AWS Health Dashboard
Sai vì Health Dashboard chỉ cung cấp thông báo về health issues của AWS services (như outage S3), không trace individual requests hay nguồn gốc LIST calls. Không liên quan đến request-level logging. -
✅ [ĐÚNG] Amazon S3 server access logging
Đúng vì S3 Server Access Logging (enable trên bucket) ghi log tất cả requests (bao gồm LIST) vào một bucket khác, với fields như bucket owner, requester IP, request URI (LIST), user agent, referrer. Dễ analyze bằng Athena/QuickSight để tìm nguồn gốc chính xác. (Standard feature, no cost ngoài storage). -
❌ [SAI] AWS Trusted Advisor
Sai vì Trusted Advisor đưa recommendations về cost/security/performance (ví dụ: S3 bucket public), nhưng không cung cấp logs chi tiết requests hay trace nguồn LIST calls. Nó chỉ check best practices, không phải investigation tool.
📘 Tài liệu tham khảo (AWS Official - Cập nhật 2026)
- S3 Server Access Logging: docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html – Chi tiết fields log LIST requests.
- CloudTrail Data Events for S3: docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#data-events-s3 – Hướng dẫn enable và sample events.
- AWS Well-Architected: Operations Pillar – Logging & Monitoring (framework truy cập tại wellarchitected.com).
🛠️ Mẹo thực hành: Để optimize, kết hợp cả hai + Athena query logs. Enable ngay để tránh chi phí LIST cao! Nếu cần script automation, dùng CDK/Terraform. 🚀
Which of the following is a possible reason for the difference in traffic?
- A CloudWatch Logs throttling has been applied.
- B The CloudWatch IAM role does not have a trust relationship with the VPC flow logs service.
- C The VPC flow log is still in the process of being created.
- D VPC flow logs cannot capture traffic from on-premises servers to a VPC.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh tình huống một SysOps administrator đã cấu hình VPC Flow Logs để publish dữ liệu lên Amazon CloudWatch Logs. Khi kiểm tra logs trong CloudWatch Logs, admin nhận thấy lượng traffic ít hơn mong đợi. Sau khi so sánh với logs captured on-premises (logs được thu thập tại hệ thống on-premises), admin nghi ngờ rằng VPC Flow Logs bị không đầy đủ (incomplete).
Mục tiêu câu hỏi: Xác định lý do có thể gây ra sự khác biệt về lượng traffic giữa VPC Flow Logs (trong AWS) và logs on-premises.
- VPC Flow Logs là tính năng ghi lại thông tin về IP traffic đi qua network interfaces (ENI) trong VPC, bao gồm accepted/rejected flows, giúp troubleshoot network issues 🛠️.
- Logs on-premises thường là packet capture (như tcpdump/Wireshark) trên server on-premises, ghi lại traffic ngay từ nguồn phát.
- Sự khác biệt "less traffic" ngụ ý VPC chỉ thấy một phần traffic, trong khi on-premises thấy đầy đủ hơn → liên quan đến phạm vi capture của VPC Flow Logs (chỉ trong VPC).
Kiến thức AWS cập nhật (2024-2026): VPC Flow Logs hỗ trợ publish đến CloudWatch Logs, S3, Kinesis Data Firehose; có thể enable trên ENI, subnet, VPC. Không capture broadcast/multicast traffic, và chỉ log flows qua interfaces được monitor. Không có thay đổi lớn về capture scope từ re:Post hoặc docs mới nhất.
📘 Tài liệu tham khảo:
- AWS VPC Flow Logs User Guide
- What is captured?
- AWS re:Post & Exam DOP-C02 sample questions.
✅ Đáp án đúng
VPC flow logs cannot capture traffic from on-premises servers to a VPC.
Lý do chọn: VPC Flow Logs chỉ capture traffic liên quan đến network interfaces (ENI, VGW interfaces) bên trong VPC, không capture traffic originated (bắt nguồn) từ on-premises servers.
- Logs on-premises (packet capture trên server on-prem) ghi lại toàn bộ traffic gửi đi từ server đó đến VPC (kể cả packets bị drop trong transit qua VPN/Direct Connect).
- VPC Flow Logs chỉ ghi khi traffic thực sự đến/qua VPC interfaces (ví dụ: inbound đến EC2 ENI). Nếu packet loss ở giữa (route issues, ACLs, firewall on-prem/VPN), VPC không thấy → lượng traffic ít hơn.
- Đây là lý do cốt lõi gây difference in traffic volumes, phù hợp scenario "less than expected" sau comparison 🧩.
❌ Phân tích tất cả các phương án
Dưới đây là giải thích từng phương án một cách chi tiết, với nội dung gốc giữ nguyên tiếng Anh:
• [SAI] CloudWatch Logs throttling has been applied.
❌ Sai vì: CloudWatch Logs có rate limits (PutLogEvents ~5,000 req/s/account, burst-enabled), nhưng VPC Flow Logs publish asynchronously và batched qua service-linked role, ít bị throttle trực tiếp. Nếu throttle, sẽ có errors/metrics (DroppedLogEvents) trong CW, không phải "less traffic" silent. Không giải thích so sánh với on-premises logs.
• [SAI] The CloudWatch IAM role does not have a trust relationship with the VPC flow logs service.
❌ Sai vì: Nếu IAM role thiếu trust policy (cho vpc-flow-logs.amazonaws.com), publish sẽ fail hoàn toàn (status: ERROR trong DescribeFlowLogs), không có logs nào trong CW. Scenario cho thấy có logs ("reviews the logs... notices less traffic"), nên không phải lý do incomplete do config sai.
• [SAI] The VPC flow log is still in the process of being created.
❌ Sai vì: Khi Flow Log ở trạng thái PENDING (creating ~1-2 phút), không có logs nào được generate/publish. Sau khi ACTIVE, logs bắt đầu đầy đủ. Scenario ngụ ý đã có logs để review và so sánh, không phải zero logs.
• [ĐÚNG] VPC flow logs cannot capture traffic from on-premises servers to a VPC.
✅ Đúng vì: Như giải thích trên, VPC Flow Logs không capture traffic nguồn gốc từ ngoài VPC (on-premises servers không có ENI trong VPC). Chỉ capture khi flow qua VPC boundaries/interfaces. On-premises logs thấy outgoing attempts, VPC chỉ thấy arrivals → incomplete view tự nhiên, gây difference 🛠️.
The SysOps administrator uses the Active Directory Domain Users group for permissions to the new account because all users are already members of the group. When users try to log in, their access is denied.
Which action will resolve this access issue?
- A Create a new group. Add users to the new group to provide access.
- B Correct the time on the Active Directory domain controllers.
- C Remove the account. Re-add the account to the organization that is integrated with IAM Identity Center.
- D Correct the permissions on the Active Directory group so that IAM Identity Center has read access.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống một SysOps administrator của công ty sử dụng AWS IAM Identity Center (trước đây gọi là AWS SSO) để kết nối với Active Directory (AD). Admin đã tạo một AWS account mới mà tất cả người dùng công ty cần truy cập. Để cấp quyền, admin sử dụng nhóm Active Directory Domain Users (nhóm mặc định chứa tất cả users trong domain) để gán permissions cho account mới này, vì mọi user đã là thành viên của nhóm. Tuy nhiên, khi users thử login, họ bị deny access (từ chối truy cập).
Vấn đề cốt lõi 📌: IAM Identity Center tích hợp với AD thông qua directory integration (thường dùng SAML 2.0 hoặc SCIM cho provisioning). Khi gán permission sets đến các groups từ AD cho một AWS account cụ thể, hệ thống không hỗ trợ sử dụng built-in groups như Domain Users. Nhóm này là nhóm hệ thống đặc biệt trong AD, có thể thay đổi động và không được IAM Identity Center nhận diện đúng cách cho mapping permissions. Kết quả là users không được cấp quyền thực tế dù là thành viên.
Mục tiêu: Tìm hành động resolve access issue (giải quyết vấn đề truy cập) một cách hiệu quả nhất, dựa trên best practices AWS mới nhất (IAM Identity Center version 2023-2026 hỗ trợ enhanced AD sync nhưng vẫn yêu cầu custom groups).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a new group. Add users to the new group to provide access.
Lý do 🛠️:
- IAM Identity Center yêu cầu sử dụng custom groups (nhóm tự tạo) trong AD để map với permission sets cho AWS accounts. Built-in groups như Domain Users không được hỗ trợ vì chúng là protected groups (không thể modify đầy đủ và sync không ổn định).
- Tạo nhóm mới, thêm users vào đó, rồi assign permission set đến nhóm này sẽ sync đúng qua IAM Identity Center, cấp quyền truy cập account mới cho tất cả users cần thiết.
- Đây là giải pháp root cause (giải quyết tận gốc), nhanh chóng và tuân thủ AWS best practices (tránh dùng built-in groups để quản lý quyền granular).
❌ Giải thích tất cả các phương án (đúng/sai)
-
Create a new group. Add users to the new group to provide access.
✅ Đúng (như đã giải thích ở trên). Phương án này trực tiếp khắc phục hạn chế của built-in groups, đảm bảo sync permissions mượt mà từ AD sang IAM Identity Center. -
Correct the time on the Active Directory domain controllers.
❌ Sai. Việc đồng bộ thời gian trên AD DCs chỉ liên quan đến Kerberos authentication (cần time skew <5 phút). Issue ở đây là group mapping permissions, không phải auth failure do time. Sửa time không ảnh hưởng đến việc Domain Users bị ignore bởi IAM Identity Center. -
Remove the account. Re-add the account to the organization that is integrated with IAM Identity Center.
❌ Sai. Xóa và tạo lại AWS account chỉ reset account metadata, nhưng không giải quyết vấn đề group mapping. Permission set vẫn gắn với Domain Users, dẫn đến deny access lặp lại. Đây là hành động thừa thãi và có thể gây downtime. -
Correct the permissions on the Active Directory group so that IAM Identity Center has read access.
❌ Sai. IAM Identity Center đã có quyền read groups qua service account khi setup integration (thường dùng delegated permissions). Vấn đề không phải read access mà là built-in group không eligible cho assignment. Sửa ACL trên Domain Users không thay đổi hành vi sync của AWS.
📘 Tài liệu tham khảo (AWS cập nhật đến 2026)
- AWS Documentation: IAM Identity Center with Active Directory – Phần "Limitations" chỉ rõ: "Built-in Active Directory groups such as Domain Users are not supported for permission assignments."
- AWS Best Practices Guide: Manage Access with Permission Sets – Khuyến nghị dùng custom groups cho granular control.
- Release Notes 2023-2026: Enhanced SCIM provisioning nhưng vẫn giữ limit built-in groups (xem AWS What's New).
Giải pháp này đảm bảo zero-downtime và scalable cho enterprise! 🚀
Which AWS service or feature will meet these requirements?
- A S3 bucket ACL
- B AWS Firewall Manager
- C Amazon Route 53 private hosted zone
- D Origin access identity (OAI)
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả tình huống một SysOps administrator đang quản lý một website tĩnh trên Amazon S3 (S3 static website hosting) và muốn hạn chế truy cập chỉ qua một Amazon CloudFront distribution duy nhất. Mục tiêu chính là ngăn chặn người dùng truy cập trực tiếp vào S3 bucket (qua URL S3 public endpoint), tránh tình trạng "bypass" CloudFront. Điều này đảm bảo traffic luôn đi qua CloudFront để tận dụng các tính năng như caching, DDoS protection, WAF, v.v., đồng thời tăng bảo mật bằng cách làm S3 bucket private.
Yêu cầu kỹ thuật cốt lõi:
- S3 bucket phải block public access trực tiếp nhưng vẫn cho phép CloudFront fetch nội dung.
- Không cho phép người dùng "circumvent" (lách qua) bằng cách dùng S3 website URL.
- Đây là best practice cho private content distribution qua CloudFront với S3 origin.
📘 Kiến thức cập nhật đến 2026: AWS khuyến nghị sử dụng Origin Access Control (OAC) thay thế Origin Access Identity (OAI) từ năm 2022 (vẫn hỗ trợ legacy OAI). OAC linh hoạt hơn, hỗ trợ IAM policy thay vì OAI user. Tuy nhiên, câu hỏi tập trung vào OAI như giải pháp chuẩn (vẫn valid). Xem docs: AWS CloudFront Private S3 Content.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Origin access identity (OAI)
🛠️ Lý do: OAI là tính năng của CloudFront tạo một IAM-like identity đặc biệt (virtual user) để CloudFront ký yêu cầu truy cập S3 bucket. Quy trình:
- Tạo OAI trong CloudFront console/CLI.
- Attach OAI vào distribution (Origin Settings).
- Cập nhật S3 bucket policy để DENY all public access và ALLOW chỉ từ OAI cụ thể (dùng
aws:SourceArnmatching CloudFront distribution ARN).
Kết quả: S3 bucket private hoàn toàn, chỉ CloudFront fetch được nội dung → người dùng chỉ truy cập qua CloudFront URL. Hoàn hảo cho yêu cầu "restrict to single distribution" và "no direct S3 access".
✅ Ưu điểm: Granular control, zero-cost, tích hợp native.
📋 Giải thích tất cả các phương án (đúng/sai)
Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc:
-
S3 bucket ACL ❌
Sai vì: ACL (Access Control List) là cơ chế cũ, coarse-grained (chỉ Public/Authenticated/Private), không hỗ trợ granular policy cho CloudFront OAI/OAC. ACL không block được direct S3 access một cách chính xác khi kết hợp CloudFront; dễ bị bypass nếu bucket public. AWS khuyến nghị dùng Bucket Policy + Block Public Access thay ACL từ 2018. Không meet yêu cầu "single CloudFront". -
AWS Firewall Manager ❌
Sai vì: Firewall Manager dùng để centralized management WAF/Network Firewall policies multi-account/OU, không trực tiếp control S3 access từ CloudFront. Nó hỗ trợ WAF trên CloudFront nhưng không restrict origin access (S3 bucket policy level). Phức tạp, overkill và không giải quyết core issue "no direct S3 view". -
Amazon Route 53 private hosted zone ❌
Sai vì: Private hosted zone chỉ resolve DNS internal (VPC-only), không control HTTP/HTTPS access đến S3 public endpoint. S3 website dùng public DNS (.s3-website-), Route 53 private không block được public traffic hoặc enforce CloudFront proxy. Không liên quan đến origin access control. -
Origin access identity (OAI) ✅
Đúng vì: Như giải thích trên, đây là giải pháp chuẩn AWS cho S3 + CloudFront private content. Bucket policy ví dụ:{ "Statement": [{ "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E123ABC"}, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::bucket/*" }] }Cập nhật 2026: Migrate sang OAC cho policy-based (hỗ trợ more actions).
🛡️ Best practice thêm: Kết hợp S3 Block Public Access (enabled), CloudFront với HTTPS-only, và WAF rules nếu cần. Test bằng curl direct S3 → 403 Forbidden!
📘 Tài liệu tham khảo:
- AWS Docs: Restrict Access to S3 from CloudFront
- OAC vs OAI Comparison
- AWS Well-Architected Framework: Security Pillar (Reliability/Operational Excellence).
Which policy should the SysOps administrator apply to meet this requirement?
-
A
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": "*", "Condition": { "Bool": { "aws:MultiFactorAuthPresent": "true" } } } ] }
-
B
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": "*" } ] }
-
C
{ "Version": "2012-10-17", "Statement": [ { "Effect": "NotAction", "Action": [ "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": "*", "Condition": {"Bool": {"aws:MultiFactorAuthPresent": "true"}} } ] }
-
D
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "ec2:StopInstances", "ec2:TerminateInstances" ], "Resource": "*", "Condition": {"StringNotEqualsIfExists": {"PrincipalServiceName": "ec2.amazonaws.com"}} } ] }
Xem giải thích
📘 Phân tích câu hỏi
Câu hỏi yêu cầu một SysOps administrator áp dụng một chính sách (policy) trên AWS để đảm bảo rằng chỉ khi người dùng được xác thực bằng thiết bị đa yếu tố (multi-factor authentication - MFA) thì mới có thể dừng (stop) hoặc chấm dứt (terminate) các instance Amazon EC2.
🔍 Giải thích các phương án
Phương án 1: ĐÚNG
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource": "*",
"Condition": {
"Bool": {
"aws:MultiFactorAuthPresent": "true"
}
}
}
]
}
✅ Lý do đúng: Chính sách này cho phép thực hiện hành động ec2:StopInstances và ec2:TerminateInstances trên tất cả các tài nguyên ("Resource": "*") với điều kiện người dùng phải được xác thực bằng MFA ("aws:MultiFactorAuthPresent": "true"). Điều nàyตรง với yêu cầu của công ty.
Phương án 2: SAI
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource": "*"
}
]
}
❌ Lý do sai: Chính sách này cho phép thực hiện hành động ec2:StopInstances và ec2:TerminateInstances trên tất cả các tài nguyên mà không có điều kiện xác thực MFA. Điều này khôngตรง với yêu cầu của công ty.
Phương án 3: SAI
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "NotAction",
"Action": [
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource": "*",
"Condition": {"Bool": {"aws:MultiFactorAuthPresent": "true"}}
}
]
}
❌ Lý do sai: Thứ nhất, không có Effect gọi là NotAction trong chính sách IAM. Thứ hai, ngay cả khi sử dụng Deny thay vì NotAction, thì điều kiện aws:MultiFactorAuthPresent yêu cầu phải đúng ("true"), nghĩa là chỉ khi người dùng đã xác thực bằng MFA thì hành động mới bị từ chối, điều này ngược lại với yêu cầu.
Phương án 4: SAI
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource": "*",
"Condition": {"StringNotEqualsIfExists": {"PrincipalServiceName": "ec2.amazonaws.com"}}
}
]
}
❌ Lý do sai: Chính sách này từ chối các hành động nếu dịch vụ không phải là ec2.amazonaws.com, điều này không liên quan đến yêu cầu xác thực MFA. Hơn nữa, điều kiện này không đảm bảo rằng người dùng phải xác thực bằng MFA trước khi thực hiện hành động.
📚 Tài liệu tham khảo
- AWS Documentation: IAM Policies
- AWS Documentation: Condition Types
✅ Kết luận
Phương án 1 là chính sách đúng để đáp ứng yêu cầu của công ty về việc xác thực bằng MFA trước khi dừng hoặc chấm dứt các instance Amazon EC2.
Videos that users upload from locations that are distant from us-east-1 have slower upload speeds than videos that users upload from close to us-east-1. In many cases, the slow uploads cause users from the distant locations to cancel their uploads.
Which solution will improve the upload speeds for the users from distant locations?
- A Enable S3 Transfer Acceleration on the S3 bucket. Change the mobile app to use the S3 Transfer Acceleration endpoint for uploads.
- B Create an S3 access point for the S3 bucket in several AWS Regions across the world. Change the mobile app to use the S3 access point endpoint for uploads.
-
C
Use S3 Select on the S3 bucket. Change the mobile app to use the S3 Select global endpoint for uploads.
D. Create new public Network Load Balancers (NLBs) in several AWS Regions across the world. Specify the S3 bucket as the target of the NLBs. Change the mobile app to use the closest NLB for uploads.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một công ty toàn cầu muốn cho phép bất kỳ ai trên thế giới upload video từ điện thoại di động lên một Amazon S3 bucket nằm ở vùng us-east-1. Ứng dụng mobile upload trực tiếp qua internet công cộng vào bucket này.
Vấn đề chính: Upload từ các vị trí xa us-east-1 (như châu Á, châu Âu) bị chậm do độ trễ mạng cao, dẫn đến người dùng hủy upload.
Mục tiêu: Tìm giải pháp cải thiện tốc độ upload cho người dùng ở xa, tận dụng đặc tính toàn cầu của AWS để giảm độ trễ mà không thay đổi vị trí bucket (vẫn giữ ở us-east-1).
✅ Đây là tình huống kinh điển về tối ưu hóa upload S3 từ xa, tập trung vào các tính năng acceleration của AWS (cập nhật đến 2026: S3 Transfer Acceleration vẫn là giải pháp chuẩn cho upload global với edge network).
✅ Đáp án đúng: A
Enable S3 Transfer Acceleration on the S3 bucket. Change the mobile app to use the S3 Transfer Acceleration endpoint for uploads.
Lý do chọn:
🛠️ S3 Transfer Acceleration kích hoạt sử dụng mạng AWS Edge Locations (tương tự CloudFront) để route traffic upload từ người dùng xa → edge gần nhất → S3 bucket ở us-east-1 qua AWS backbone network (tốc độ cao, độ trễ thấp).
📈 Kết quả: Tăng tốc upload lên đến 50-500% cho traffic quốc tế (dựa trên test AWS 2024-2026). Ứng dụng chỉ cần chuyển sang endpoint acceleration (ví dụ: bucketname.s3-accelerate.amazonaws.com).
🧩 Hoàn hảo vì không di chuyển dữ liệu, giữ bucket gốc, và hỗ trợ public upload toàn cầu. Đây là best practice cho mobile app upload video lớn.
📋 Giải thích tất cả các phương án (đúng/sai)
Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá dựa trên tài liệu AWS mới nhất (2026).
-
A. Enable S3 Transfer Acceleration on the S3 bucket. Change the mobile app to use the S3 Transfer Acceleration endpoint for uploads.
✅ ĐÚNG (như đã giải thích ở trên). Giải pháp tối ưu, chi phí thấp (chỉ tính phí data transfer qua acceleration), dễ implement qua SDK mobile (AWS SDK v3+ hỗ trợ tự động). -
B. Create an S3 access point for the S3 bucket in several AWS Regions across the world. Change the mobile app to use the S3 access point endpoint for uploads.
❌ SAI. S3 Access Points (ra mắt 2020, cập nhật 2026) dùng để quản lý access policy và alias endpoint cho bucket, nhưng chỉ regional (không multi-region tự động). Access Point không tăng tốc upload toàn cầu vì vẫn route qua public internet đến bucket gốc ở us-east-1. Tạo Access Point ở nhiều region vẫn yêu cầu cross-region replication (không đề cập), dẫn đến phức tạp và không giải quyết độ trễ gốc. -
C. Use S3 Select on the S3 bucket. Change the mobile app to use the S3 Select global endpoint for uploads.
❌ SAI. S3 Select là công cụ query và retrieve dữ liệu từ object (như SQL trên file CSV/JSON), không hỗ trợ upload mà chỉ dùng cho download/extract. Không có "S3 Select global endpoint" cho upload – đây là nhầm lẫn với các tính năng khác. Upload vẫn chậm như cũ. -
D. Create new public Network Load Balancers (NLBs) in several AWS Regions across the world. Specify the S3 bucket as the target of the NLBs. Change the mobile app to use the closest NLB for uploads.
❌ SAI. NLB dùng cho load balancing traffic đến EC2/Lambda/IP targets, không thể target trực tiếp S3 bucket (S3 không phải target group hợp lệ theo docs AWS 2026). NLB public chỉ proxy TCP/UDP/TLS, không xử lý S3 protocol (PUT object). Thêm chi phí cao, phức tạp, và không tận dụng edge network AWS.
📘 Tài liệu tham khảo (AWS chính thức - cập nhật 2026)
- 🛠️ S3 Transfer Acceleration: docs.aws.amazon.com/AmazonS3/latest/userguide/transfer-acceleration.html – Hướng dẫn enable và test speed.
- 🔍 S3 Access Points: docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html – Xác nhận chỉ regional.
- 📊 S3 Features Overview: aws.amazon.com/s3/features/ – So sánh Transfer Acceleration vs. các option khác.
- ⚡ AWS Well-Architected Framework (Reliability Pillar): Khuyến nghị Transfer Acceleration cho global upload.
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 SDK, hãy hỏi thêm.
Which solution will meet this requirement with the LEAST operational overhead?
- A Create an Amazon CloudWatch custom metric to monitor certificate expiration for all ACM certificates. Create an Amazon EventBridge rule that has an event source of aws.cloudwatch. Configure the rule to send an event to a target Amazon Simple Notification Service (Amazon SNS) topic if the DaysToExpiry metric is less than 14. Subscribe the appropriate email addresses to the SNS topic.
- B Create an Amazon EventBridge rule that has an event source of aws.acm. Configure the rule to evaluate the DaysToExpiry metric for all ACM certificates. Configure the rule to send an event to a target Amazon Simple Notification Service (Amazon SNS) topic if DaysToExpiry is less than 14. Subscribe the appropriate email addresses to the SNS topic.
- C Create an Amazon CloudWatch dashboard that displays the DaysToExpiry metric for all ACM certificates. If DaysToExpiry is less than 14, send an email message to the appropriate email addresses. Send the email message by running a predefined CLI command to publish to an Amazon Simple Notification Service (Amazon SNS) topic.
- D Create an Amazon EventBridge rule that has an event source of aws.acm. Configure the rule to evaluate the DaysToExpiry metric for all ACM certificates. Configure a target SMS identity that uses a predefined email template. Configure the rule to send an event to the target SMS identity if DaysToExpiry is less than 14.
Xem giải thích
🛡️ Phân tích câu hỏi trắc nghiệm AWS
📖 Nội dung câu hỏi:
Câu hỏi tập trung vào việc giám sát và thông báo tự động về thời hạn hết hạn của chứng chỉ SSL/TLS công khai được quản lý bởi AWS Certificate Manager (ACM). Một SysOps administrator cần gửi email thông báo khi chứng chỉ còn dưới 14 ngày hết hạn, với yêu cầu giải pháp có chi phí vận hành thấp nhất (LEAST operational overhead).
🧩 Bối cảnh chính: ACM tự động quản lý chứng chỉ, nhưng không có tính năng thông báo hết hạn tích hợp sẵn qua email. Giải pháp cần tận dụng các dịch vụ AWS serverless như EventBridge và SNS để tự động hóa, tránh các công việc thủ công như polling API hoặc tạo metric tùy chỉnh. Điều này phù hợp với best practice DevOps trên AWS, nhấn mạnh vào sự kiện-driven architecture (theo kiến thức AWS cập nhật đến 2026, ACM phát sự kiện nearing expiration qua EventBridge).
✅ Đáp án đúng:
Lựa chọn thứ 2 (đã đánh dấu [ĐÚNG]):
Create an Amazon EventBridge rule that has an event source of aws.acm. Configure the rule to evaluate the DaysToExpiry metric for all ACM certificates. Configure the rule to send an event to a target Amazon Simple Notification Service (Amazon SNS) topic if DaysToExpiry is less than 14. Subscribe the appropriate email addresses to the SNS topic.
🛠️ Lý do chọn đáp án đúng (bằng tiếng Việt):
Giải pháp này sử dụng tích hợp native giữa ACM và EventBridge (event source aws.acm), nơi ACM tự động phát sự kiện khi chứng chỉ sắp hết hạn (bao gồm thông tin DaysToExpiry trong payload sự kiện). EventBridge rule dễ dàng filter dựa trên DaysToExpiry < 14, sau đó trigger SNS topic để gửi email – hoàn toàn serverless, không cần code tùy chỉnh hay polling. Overhead thấp nhất vì tận dụng event-driven model của AWS, chỉ tốn phí theo usage (rẻ ~0.000001 USD/event). Theo AWS Well-Architected Framework (DevOps pillar), đây là cách tối ưu cho monitoring certificates.
🔍 Phân tích tất cả các phương án (đúng/sai)
-
❌ Phương án 1 (SAI):
Create an Amazon CloudWatch custom metric to monitor certificate expiration for all ACM certificates. Create an Amazon EventBridge rule that has an event source of aws.cloudwatch. Configure the rule to send an event to a target Amazon Simple Notification Service (Amazon SNS) topic if the DaysToExpiry metric is less than 14. Subscribe the appropriate email addresses to the SNS topic.
Giải thích sai: Phương án này yêu cầu tạo custom metric thủ công (phải dùng Lambda hoặc script polling ACM API định kỳ để publish metric vào CloudWatch), dẫn đến overhead cao (code maintenance, scheduling, chi phí compute). ACM không có metricDaysToExpirynative, nên không tận dụng được event tự động từ ACM. EventBridge từaws.cloudwatchchỉ reactive với metric đã có, không phải nguồn gốc. -
✅ Phương án 2 (ĐÚNG):
(Như đã giải thích ở trên – giải pháp native, least overhead).
Giải thích đúng: Event sourceaws.acmnhận sự kiện tự động từ ACM (ví dụ:ACM Certificate Expiration Neared), payload chứaDaysToExpiry. Rule filter<14và target SNS – zero custom code, tự động scale. -
❌ Phương án 3 (SAI):
Create an Amazon CloudWatch dashboard that displays the DaysToExpiry metric for all ACM certificates. If DaysToExpiry is less than 14, send an email message to the appropriate email addresses. Send the email message by running a predefined CLI command to publish to an Amazon Simple Notification Service (Amazon SNS) topic.
Giải thích sai: CloudWatch dashboard chỉ hiển thị visualization, không tự động trigger alert/email. Phải chạy CLI thủ công (nhưaws sns publish) định kỳ (cron job), dẫn đến overhead vận hành cao (manual intervention, scripting). Không có metricDaysToExpirynative từ ACM, dashboard chỉ pretty-print chứ không actionable. -
❌ Phương án 4 (SAI):
Create an Amazon EventBridge rule that has an event source of aws.acm. Configure the rule to evaluate the DaysToExpiry metric for all ACM certificates. Configure a target SMS identity that uses a predefined email template. Configure the rule to send an event to the target SMS identity if DaysToExpiry is less than 14.
Giải thích sai: Event sourceaws.acmđúng, nhưng target "SMS identity" sai mục đích – SMS dùng cho tin nhắn SMS (short message service), không hỗ trợ email template đầy đủ. SNS mới hỗ trợ email subscription chuẩn. Dùng SMS identity sẽ fail deliver email, overhead thêm config sai (vi phạm requirement "email notification").
📘 Tài liệu tham khảo (AWS cập nhật 2026)
- ACM EventBridge Integration: AWS Docs - Monitor ACM certificates using Amazon EventBridge – Xác nhận event
aws.acmvớidaysToExpiry(nearing 45/30/7 days, filterable). - EventBridge ACM Events: AWS EventBridge Event Reference - ACM – Chi tiết payload
DaysToExpiry. - SNS for Notifications: AWS SNS Email Subscriptions.
- Best Practice: AWS Well-Architected Framework - Reliability Pillar (Monitoring as code với EventBridge).
🎯 Kết luận: Giải pháp đúng tận dụng event-driven native, giúp SysOps admin đạt zero-touch operations! 🚀
How should the SysOps administrator resolve the problem?
- A Update the CloudFormation stack to include an AWS::IAM::Role resource with the required IAM permissions for EventBridge to invoke the function. Assign the role to the EventBridge rule.
- B Update the CloudFormation stack to include an AWS::IAM::Role resource with the required IAM permissions for the function. Assign the role as the function execution role.
- C Update the CloudFormation stack with an AWS::Lambda::Permission resource to ensure events.amazonaws.com has permissions to invoke the function.
- D Update the CloudFormation stack with an AWS::Lambda::Permission resource to ensure lambda.amazonaws.com has permissions to invoke the function.
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ế mà một SysOps administrator đã tạo một AWS CloudFormation template để triển khai một Amazon EventBridge rule (trước đây gọi là CloudWatch Events rule). Rule này được thiết kế để kích hoạt (invoke) một AWS Lambda function. Lambda function có nhiệm vụ ghi chi tiết sự kiện (event details) vào một Amazon CloudWatch log group.
✅ Lambda đã có quyền ghi logs: Function có IAM permissions cần thiết để viết dữ liệu vào CloudWatch Logs (thông qua execution role của Lambda).
❌ Vấn đề chính: Lambda function không chạy (not running), nghĩa là rule EventBridge không thể invoke Lambda thành công.
🛠️ Nguyên nhân cốt lõi: Thiếu resource-based policy trên Lambda function để cho phép EventBridge (principal: events.amazonaws.com) invoke function. Đây là yêu cầu bắt buộc theo mô hình bảo mật least privilege của AWS (cập nhật đến năm 2026, Lambda vẫn yêu cầu Lambda::Permission cho các service bên ngoài invoke).
Mục tiêu: SysOps admin cần update CloudFormation stack để khắc phục, đảm bảo tích hợp EventBridge → Lambda hoạt động mượt mà mà không ảnh hưởng quyền execution của Lambda.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Update the CloudFormation stack with an AWS::Lambda::Permission resource to ensure events.amazonaws.com has permissions to invoke the function.
Lý do chi tiết:
- 🛠️ EventBridge cần Lambda resource-based policy (qua
AWS::Lambda::Permission) để invoke Lambda. Principal chính xác làevents.amazonaws.com(Service principal của EventBridge). - Điều này tạo một policy statement trên Lambda ARN, cho phép EventBridge gửi event mà không cần thay đổi execution role của Lambda (execution role chỉ dùng khi Lambda chạy, để truy cập logs/AWS services khác).
- Đây là cách chuẩn theo best practice AWS (CloudFormation resource
AWS::Lambda::PermissionvớiAction: lambda:InvokeFunction,Principal: events.amazonaws.com, vàSourceArncủa EventBridge rule nếu cần giới hạn). - Giải quyết trực tiếp vấn đề "Lambda not running" vì thiếu permission invoke. Cập nhật stack sẽ apply thay đổi ngay mà không downtime.
📋 Phân tích tất cả các phương án
-
❌ Phương án SAI: Update the CloudFormation stack to include an AWS::IAM::Role resource with the required IAM permissions for EventBridge to invoke the function. Assign the role to the EventBridge rule.
Giải thích: Phương án này không đúng vì EventBridge không cần IAM role riêng để invoke Lambda. EventBridge sử dụng service-linked role (tự động) hoặc resource-based policy trên Lambda. Tạo role cho EventBridge rule chỉ dùng cho các target khác (như ECS/SNS), không phải invoke Lambda. Thêm role thừa sẽ không giải quyết vấn đề invoke. -
❌ Phương án SAI: Update the CloudFormation stack to include an AWS::IAM::Role resource with the required IAM permissions for the function. Assign the role as the function execution role.
Giải thích: Không cần thiết vì câu hỏi đã xác nhận Lambda "has permissions to write events to Amazon CloudWatch Logs" (execution role đã đủ cho logs và runtime). Vấn đề là EventBridge không invoke được Lambda, không phải execution role thiếu quyền. Thay role execution chỉ ảnh hưởng khi Lambda chạy, không fix invoke failure. -
✅ Phương án ĐÚNG: Update the CloudFormation stack with an AWS::Lambda::Permission resource to ensure events.amazonaws.com has permissions to invoke the function.
Giải thích: Như đã nêu ở phần đáp án đúng. Đây là bước chính xác, trực tiếp theo tài liệu AWS: Sử dụngAWS::Lambda::Permissionđể grant invoke permission cho principalevents.amazonaws.com. Đảm bảo tuân thủ security model (kiến thức cập nhật 2026: Vẫn là yêu cầu bắt buộc cho cross-service invokes). -
❌ Phương án SAI: Update the CloudFormation stack with an AWS::Lambda::Permission resource to ensure lambda.amazonaws.com has permissions to invoke the function.
Giải thích: Principal sai!lambda.amazonaws.comlà service principal của Lambda itself (dùng cho Lambda invoke lẫn nhau), không phải EventBridge. EventBridge dùngevents.amazonaws.com. Sử dụng sai principal sẽ không grant quyền đúng, Lambda vẫn không chạy.
📘 Tài liệu tham khảo
- AWS Docs: Using resource-based policies for Lambda (cập nhật 2025-2026).
- AWS Docs: EventBridge put targets with Lambda – Xác nhận principal
events.amazonaws.com. - CloudFormation Resource: AWS::Lambda::Permission.
- AWS Exam Guide DOP-C02 (DevOps Professional, version 2023+): Nhấn mạnh Lambda permissions cho EventBridge integration.
🛠️ Lời khuyên thực hành: Luôn kiểm tra CloudWatch Logs của Lambda (Invoke errors) và EventBridge rule history để debug. Test stack update qua aws cloudformation update-stack!