Ngân hàng đề — AWS Certified Solutions Architect Professional

Tìm thấy 1221 câu.

Câu 691 AWS Storage

A company hosts a business-critical monolithic application on an Amazon EC2 instance which is installed on an instance launched from an Amazon Linux 2 AMI. The company requires that the data on the attached EBS volumes must be backed up to a specific Amazon S3 bucket managed by the company.

The security team has mandated against owning any SSH keys for instances, so the operations team are unable to SSH into the instance.

Which solution will meet these requirements with the least impact on the critical application?

  1. A

    Create a new AMI image from the current EC2 instance and spin up a new EC2 instance from the image. Attach a role to the new instance with permission to write to Amazon S3. Run a command to copy data into Amazon S3.

  2. B

    Create an image of the instance with the reboot option turned on. Launch a new EC2 instance from the image. Attach a role to the new instance with permission to write to Amazon S3. Run a command to copy data into Amazon S3.

  3. C

    Attach an IAM role to the instance with permissions to write to Amazon S3. Use the AWS Systems Manager Session Manager to gain access to the instance and run commands to copy data into Amazon S3.

  4. D

    Take a snapshot of the EBS volume by using Amazon Data Lifecycle Manager (Amazon DLM). Use the EBS direct APIs to copy the data from the snapshot to Amazon S3.

Xem giải thích

Đáp án

D — Chụp snapshot của EBS volume bằng Amazon Data Lifecycle Manager; dùng EBS direct API để sao chép dữ liệu từ snapshot sang Amazon S3.

Vì sao đúng

Đề có hai ràng buộc chặt: không được có khoá SSH nên không vào được máy, và ít ảnh hưởng nhất tới ứng dụng quan trọng.

Ràng buộc Cách đáp ứng
Không SSH được vào máy snapshot ở tầng khối, không cần vào trong
Ít ảnh hưởng nhất DLM chụp snapshot không cần dừng máy
Đưa dữ liệu vào S3 EBS direct API đọc trực tiếp từ snapshot

⚠ Điểm mấu chốt: EBS direct API cho phép đọc nội dung snapshot mà KHÔNG cần gắn volume vào máy nào:

Cách truyền thống
        ↓
    Tạo volume từ snapshot → gắn vào một EC2 → mount → copy lên S3
        ↓
    Cần một máy, cần quyền vào máy đó
        ↓
EBS direct API
        ↓
    ListSnapshotBlocks + GetSnapshotBlock đọc thẳng từng khối
        ↓
    → không cần volume, không cần instance, không cần SSH
aws ebs list-snapshot-blocks --snapshot-id snap-0abc123
aws ebs get-snapshot-block --snapshot-id snap-0abc123 \
  --block-index 0 --block-token <token>

Vì sao Data Lifecycle Manager. DLM tự động chụp snapshot theo lịch, giữ số bản theo chính sách, và không cần đụng vào instance — đúng thứ cần khi ứng dụng quan trọng không được gián đoạn.

⚠ Snapshot khi máy đang chạy có thể không nhất quán ở tầng ứng dụng:

Snapshot chụp trạng thái khối tại một thời điểm
        ↓
    Dữ liệu đang trong bộ đệm của ứng dụng chưa được ghi xuống đĩa
        ↓
    → snapshot nhất quán ở tầng crash, nhưng có thể thiếu giao dịch đang dở
        ↓
    → với cơ sở dữ liệu, nên dùng snapshot có nhận biết ứng dụng
      (qua SSM document) nếu có thể

Vì sao các phương án khác sai

  • C (gắn IAM role có quyền ghi S3 vào instance; dùng Session Manager để vào máy và chạy lệnh sao chép) — đây là phương án gần nhất và Session Manager thật sự giải quyết được ràng buộc "không có khoá SSH": nó cho truy cập shell mà không cần khoá và không cần mở cổng 22. Nhưng nó vi phạm ràng buộc thứ hai — ít ảnh hưởng nhất tới ứng dụng: chạy lệnh sao chép hàng chục GB dữ liệu trên chính máy đang phục vụ tiêu tốn CPU, bộ nhớ và băng thông đĩa của ứng dụng quan trọng đó. Snapshot thì gần như không ảnh hưởng gì tới máy nguồn.

  • A (tạo AMI từ instance hiện tại, dựng instance mới từ AMI, gắn role, chạy lệnh sao chép) — vòng vèo: dựng cả một EC2 mới chỉ để sao chép dữ liệu, và tạo AMI theo mặc định sẽ khởi động lại instance trừ khi tắt tuỳ chọn đó — ảnh hưởng trực tiếp tới ứng dụng.

  • B (tạo image với tuỳ chọn reboot BẬT, dựng instance mới từ image, sao chép) — nói thẳng ra rằng nó khởi động lại máy, vi phạm rõ ràng nhất yêu cầu "least impact on the critical application".

Ghi nhớ

⚠ Bốn cách lấy dữ liệu từ EBS mà không vào máy — bảng phải thuộc: | Cách | Cần vào máy | |---|---| | EBS direct API trên snapshot | không | | Tạo volume từ snapshot, gắn vào máy khác | không vào máy gốc | | Session Manager rồi copy | có, và chạy trên máy production | | SSH rồi copy | có |

Từ khoá nhận diện:

"không được có khoá SSH" → Session Manager hoặc snapshot "least impact on the critical application" → snapshot, không chạy gì trên máy đó "EBS direct API" → đọc snapshot mà không cần volume "tạo AMI" → mặc định khởi động lại máy "reboot option turned on" → vi phạm rõ ràng yêu cầu ít ảnh hưởng

Data Lifecycle Manager Việc
Chụp snapshot theo lịch dựa trên tag của volume hoặc instance
Giữ bao nhiêu bản theo số lượng hoặc theo tuổi
Sao chép sang Region khác hỗ trợ
Chi phí miễn phí, chỉ trả tiền lưu trữ snapshot
Ba EBS direct API Việc
ListSnapshotBlocks liệt kê các khối trong snapshot
ListChangedBlocks so hai snapshot, chỉ lấy khối đã đổi
GetSnapshotBlock đọc nội dung một khối
Snapshot — điều cần nhớ Nội dung
Gia tăng chỉ lưu khối đã thay đổi so với snapshot trước
Nhất quán ở tầng khối, không phải tầng ứng dụng
Ảnh hưởng máy nguồn rất nhỏ — chụp trong nền
Nhất quán ứng dụng dùng SSM document để flush bộ đệm trước khi chụp

Ba việc kiểm chứng: | Việc | Cách | |---|---| | Snapshot có được tạo đúng lịch không | lịch sử của DLM policy | | Dữ liệu đọc ra có đúng không | so checksum vài khối với dữ liệu gốc | | Ứng dụng có bị ảnh hưởng không | theo dõi độ trễ ứng dụng trong lúc chụp |

Và một lời khuyên: hãy dùng SSM Automation document để flush bộ đệm ứng dụng trước khi chụp, nếu dữ liệu quan trọng nằm trong một cơ sở dữ liệu. Snapshot của EBS nhất quán ở tầng khối — nghĩa là nó tương đương với việc rút điện máy chủ tại thời điểm đó. Với hệ thống tệp hiện đại thì điều đó thường an toàn, nhưng với một cơ sở dữ liệu đang có giao dịch dở, bản sao lưu có thể khôi phục được mà vẫn thiếu dữ liệu. Systems Manager có sẵn document để chạy lệnh flush trước và sau khi chụp, và nó không đòi bạn phải có khoá SSH nào.

Câu 692 AWS Developer Tools

A company uses AWS CodeCommit for source control and AWS CodePipeline for continuous integration. The pipeline has a build stage which uses an Amazon S3 bucket for artifacts. The company requires a new development pipeline for testing new features. The new pipeline should be isolated from the production pipeline and incorporate continuous testing for unit tests.

How can a Solutions Architect meet these requirements?

  1. A

    Create a separate pipeline in CodePipeline and trigger execution using CodeCommit branches. Use AWS CodeBuild for running unit tests and stage the artifacts in an S3 bucket in a separate testing account.

  2. B

    Create a separate pipeline in CodePipeline and trigger execution using CodeCommit tags. Use Jenkins for running unit tests. Create a stage in the pipeline with S3 as the target for staging the artifacts with an S3 bucket in a separate testing account.

  3. C

    Create a separate pipeline in CodePipeline and trigger execution using CodeCommit branches. Use AWS Lambda for running unit tests. Use AWS CodeDeploy to stage the artifacts within an S3 bucket in a separate testing account.

  4. D

    Create a separate CodeCommit repository for feature development and use it to trigger the pipeline. Use AWS Lambda for running unit tests. Use AWS CodeBuild to stage the artifacts within different S3 buckets in the same production account.

Xem giải thích

Đáp án

A — Tạo một pipeline riêng trong CodePipeline và kích hoạt bằng nhánh của CodeCommit; dùng AWS CodeBuild chạy unit test và lưu artifact vào bucket S3 ở một tài khoản testing riêng.

Vì sao đúng

Đề đòi ba thứ: pipeline riêng cho phát triển, cách ly với production, và kiểm thử liên tục bằng unit test.

Yêu cầu Cách đáp ứng
Pipeline riêng pipeline thứ hai trong CodePipeline
Kích hoạt cho tính năng mới theo nhánh của CodeCommit
Chạy unit test CodeBuild
Cách ly với production artifact ở bucket thuộc tài khoản testing riêng

⚠ Điểm mấu chốt: cách ly thật sự nghĩa là artifact nằm ở TÀI KHOẢN khác, không chỉ bucket khác:

Bucket riêng nhưng cùng tài khoản
        ↓
    Vẫn chung ranh giới bảo mật, chung hạn mức, chung hoá đơn
    Một cấu hình sai IAM có thể cho pipeline dev chạm vào artifact production
        ↓
Bucket ở tài khoản testing riêng
        ↓
    Ranh giới tài khoản là ranh giới cách ly mạnh nhất
        ↓
    → đây là nghĩa của "isolated from the production pipeline"

Vì sao kích hoạt theo nhánh. Nhánh là đơn vị tự nhiên cho việc phát triển tính năng: mỗi nhánh feature đẩy lên là pipeline dev chạy, còn nhánh main kích hoạt pipeline production. Không phải tạo repository mới.

aws codepipeline create-pipeline --cli-input-json file://pipeline-dev.json
# source stage: BranchName = "develop", trigger theo CodeCommit

⚠ CodeBuild là nơi chạy unit test — đây là vai trò cốt lõi của nó:

CodeBuild có môi trường thực thi thật: cài dependency, chạy lệnh test
        ↓
    Báo cáo kết quả test qua CodeBuild test reporting
        ↓
    Test thất bại → build thất bại → pipeline dừng
        ↓
    → cổng chặn tự nhiên, không cần viết logic gì thêm

Vì sao các phương án khác sai

  • B (pipeline riêng, kích hoạt bằng TAG của CodeCommit; dùng Jenkins chạy unit test; artifact ở bucket thuộc tài khoản testing riêng) — đây là phương án gần nhất và phần cách ly artifact của nó chính xác. Nhưng hai chi tiết kém hơn. Kích hoạt bằng tag không hợp với phát triển tính năng liên tục: tag thường dùng để đánh dấu bản phát hành, còn nhánh mới là thứ lập trình viên đẩy lên hằng ngày. Và dùng Jenkins nghĩa là thêm một hệ thống phải tự vận hành, trong khi công ty đã dùng CodeBuild và đề nói họ muốn dùng lại nó.

  • C (pipeline riêng theo nhánh — đúng; nhưng dùng Lambda chạy unit test và CodeDeploy để lưu artifact) — hai chỗ sai vai trò. Lambda không phải môi trường chạy unit test: nó giới hạn 15 phút, khó cài dependency của bộ test, và không có cơ chế báo cáo kết quả test. Và CodeDeploy triển khai ứng dụng, nó không lưu artifact vào S3 — đó là việc của CodeBuild hoặc chính CodePipeline.

  • D (tạo một CodeCommit repository RIÊNG cho phát triển tính năng; Lambda chạy unit test; CodeBuild lưu artifact vào các bucket khác nhau trong CÙNG tài khoản production) — hai vấn đề. Tách repository nghĩa là mã của tính năng mới sống ở một kho khác, và việc merge ngược về kho chính trở nên thủ công và dễ lệch — nhánh là cơ chế đúng. Và artifact vẫn nằm trong tài khoản production, nên không đạt yêu cầu cách ly.

Ghi nhớ

⚠ Bốn dịch vụ Code và vai trò — bảng phải thuộc:* | Dịch vụ | Việc | |---|---| | CodeCommit | kho Git | | CodeBuild | biên dịch, chạy TEST, tạo artifact | | CodeDeploy | triển khai artifact đã dựng | | CodePipeline | điều phối các giai đoạn |

Từ khoá nhận diện:

"pipeline riêng cho phát triển" → pipeline thứ hai, kích hoạt theo nhánh "continuous testing for unit tests" → CodeBuild "isolated from production" → artifact ở tài khoản riêng "Lambda chạy unit test" → SAI, không phải môi trường test "CodeDeploy lưu artifact" → SAI, CodeDeploy triển khai "repository riêng cho tính năng" → nhánh là cơ chế đúng

Kích hoạt pipeline theo gì Khi nào
Nhánh phát triển tính năng liên tục
Tag đánh dấu bản phát hành
Lịch build định kỳ
Thủ công triển khai có kiểm soát
Cách ly giữa các môi trường Mức độ
Tài khoản riêng mạnh nhất — ranh giới bảo mật, hạn mức, hoá đơn
Bucket riêng cùng tài khoản yếu hơn
Tiền tố riêng cùng bucket yếu nhất
Artifact liên tài khoản Cần
Bucket policy ở tài khoản đích cho pipeline ghi bắt buộc
KMS key chia sẻ artifact được mã hoá, cả hai bên cần quyền dùng khoá
Cross-account role cho pipeline thao tác ở tài khoản kia

Ba việc kiểm chứng: | Việc | Cách | |---|---| | Pipeline dev có chạm được production không | thử từ role của pipeline dev | | Test thất bại có chặn pipeline không | cố ý làm hỏng một test | | Artifact có nằm đúng tài khoản không | kiểm bucket trong cấu hình pipeline |

Và một lời khuyên: hãy nhớ chia sẻ cả KMS key khi lưu artifact sang tài khoản khác, không chỉ bucket policy. Đây là chỗ pipeline liên tài khoản thất bại với một thông báo lỗi rất khó hiểu: CodePipeline mã hoá artifact bằng một KMS key, và tài khoản đích cần quyền dùng khoá đó để đọc chúng. Bucket policy đúng, IAM role đúng, nhưng nếu key policy không cho tài khoản kia dùng thì pipeline thất bại ở giai đoạn đọc artifact với lỗi về quyền — và lỗi đó trỏ vào S3 chứ không trỏ vào KMS, nên bạn sẽ rà bucket policy rất lâu trước khi nghĩ tới khoá.

Câu 693 Chọn nhiều đáp án AWS Networking & Content Delivery

A company has launched a web application on Amazon EC2 instances. The instances have been launched in a private subnet. An Application Load Balancer (ALB) is configured in front of the instances. The instances are assigned to a security group named WebAppSG and the ALB is assigned to a security group named ALB-SG. The security team requires that the security group rules are locked down according to best practice.

What rules should be configured in the security groups? (Select TWO.)

  1. A

    An outbound rule in ALB-SG allowing ports 1024-65535 to destination 0.0.0.0/0.

  2. B

    An inbound rule in ALB-SG allowing port 80 from source 0.0.0.0/0.

  3. C

    An inbound rule in ALB-SG allowing port 80 from WebAppSG.

  4. D

    An inbound rule in WebAppSG allowing port 80 from source ALB-SG.

  5. E

    An outbound rule in WebAppSG allowing ports 1024-65535 to destination ALB-SG.

Xem giải thích

Đáp án

B, D — hai rule cần có theo thực hành tốt:

  • B — Rule inbound trong ALB-SG cho phép cổng 80 từ nguồn 0.0.0.0/0.
  • D — Rule inbound trong WebAppSG cho phép cổng 80 từ nguồn ALB-SG.

Vì sao đúng

Security group có trạng thái, nên chỉ cần khai chiều vào — và việc tham chiếu security group thay vì dải IP là cốt lõi của thực hành tốt.

Chiều Rule Vì sao
Internet → ALB 80 từ 0.0.0.0/0 ALB là điểm vào công khai
ALB → EC2 80 từ ALB-SG chỉ ALB được gọi vào máy ứng dụng

⚠ Điểm mấu chốt: security group CÓ TRẠNG THÁI — gói trả lời tự động được cho đi ra:

Security group ghi nhớ kết nối đã cho phép
        ↓
    Gói trả lời của một kết nối hợp lệ tự động đi ra được
        ↓
    → KHÔNG cần rule outbound cho chiều về
        ↓
    → đây là lý do các phương án A, C, E đều thừa
    → và cũng là khác biệt lớn nhất so với Network ACL

Vì sao tham chiếu ALB-SG chứ không phải dải CIDR. Đây là điểm cốt lõi của thực hành tốt:

aws ec2 authorize-security-group-ingress --group-id sg-webapp \
  --protocol tcp --port 80 --source-group sg-alb
Cách khai nguồn Đặc điểm
Tham chiếu security group tự đúng khi ALB đổi IP, thêm AZ, hay co giãn
Dải CIDR của subnet phải cập nhật khi mạng đổi, và rộng hơn cần thiết

Vì sao các phương án khác sai

  • C (rule inbound trong ALB-SG cho phép cổng 80 từ WebAppSG) — đây là phương án gần nhất và nó dùng đúng kỹ thuật tham chiếu security group. Nhưng nó đảo chiều: lưu lượng đi từ Internet vào ALB, rồi từ ALB vào EC2 — không có chiều nào đi từ máy ứng dụng vào ALB. Cho phép WebAppSG gọi vào ALB là mở một đường không ai dùng, và vi phạm quyền tối thiểu.

  • A (rule outbound trong ALB-SG cho cổng 1024–65535 tới 0.0.0.0/0) và E (rule outbound trong WebAppSG cho cổng 1024–65535 tới ALB-SG) — cả hai đều thừa vì security group có trạng thái. Việc khai cổng ephemeral cho chiều về là tư duy của Network ACL, vốn không có trạng thái. Đây là bẫy chính của câu hỏi: nó trộn lẫn hai cơ chế để xem bạn có phân biệt được không.

Ghi nhớ

⚠ Security group so với Network ACL — bảng phải thuộc, đây là bảng ra thi nhiều nhất: | | Security group | Network ACL | |---|---|---| | Gắn vào | ENI | subnet | | Trạng thái | CÓ — không cần rule chiều về | KHÔNG — phải khai cả hai chiều | | Rule | chỉ allow | allow và deny | | Đánh giá | tất cả rule cùng lúc | theo số thứ tự, dừng ở rule khớp đầu tiên | | Nguồn | CIDR, security group khác, prefix list | chỉ CIDR |

Từ khoá nhận diện:

"security group" + rule outbound cho cổng ephemeral → thừa, SG có trạng thái "NACL" + cho phép truy cập → luôn cần rule cả hai chiều EC2 sau ALB → inbound từ security group của ALB tham chiếu security group thay vì CIDR → thực hành tốt rule cho phép WebAppSG gọi vào ALB → sai chiều lưu lượng

Outbound mặc định của security group Nội dung
Mới tạo cho phép mọi lưu lượng đi ra
Siết chặt hơn có thể giới hạn, nhưng phải nhớ mở đủ cho những gì ứng dụng cần gọi
Với bài này mặc định là đủ, không cần rule nào thêm
Lợi ích của tham chiếu security group Nội dung
Không phụ thuộc IP ALB đổi IP, thêm AZ đều không ảnh hưởng
Hẹp hơn CIDR chỉ tài nguyên trong group đó, không phải cả subnet
Tự đúng khi co giãn thêm máy vào group là tự có quyền
Giới hạn cần nhớ Con số
Rule mỗi security group 60 vào, 60 ra (nâng được)
Security group mỗi ENI 5 (nâng lên 16 được)
Tham chiếu SG chỉ trong cùng VPC hoặc VPC đã peering

Ba việc kiểm chứng: | Việc | Cách | |---|---| | Gói bị chặn ở đâu | VPC Flow Logs — bản ghi REJECT | | Rule đang cho ai vào | describe-security-groups, xem IpPermissions | | Có rule thừa không | rà các rule không khớp lưu lượng thật nào |

Và một lời khuyên: hãy dùng tham chiếu security group thay cho dải CIDR ở mọi nơi có thể, kể cả khi CIDR trông đơn giản hơn. Một rule cho phép 10.1.0.0/24 nhìn có vẻ đủ hẹp, nhưng nó cho phép mọi thứ trong subnet đó — kể cả những tài nguyên được thêm vào sau này mà bạn không biết. Tham chiếu sg-alb thì chỉ đúng những gì thuộc group đó, và nó tự đúng khi hạ tầng thay đổi. Khác biệt không lộ ra vào ngày bạn viết rule; nó lộ ra sáu tháng sau, khi ai đó dựng một máy thử nghiệm trong cùng subnet và bỗng nhiên nó gọi được vào tầng ứng dụng.

Câu 694 AWS Networking & Content Delivery

A Solutions Architect must design a solution for providing private connectivity from a company’s WAN network to multiple AWS Regions. The company has offices around the world and has its main data center in New York. The company has mandated that traffic must not traverse the public internet at any time. The solution must also be highly available.

How can the Solutions Architect meet these requirements?

  1. A

    Create an AWS Direct Connect connection from the New York data center to all AWS Regions the company uses. Configure the company WAN to send traffic via the New York data center and on to the respective DX connection to access AWS.

  2. B

    Create two AWS Direct Connect connections from the New York data center to an AWS Region. Configure the company WAN to send traffic over the DX connection. Use inter-region VPC peering to access the data in other AWS Regions.

  3. C

    Create two AWS Direct Connect connections from the New York data center to an AWS Region. Configure the company WAN to send traffic over the DX connection. Use an AWS transit VPC solution to access data in other AWS Regions.

  4. D

    Create two AWS Direct Connect connections from the New York data center to an AWS Region. Configure the company WAN to send traffic over the DX connection. Use Direct Connect Gateway to access data in other AWS Regions.

Xem giải thích

Đáp án

D — Tạo hai kết nối Direct Connect từ trung tâm dữ liệu New York tới một AWS Region; cấu hình WAN gửi lưu lượng qua kết nối DX; dùng Direct Connect Gateway để truy cập dữ liệu ở các Region khác.

Vì sao đúng

Đề đòi ba thứ: kết nối riêng tới nhiều Region, không đi qua Internet lúc nào, và sẵn sàng cao.

Yêu cầu Cách đáp ứng
Không qua Internet Direct Connect — đường riêng
Nhiều Region Direct Connect gateway — tài nguyên toàn cầu
Sẵn sàng cao hai kết nối DX

⚠ Điểm mấu chốt: Direct Connect gateway là tài nguyên TOÀN CẦU — một kết nối vật lý tới được VPC ở mọi Region:

Kết nối DX vật lý tại New York
        ↓
    Private VIF (hoặc transit VIF) gắn vào Direct Connect gateway
        ↓
    DX gateway liên kết với virtual private gateway ở NHIỀU Region
        ↓
    → không cần kéo cáp tới từng Region
    → lưu lượng đi trên xương sống AWS, không chạm Internet

Đây là hiểu lầm phổ biến nhất về Direct Connect, và là lý do phương án A sai.

aws directconnect create-direct-connect-gateway --direct-connect-gateway-name dxgw-toan-cau

# liên kết VGW ở từng Region
aws directconnect create-direct-connect-gateway-association \
  --direct-connect-gateway-id dxgw-abc --virtual-gateway-id vgw-us-east
aws directconnect create-direct-connect-gateway-association \
  --direct-connect-gateway-id dxgw-abc --virtual-gateway-id vgw-eu-west

⚠ DX gateway KHÔNG cho các VPC nói chuyện với nhau:

DX gateway nối mạng tại chỗ ↔ nhiều VPC
        ↓
    Nhưng VPC A và VPC B không nói chuyện được với nhau qua nó
        ↓
    → muốn vậy phải dùng transit gateway hoặc VPC peering

Vì sao các phương án khác sai

  • C (hai kết nối DX tới một Region; dùng giải pháp transit VPC để truy cập dữ liệu ở Region khác) — đây là phương án gần nhất và transit VPC thật sự nối được nhiều Region. Nhưng nó là mẫu cũ đã bị thay thế: transit VPC đòi bạn dựng và vận hành các thiết bị router ảo trên EC2, tự quản đường hầm VPN tới từng VPC, và toàn bộ thông lượng bị giới hạn bởi kích thước những máy đó. DX gateway làm cùng việc mà không cần thành phần nào phải vận hành, và nó là dịch vụ có quản lý.

  • B (hai kết nối DX tới một Region; dùng inter-region VPC peering để truy cập Region khác) — vướng một giới hạn cứng: lưu lượng từ mạng tại chỗ không đi xuyên qua VPC peering được. Peering không có tính bắc cầu, và Direct Connect vào VPC A rồi peering sang VPC B thì lưu lượng của bạn dừng ở VPC A.

  • A (tạo kết nối DX từ New York tới TẤT CẢ các Region công ty dùng) — chạy được nhưng cực kỳ tốn kém và chậm: mỗi kết nối DX là một hợp đồng riêng, thời gian cung cấp hàng tuần tới hàng tháng, và chi phí cổng cộng với phí truyền dữ liệu ở từng nơi. DX gateway đạt cùng kết quả với hai kết nối duy nhất.

Ghi nhớ

⚠ Bốn thành phần Direct Connect và phạm vi — bảng phải thuộc: | Thành phần | Phạm vi | |---|---| | Kết nối vật lý | một địa điểm | | Virtual private gateway | một VPC | | Direct Connect gateway | TOÀN CẦU — liên kết VGW ở nhiều Region | | Transit gateway | một Region (nối Region khác bằng peering) |

Từ khoá nhận diện:

"private connectivity to multiple Regions" → Direct Connect gateway "must not traverse the public internet" → Direct Connect, không phải VPN "highly available" → hai kết nối DX "inter-region VPC peering" cho lưu lượng từ on-premises → SAI, peering không bắc cầu "transit VPC" → mẫu cũ, đã bị DX gateway và transit gateway thay thế

Giới hạn của DX gateway Con số
VGW liên kết tối đa 10
Transit gateway liên kết tối đa 6
VPC nói chuyện với nhau qua DX gateway KHÔNG được
Chi phí miễn phí — chỉ trả tiền cổng DX và truyền dữ liệu
Ba loại VIF Gắn tới
Private VIF VGW hoặc DX gateway
Transit VIF DX gateway → transit gateway
Public VIF endpoint công cộng của AWS
Mức bền bỉ của Direct Connect Cấu hình
Tối đa hai kết nối, hai địa điểm DX, hai nhà mạng
Cao hai kết nối cùng địa điểm
Cơ bản một DX + một VPN dự phòng

Ba việc kiểm chứng: | Việc | Cách | |---|---| | Tuyến có tới mọi Region không | kiểm bảng định tuyến của VPC ở từng Region | | BGP có lên trên cả hai kết nối không | describe-virtual-interfaces | | Đường dự phòng có nhận tải không | rút thử đường chính |

Và một lời khuyên: hãy dùng transit VIF gắn vào transit gateway thay vì private VIF gắn vào từng VGW, nếu bạn có nhiều VPC ở mỗi Region. Private VIF tới DX gateway giới hạn ở 10 VGW — nghĩa là 10 VPC — và mỗi VPC là một liên kết phải quản riêng. Với transit VIF, bạn nối tới transit gateway của từng Region, và mọi VPC gắn vào transit gateway đó tự động với tới được. Khác biệt không quan trọng khi bạn có ba VPC; nó trở thành giới hạn cứng khi tổ chức lớn lên, và việc chuyển đổi về sau đòi dựng lại toàn bộ cấu trúc VIF.

Câu 695
A company needs to architect a hybrid DNS solution. This solution will use an Amazon Route 53 private hosted zone for the domain cloud.example.com for the resources stored within VPCs.
The company has the following DNS resolution requirements:
On-premises systems should be able to resolve and connect to cloud.example.com.
All VPCs should be able to resolve cloud.example.com.
There is already an AWS Direct Connect connection between the on-premises corporate network and AWS Transit Gateway.
Which architecture should the company use to meet these requirements with the HIGHEST performance?
  1. A Associate the private hosted zone to all the VPCs. Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
  2. B Associate the private hosted zone to all the VPCs. Deploy an Amazon EC2 conditional forwarder in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the conditional forwarder.
  3. C Associate the private hosted zone to the shared services VPCreate a Route 53 outbound resolver in the shared services VPAttach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the outbound resolver.
  4. D Associate the private hosted zone to the shared services VPC. Create a Route 53 inbound resolver in the shared services VPC. Attach the shared services VPC to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
Xem giải thích

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

Câu hỏi yêu cầu thiết kế một giải pháp DNS hybrid (kết hợp on-premises và AWS) sử dụng Amazon Route 53 private hosted zone cho domain cloud.example.com. Private hosted zone này lưu trữ records cho các tài nguyên trong các VPC.

Yêu cầu cụ thể:

  • On-premises systems phải resolve (phân giải tên miền) và kết nối được đến cloud.example.com (tức là query từ on-prem vào AWS).
  • Tất cả VPCs phải resolve được cloud.example.com (query nội bộ AWS).
  • Đã có AWS Direct Connect kết nối on-premises corporate network với AWS Transit Gateway (TGW) để routing traffic low-latency.
  • Tiêu chí chọn: Architecture mang lại HIGHEST performance (hiệu suất cao nhất), nghĩa là giảm latency, tránh forward không cần thiết, tận dụng resolve trực tiếp.

Bối cảnh kiến thức AWS (cập nhật đến 2026):

  • Private hosted zone chỉ resolve trực tiếp khi associated với VPC cụ thể.
  • Để hybrid DNS: Sử dụng Route 53 Resolver (Inbound cho on-prem → AWS; Outbound cho AWS → on-prem).
  • Inbound Resolver endpoint (trong VPC) cho phép on-prem forward query vào private zone qua Private IP (low latency qua Direct Connect/TGW).
  • Transit Gateway dùng để route traffic giữa VPCs và on-prem.
  • Highest perf: VPCs associate trực tiếp zone (resolve local), on-prem forward đến Inbound Resolver (managed service, scalable).

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

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

Đáp án đúng: Associate the private hosted zone to all the VPCs. Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.

Lý do chọn 🛠️:

  • Highest performance:
    • All VPCs associate trực tiếp private zone → resolve local, zero-hop (không cần forward qua resolver, latency thấp nhất).
    • On-prem forward đến Inbound Resolver (managed, auto-scale) trong shared services VPC → query private zone qua Direct Connect/TGW (low latency, private IP).
  • Đầy đủ yêu cầu: VPCs resolve trực tiếp; on-prem resolve qua forward rule.
  • Tối ưu TGW: Attach all VPCs để routing inter-VPC và on-prem (cần thiết cho connectivity).
  • Không dùng self-managed như EC2, tránh overhead.

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

Dưới đây là phân tích từng lựa chọn (giữ nguyên văn bản gốc). ✅ Đúng; ❌ Sai (với lý do cụ thể).

  • ✅ Associate the private hosted zone to all the VPCs. Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
    🟢 Đúng và optimal: Như giải thích trên. VPCs resolve trực tiếp (perf cao); on-prem dùng Inbound Resolver qua TGW. Highest perf vì tránh forward nội bộ AWS.

  • ❌ Associate the private hosted zone to all the VPCs. Deploy an Amazon EC2 conditional forwarder in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the conditional forwarder.
    🔴 Sai: Dùng EC2 conditional forwarder (self-managed, cần Unbound/Bind) thay vì managed Inbound Resolver. EC2 có overhead (scale thủ công, high CPU/network cho query lớn), latency cao hơn Resolver endpoints (optimized). Không highest perf.

  • ❌ Associate the private hosted zone to the shared services VPCreate a Route 53 outbound resolver in the shared services VPAttach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the outbound resolver.
    🔴 Sai:

    • Outbound Resolver dùng cho VPC query ra ngoài (không phải on-prem query vào AWS).
    • Zone chỉ associate shared VPC → Các VPC khác không resolve trực tiếp private zone (phải forward qua resolver rules, perf kém).
    • Forward từ on-prem đến Outbound không hợp lý (hướng sai). Không đáp ứng all VPCs resolve hiệu quả.
  • ❌ Associate the private hosted zone to the shared services VPC. Create a Route 53 inbound resolver in the shared services VPC. Attach the shared services VPC to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
    🔴 Sai: Zone chỉ associate shared VPC → All VPCs khác KHÔNG resolve trực tiếp (phải dùng Resolver rules forward đến shared VPC, thêm hop/latency). Chỉ attach shared VPC đến TGW → VPCs khác cô lập, không kết nối on-prem hoặc inter-VPC tốt. Perf thấp hơn associate all VPCs.

Kết luận 🚀: Đáp án đúng cân bằng hybrid DNS với perf tối ưu, tận dụng Resolver + direct association. Nếu implement, test với dig từ VPC/on-prem để verify!

Câu 696
A company is providing weather data over a REST-based API to several customers. The API is hosted by Amazon API Gateway and is integrated with different AWS Lambda functions for each API operation. The company uses Amazon Route 53 for DNS and has created a resource record of weather.example.com. The company stores data for the API in Amazon DynamoDB tables. The company needs a solution that will give the API the ability to fail over to a different AWS Region.
Which solution will meet these requirements?
  1. A Deploy a new set of Lambda functions in a new Region. Update the API Gateway API to use an edge-optimized API endpoint with Lambda functions from both Regions as targets. Convert the DynamoDB tables to global tables.
  2. B Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
  3. C Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables.
  4. D Deploy a new API Gateway API in a new Region. Change the Lambda functions to global functions. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
Xem giải thích

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

Câu hỏi mô tả một công ty cung cấp dữ liệu thời tiết qua REST-based API được host trên Amazon API Gateway, tích hợp với các AWS Lambda functions riêng biệt cho từng operation API. Họ sử dụng Amazon Route 53 để quản lý DNS với record weather.example.com, và dữ liệu được lưu trữ trong Amazon DynamoDB tables.
Yêu cầu chính: Xây dựng giải pháp cho phép API failover (chuyển đổi dự phòng) sang một AWS Region khác khi Region chính gặp sự cố.
🛠️ Thách thức kỹ thuật:

  • API Gateway và Lambda là regional services (chỉ hoạt động trong một Region cụ thể), nên cần replicate toàn bộ stack sang Region khác.
  • DynamoDB cần multi-Region replication để dữ liệu đồng bộ.
  • Route 53 là công cụ chính để routing DNS failover giữa các Region, sử dụng health checks để phát hiện sự cố và chuyển traffic.

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

Đáp án đúng là lựa chọn thứ 3:
Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables.

Lý do chi tiết 📘:

  • Deploy API Gateway mới và Lambda ở Region thứ hai để replicate đầy đủ stack.
  • Sử dụng Route 53 failover routing policy (primary/secondary) để chỉ định endpoint chính (Region 1) và phụ (Region 2), tự động failover khi primary fail.
  • Enable target health monitoring (health checks) trên Route 53 để giám sát sức khỏe API Gateway endpoints.
  • DynamoDB Global Tables (v2) đảm bảo dữ liệu replicate multi-Region với low-latency reads/writes.
    Giải pháp này tuân thủ best practices AWS cho multi-Region active-passive failover, hỗ trợ đến năm 2026 (không thay đổi lớn từ 2023).

🛠️ 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. Tôi giữ nguyên văn bản gốc tiếng Anh của phương án, chỉ giải thích bằng tiếng Việt với lý do đúng/sai:

  • ❌ Phương án 1 (SAI):
    Deploy a new set of Lambda functions in a new Region. Update the API Gateway API to use an edge-optimized API endpoint with Lambda functions from both Regions as targets. Convert the DynamoDB tables to global tables.
    Giải thích sai: API Gateway edge-optimized endpoint sử dụng CloudFront edge locations toàn cầu, nhưng không hỗ trợ targets Lambda từ nhiều Region (Lambda là regional, không cross-Region invoke trực tiếp). Việc chỉ deploy Lambda mới mà không replicate API Gateway sẽ không tạo endpoint failover đầy đủ. ❌ Không khả thi theo docs AWS.

  • ❌ Phương án 2 (SAI):
    Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
    Giải thích sai: Multivalue answer routing dùng cho load balancing nhiều healthy records cùng lúc (như active-active), không phải failover primary/secondary giữa Regions. Nó chỉ return random subset healthy IPs, không đảm bảo chuyển toàn bộ traffic sang Region phụ khi primary fail hoàn toàn. ❌ Không phù hợp cho yêu cầu failover.

  • ✅ Phương án 3 (ĐÚNG):
    Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables.
    Giải thích đúng: Đây là giải pháp chuẩn AWS cho multi-Region failover. Failover record với health checks chuyển traffic từ primary sang secondary. Replicate đầy đủ API + Lambda + Global Tables đảm bảo tính nhất quán. ✅ Hoàn hảo và scalable.

  • ❌ Phương án 4 (SAI):
    Deploy a new API Gateway API in a new Region. Change the Lambda functions to global functions. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
    Giải thích sai: Lambda không có "global functions" (Lambda luôn regional, dù có Lambda@Edge nhưng không áp dụng REST API full). Multivalue answer sai như phương án 2. Chỉ deploy API mới mà không đề cập Lambda mới ở Region phụ là thiếu sót. ❌ Sai concept cơ bản.

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

Giải pháp này đảm bảo high availability (99.99%+ SLA) và zero-downtime failover! 🚀

Câu 697
A company uses AWS Organizations with a single OU named Production to manage multiple accounts. All accounts are members of the Production OU. Administrators use deny list SCPs in the root of the organization to manage access to restricted services.
The company recently acquired a new business unit and invited the new unit’s existing AWS account to the organization. Once onboarded, the administrators of the new business unit discovered that they are not able to update existing AWS Config rules to meet the company’s policies.
Which option will allow administrators to make changes and continue to enforce the current policies without introducing additional long-term maintenance?
  1. A Remove the organization’s root SCPs that limit access to AWS Config. Create AWS Service Catalog products for the company’s standard AWS Config rules and deploy them throughout the organization, including the new account.
  2. B Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the new account to the Production OU when adjustments to AWS Config are complete.
  3. C Convert the organization’s root SCPs from deny list SCPs to allow list SCPs to allow the required services only. Temporarily apply an SCP to the organization’s root that allows AWS Config actions for principals only in the new account.
  4. D Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the organization’s root SCP to the Production OU. Move the new account to the Production OU when adjustments to AWS Config are complete.
Xem giải thích

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

📘 Nội dung câu hỏi được giải thích rõ ràng:
Câu hỏi xoay quanh tình huống một công ty sử dụng AWS Organizations với một OU (Organizational Unit) duy nhất tên Production để quản lý nhiều tài khoản AWS. Tất cả các tài khoản hiện tại đều thuộc OU Production. Các quản trị viên sử dụng SCPs (Service Control Policies) kiểu deny list (danh sách cấm) được gắn ở root của organization để hạn chế truy cập vào một số dịch vụ bị hạn chế.
Gần đây, công ty mua lại một đơn vị kinh doanh mới và mời tài khoản AWS hiện có của đơn vị này tham gia organization. Sau khi onboard, các quản trị viên của đơn vị mới không thể cập nhật (update) các quy tắc AWS Config để phù hợp với chính sách công ty, do bị chặn bởi SCP deny ở root (vì AWS Config actions bị deny ở root).
🛠️ Yêu cầu giải pháp: Cho phép quản trị viên đơn vị mới thực hiện thay đổi tạm thời, đồng thời tiếp tục enforce chính sách hiện tại mà không tạo thêm công việc bảo trì dài hạn (long-term maintenance). Giải pháp phải an toàn, không ảnh hưởng toàn organization lâu dài, và tuân thủ best practices AWS Organizations (cập nhật đến 2026: SCPs vẫn cumulative, denies từ parent không thể override bởi allows ở child, theo AWS Organizations User Guide).

✅ Đáp án đúng:
Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the organization’s root SCP to the Production OU. Move the new account to the Production OU when adjustments to AWS Config are complete.

📌 Lý do chọn đáp án này (giải thích chi tiết):
Giải pháp này hoàn hảo vì:

  • Tạo OU tạm thời "Onboarding" cho tài khoản mới, tránh ảnh hưởng các tài khoản cũ.
  • Di chuyển SCP deny list từ root sang OU Production: Root giờ không còn deny AWS Config nữa → tất cả accounts dưới root (bao gồm Onboarding OU) mặc định được phép (SCPs permissive by default). OU Production vẫn giữ nguyên deny để enforce chính sách.
  • Gắn SCP allow cụ thể cho AWS Config ở Onboarding OU để đảm bảo rõ ràng (dù root đã không deny).
  • Sau khi hoàn tất update AWS Config, move tài khoản mới vào Production OU → tự động chịu SCP deny như các tài khoản khác.
    🛡️ Ưu điểm: Không thay đổi chính sách lâu dài, chỉ maintenance tạm thời (tạo OU/SCP/move), an toàn và scalable. Không vi phạm nguyên tắc SCP inheritance (denies chỉ áp dụng ở Production).

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

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

  • ❌ Phương án SAI: Remove the organization’s root SCPs that limit access to AWS Config. Create AWS Service Catalog products for the company’s standard AWS Config rules and deploy them throughout the organization, including the new account.
    Giải thích sai: Việc xóa SCP root sẽ làm mất toàn bộ deny list cho tất cả accounts (bao gồm Production OU), dẫn đến mất kiểm soát truy cập dịch vụ bị hạn chế → rủi ro bảo mật cao, không enforce chính sách. AWS Service Catalog dùng để provision products (như EC2 templates), không thay thế SCP để control actions ở organization level. Giải pháp này tạo long-term maintenance lớn (deploy/deploy Catalog khắp nơi) và không giải quyết gốc rễ.

  • ❌ Phương án SAI: Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the new account to the Production OU when adjustments to AWS Config are complete.
    Giải thích sai: Tạo OU Onboarding và gắn SCP allow là tốt tạm thời, nhưng SCP deny ở root vẫn áp dụng cho tất cả child OUs/accounts (SCPs cumulative, explicit deny không thể override bởi allow ở child theo inheritance model). Tài khoản mới vẫn bị chặn update AWS Config. Chỉ move vào Production sau không giải quyết được vấn đề ban đầu, dẫn đến tình trạng "không làm được gì".

  • ❌ Phương án SAI: Convert the organization’s root SCPs from deny list SCPs to allow list SCPs to allow the required services only. Temporarily apply an SCP to the organization’s root that allows AWS Config actions for principals only in the new account.
    Giải thích sai: Chuyển deny list sang allow list ở root rất phức tạp và rủi ro (phải liệt kê explicitly tất cả actions/services được phép → dễ miss, khó maintain lâu dài). SCP không target "principals cụ thể" (như chỉ new account) vì SCP áp dụng cho toàn bộ accounts trong scope, không granular như IAM policies. Giải pháp tạm thời ở root sẽ ảnh hưởng toàn organization, vi phạm yêu cầu "không long-term maintenance" và best practices (AWS recommend deny list cho restricted services).

  • ✅ Phương án ĐÚNG: Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the organization’s root SCP to the Production OU. Move the new account to the Production OU when adjustments to AWS Config are complete.
    Giải thích đúng (tóm tắt): Như đã phân tích ở trên, di chuyển SCP deny từ root xuống Production OU là chìa khóa để root permissive, cho phép Onboarding OU hoạt động tự do tạm thời. Hoàn hảo, không overhead dài hạn!

🎯 Kết luận: Giải pháp đúng tận dụng SCP attachment flexibility và OU hierarchy một cách thông minh, phù hợp DOP-C02 exam (DevOps Professional). Nếu apply thực tế, test SCP effects qua AWS Policy Simulator trước! 🚀

Câu 698
A company is running a two-tier web-based application in an on-premises data center. The application layer consists of a single server running a stateful application. The application connects to a PostgreSQL database running on a separate server. The application’s user base is expected to grow significantly, so the company is migrating the application and database to AWS. The solution will use Amazon Aurora PostgreSQL, Amazon EC2 Auto Scaling, and Elastic Load Balancing.
Which solution will provide a consistent user experience that will allow the application and database tiers to scale?
  1. A Enable Aurora Auto Scaling for Aurora Replicas. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
  2. B Enable Aurora Auto Scaling for Aurora writers. Use an Application Load Balancer with the round robin routing algorithm and sticky sessions enabled.
  3. C Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled.
  4. D Enable Aurora Scaling for Aurora writers. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
Xem giải thích

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

📘 Nội dung câu hỏi được giải thích rõ ràng:
Câu hỏi mô tả một ứng dụng web hai tầng (two-tier) đang chạy on-premises: tầng ứng dụng (application layer) là một server duy nhất chạy ứng dụng stateful (có trạng thái, nghĩa là session người dùng cần được duy trì trên cùng một instance để tránh mất dữ liệu phiên), kết nối với cơ sở dữ liệu PostgreSQL trên server riêng. Công ty dự kiến người dùng tăng mạnh, nên di chuyển lên AWS với Amazon Aurora PostgreSQL (dịch vụ DB managed, hỗ trợ scale cao), Amazon EC2 Auto Scaling (tự động scale instance EC2 cho app layer), và Elastic Load Balancing (ELB) (cân bằng tải).
Mục tiêu chính: Xây dựng giải pháp scale cả tầng ứng dụng (app tier) và tầng cơ sở dữ liệu (DB tier), đồng thời đảm bảo trải nghiệm người dùng nhất quán (consistent user experience) – đặc biệt quan trọng với app stateful, cần sticky sessions để route traffic cùng session về cùng EC2 instance. Giải pháp phải tận dụng tính năng scale tự động của Aurora và ELB phù hợp.

✅ Đáp án đúng:
Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled.

🛠️ Lý do chọn đáp án đúng (dựa trên kiến thức AWS cập nhật 2026):

  • Aurora Auto Scaling for Aurora Replicas: Aurora PostgreSQL hỗ trợ Aurora Auto Scaling (tính năng từ 2019, cập nhật liên tục đến 2026) để tự động thêm/giảm read replicas dựa trên metrics như CPU utilization, connections hoặc custom CloudWatch alarms. Điều này scale reads hiệu quả cho DB tier mà không ảnh hưởng writer (primary instance xử lý writes). App stateful thường read-heavy khi user tăng, nên replicas lý tưởng.
  • Application Load Balancer (ALB) với round robin routing và sticky sessions: ALB (Layer 7) phù hợp web app, hỗ trợ round robin (phân phối đều traffic qua target group), và sticky sessions (dựa trên cookie hoặc duration) để giữ session trên cùng EC2 instance – đảm bảo consistent experience cho app stateful. EC2 Auto Scaling tích hợp hoàn hảo với ALB.
    Kết hợp này scale cả app (EC2 ASG + ALB) và DB (Aurora Replicas AS), nhất quán user experience.

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

🔍 Phân tích tất cả các phương án (giữ nguyên văn bản gốc, giải thích bằng tiếng Việt)

  • ❌ Phương án SAI: Enable Aurora Auto Scaling for Aurora Replicas. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
    Sai vì Network Load Balancer (NLB) là Layer 4 (TCP/UDP), phù hợp TCP traffic cao nhưng kém cho web app HTTP/HTTPS stateful. Least outstanding requests là algorithm của NLB (tối ưu TCP pending requests), nhưng round robin không phải native của NLB (chỉ flow hash hoặc least outstanding). Sticky sessions NLB dựa trên connection tuple (5-tuple), kém linh hoạt hơn ALB cookie-based cho web session. Không đảm bảo consistent routing cho app stateful như ALB.

  • ❌ Phương án SAI: Enable Aurora Auto Scaling for Aurora writers. Use an Application Load Balancer with the round robin routing algorithm and sticky sessions enabled.
    Sai vì Aurora Auto Scaling không hỗ trợ trực tiếp "for Aurora writers". Writer là primary instance duy nhất xử lý writes; scale writer bằng modify instance class hoặc Aurora Serverless v2 (tự động scale capacity 2022-2026), không dùng "Auto Scaling for writers" (thuật ngữ sai). Phần ALB đúng nhưng DB sai làm toàn bộ phương án invalid.

  • ✅ Phương án ĐÚNG: Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled.
    (Đã giải thích chi tiết ở phần trên). Hoàn hảo cho scale reads DB + consistent app stateful.

  • ❌ Phương án SAI: Enable Aurora Scaling for Aurora writers. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
    Sai kép: "Aurora Scaling for Aurora writers" không tồn tại (tương tự sai ở phương án 2, thiếu "Auto" và sai khái niệm). NLB + least outstanding requests không tối ưu web stateful (như phân tích phương án 1). Không scale DB đúng cách, không consistent experience.

🎯 Kết luận: Giải pháp đúng tận dụng read replicas Auto Scaling cho DB (scale horizontal reads) và ALB sticky + round robin cho app stateful + EC2 ASG. Đây là best practice AWS DOP-C02 (DevOps Pro 2026). Nếu implement, monitor bằng CloudWatch + X-Ray! 🚀

Câu 699
A company uses a service to collect metadata from applications that the company hosts on premises. Consumer devices such as TVs and internet radios access the applications. Many older devices do not support certain HTTP headers and exhibit errors when these headers are present in responses. The company has configured an on-premises load balancer to remove the unsupported headers from responses sent to older devices, which the company identified by the User-Agent headers.
The company wants to migrate the service to AWS, adopt serverless technologies, and retain the ability to support the older devices. The company has already migrated the applications into a set of AWS Lambda functions.
Which solution will meet these requirements?
  1. A Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header.
  2. B Create an Amazon API Gateway REST API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header.
  3. C Create an Amazon API Gateway HTTP API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Create a response mapping template to remove the problematic headers based on the value of the User-Agent. Associate the response data mapping with the HTTP API.
  4. D Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a Lambda@Edge function that will remove the problematic headers in response to viewer requests based on the value of the User-Agent header.
Xem giải thích

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

Câu hỏi xoay quanh việc migrate một dịch vụ thu thập metadata từ môi trường on-premises sang AWS, sử dụng công nghệ serverless (ứng dụng đã được chuyển sang AWS Lambda functions), đồng thời giữ nguyên khả năng hỗ trợ các thiết bị cũ (như TV và radio internet) không tương thích với một số HTTP headers.

  • Vấn đề hiện tại: Các thiết bị cũ gặp lỗi khi response chứa headers không hỗ trợ. On-premises load balancer đang loại bỏ (remove) các headers này dựa trên User-Agent header từ client (thiết bị).
  • Yêu cầu AWS:
    • Serverless (Lambda).
    • Xử lý logic loại bỏ headers tại edge (gần client nhất) dựa trên User-Agent để giảm latency và hỗ trợ legacy devices.
    • Dịch vụ là metadata service, được truy cập trực tiếp từ consumer devices, nên cần CDN/edge computing để tối ưu global access.
  • Thách thức chính: Phải kiểm tra User-Agent trong request và modify response headers (remove problematic headers) trước khi gửi đến client, trong khi giữ serverless và scalable.

Giải pháp phải kết hợp edge layer (CloudFront) với routing đến Lambda, vì Lambda thuần không xử lý edge logic tốt (không có native User-Agent inspection tại origin).

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

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

Đáp án đúng: Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header.

Lý do chọn (🛠️ Phân tích chi tiết):

  • CloudFront + ALB + Lambda: Hoàn hảo cho serverless migration. CloudFront làm edge layer (CDN), ALB làm routing managed đến Lambda functions (qua Lambda target groups - feature ổn định từ 2017, cập nhật 2026). Điều này giữ khả năng route đến Lambda đúng loại request.
  • CloudFront Functions (lightweight JS, ra mắt 2020, tối ưu 2026): Chạy tại viewer response event (sau khi response từ origin về edge), kiểm tra User-Agent header (có sẵn trong request context), và remove headers bằng JS đơn giản (e.g., response.headers['X-Problematic'] = [{value: ''}]; hoặc delete).
    • Ưu điểm: Global edge execution, rẻ hơn Lambda@Edge (không replication), <1MB code, latency thấp, lý tưởng cho header manipulation đơn giản.
    • Serverless thuần: Không cần custom code phức tạp, hỗ trợ legacy devices như on-premises LB.
  • Không vi phạm yêu cầu: Migrate serverless (Lambda), retain support cũ.

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

  • ✅ Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header.
    🛠️ Đúng vì: Như phân tích trên. CloudFront Functions chuyên cho viewer response modifications tại edge, inspect User-Agent dễ dàng, serverless & scalable. Hoàn thành migration on-premises LB logic.

  • ❌ Create an Amazon API Gateway REST API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header.
    🛠️ Sai vì: "Default gateway responses" chỉ áp dụng cho lỗi từ API Gateway (4xx/5xx Gateway-generated), KHÔNG modify success responses từ Lambda integration. Không thể remove headers từ Lambda output dựa trên User-Agent (cần integration response mapping templates riêng). Không phải edge CDN cho global devices.

  • ❌ Create an Amazon API Gateway HTTP API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Create a response mapping template to remove the problematic headers based on the value of the User-Agent header. Associate the response data mapping with the HTTP API.
    🛠️ Sai vì: HTTP API (payload v2.0) KHÔNG hỗ trợ mapping templates (khác REST API). Chỉ có request/response passthrough cơ bản, không customize headers dựa trên User-Agent. Feature hạn chế để giữ cheap/fast (docs AWS 2026 xác nhận).

  • ❌ Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a Lambda@Edge function that will remove the problematic headers in response to viewer requests based on the value of the User-Agent header.
    🛠️ Sai vì: Lambda@Edge có thể làm (viewer response event tương tự), nhưng quá nặng cho task đơn giản (full runtime Node.js/Python, replication 2-3 regions, cost cao hơn 10x CloudFront Functions). AWS khuyến nghị CloudFront Functions cho lightweight header mods (docs 2023+). "Viewer requests" có thể nhầm (phải là viewer response cho response headers).

Kết luận 💡: Giải pháp đúng tận dụng CloudFront Functions - feature edge mới nhất, tối ưu serverless cho legacy support! 🚀

Câu 700 Chọn nhiều đáp án
A retail company needs to provide a series of data files to another company, which is its business partner. These files are saved in an Amazon S3 bucket under Account A, which belongs to the retail company. The business partner company wants one of its IAM users, User_DataProcessor, to access the files from its own AWS account (Account B).
Which combination of steps must the companies take so that User_DataProcessor can access the S3 bucket successfully? (Choose two.)
  1. A Turn on the cross-origin resource sharing (CORS) feature for the S3 bucket in Account A.
  2. B In Account A, set the S3 bucket policy to the following:
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::AccountABucketName/*"
    }
  3. C In Account A, set the S3 bucket policy to the following:
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::AccountB:user/User_DataProcessor"
      },
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::AccountABucketName/*"
      ]
    }
  4. D In Account B, set the permissions of User_DataProcessor to the following:
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::AccountABucketName/*"
    }
  5. E In Account B, set the permissions of User_DataProcessor to the following:
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::AccountB:user/User_DataProcessor"
      },
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::AccountABucketName/*"
      ]
    }
Xem giải thích

📘 Phân tích câu hỏi

Một công ty bán lẻ (Account A) cần cung cấp một loạt các tệp dữ liệu cho một công ty đối tác (Account B). Các tệp này được lưu trữ trong một bucket Amazon S3 thuộc Account A. Công ty đối tác muốn một trong những người dùng IAM của họ, User_DataProcessor, có thể truy cập các tệp từ tài khoản AWS của họ (Account B).

🧩 Yêu cầu

Để User_DataProcessor có thể truy cập thành công vào bucket S3, các công ty cần thực hiện một loạt các bước. Chúng ta sẽ phân tích các lựa chọn được cung cấp.

Lựa chọn 1: Turn on the cross-origin resource sharing (CORS) feature for the S3 bucket in Account A.

❌ Sai

CORS (Cross-Origin Resource Sharing) là một cơ chế cho phép các trang web truy cập tài nguyên từ các miền khác. Tuy nhiên, trong trường hợp này, vấn đề không phải là truy cập từ các trang web khác mà là truy cập giữa các tài khoản AWS khác nhau. Vì vậy, bật CORS không phải là giải pháp phù hợp ở đây.

Lựa chọn 2: In Account A, set the S3 bucket policy to allow "s3:GetObject" and "s3:ListBucket" actions without specifying the principal.

❌ Sai

Nếu chỉ đặt chính sách bucket mà không chỉ định principal (chủ thể) được phép thực hiện các hành động, thì bucket S3 sẽ cho phép bất kỳ ai thực hiện các hành động đó. Điều này không an toàn và không phải là yêu cầu của bài toán, vì chỉ User_DataProcessor từ Account B mới cần được cấp quyền.

Lựa chọn 3: In Account A, set the S3 bucket policy to allow "s3:GetObject" and "s3:ListBucket" actions for User_DataProcessor in Account B.

✅ Đúng

Đây là một trong những bước cần thực hiện. Chính sách bucket trong Account A cần được thiết lập để cho phép User_DataProcessor của Account B thực hiện các hành động s3:GetObject và s3:ListBucket trên bucket S3.

{
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::AccountB:user/User_DataProcessor"
  },
  "Action": [
    "s3:GetObject",
    "s3:ListBucket"
  ],
  "Resource": [
    "arn:aws:s3:::AccountABucketName/*"
  ]
}

Lựa chọn 4: In Account B, set the permissions of User_DataProcessor to allow "s3:GetObject" and "s3:ListBucket" actions on the S3 bucket in Account A.

✅ Đúng

Người dùng User_DataProcessor trong Account B cần có quyền để truy cập bucket S3 trong Account A. Tuy nhiên, điều này không thể thực hiện được trực tiếp vì bucket S3 thuộc về Account A và chỉ có thể được quản lý thông qua chính sách của Account A.

{
  "Effect": "Allow",
  "Action": [
    "s3:GetObject",
    "s3:ListBucket"
  ],
  "Resource": "arn:aws:s3:::AccountABucketName/*"
}

Lựa chọn 5: In Account B, set the permissions of User_DataProcessor with an incorrect policy.

❌ Sai

Lựa chọn này bao gồm cả Principal và Resource trong chính sách của User_DataProcessor trong Account B. Tuy nhiên, chính sách này không đúng vì không cần chỉ định Principal trong chính sách của User_DataProcessor.

📘 Tài liệu tham khảo

🧩 Kết luận

Hai bước cần thực hiện để User_DataProcessor có thể truy cập thành công vào bucket S3 là:

  1. Trong Account A: Đặt chính sách bucket S3 để cho phép User_DataProcessor của Account B thực hiện các hành động s3:GetObject và s3:ListBucket.
  2. Trong Account B: Cấp quyền cho User_DataProcessor để thực hiện các hành động s3:GetObject và s3:ListBucket trên bucket S3 thuộc Account A.