Bỏ qua tới nội dung
CloudDojo
Phần 6/6 · 4 phút

So sánh các thiết lập CloudFront có tên gần nhau

0/6
Từ khóa của phần nàyChọn một từ để xem nghĩa trước khi đọc

Nhiều thiết lập của CloudFront có tên gần giống nhau; phân biệt được chúng giúp chọn đúng thiết lập cho từng yêu cầu.

Một số thiết lập của CloudFront có tên gần với yêu cầu thực tế nhưng giải quyết một vấn đề khác. Chọn từng mục để xem trường hợp sử dụng, lý do không phù hợp trong tình huống MFTECH tương ứng, và phương án nên chọn:

Price classDùng khi

Giới hạn tập edge location phục vụ distribution theo mức giá tối đa chấp nhận được: PriceClass_100, PriceClass_200 hoặc PriceClass_All. Mặc định CloudFront phục vụ từ edge location ở mọi khu vực. Với price class khác PriceClass_All, CloudFront phục vụ từ edge location có độ trễ thấp nhất trong price class; người dùng ở khu vực bị loại có thể gặp độ trễ cao hơn.

Vì sao không chọn trong tình huống này

MFTECH cần phục vụ ảnh từ S3 và API từ ALB trên cùng một distribution, đồng thời có origin dự phòng. Price class chỉ liên quan tới chi phí và tập edge location, không định tuyến request tới origin.

Phương án phù hợp

Cache behavior theo path pattern (/images/* tới S3, /api/* tới ALB) và origin group cho failover (phần 3).

Ghi nhớ:
  • Price class quyết định chi phí và tập edge location, không định tuyến origin.
  • Origin request policy quyết định thông tin gửi tới origin, không cấp quyền.
  • HTTPS tới origin bảo vệ đường truyền, không giới hạn người xem.
  • Lambda@Edge tuỳ biến request/response tại edge, không tạo tính sẵn sàng cao cho ứng dụng và database.
  • CloudFront không có xác thực Cognito dựng sẵn: xác thực tại edge cần Lambda@Edge; cách ít code nhất là để ALB phía sau xác thực bằng Cognito user pool (bài ELB).
Part 6/6 · 4 phút

CloudFront settings with similar names compared

0/7
Từ khóa của phần nàyChọn một từ để xem nghĩa trước khi đọc

Many CloudFront settings have similar names; telling them apart helps you pick the right one for each requirement.

Some CloudFront settings have names close to a real requirement but solve a different problem. Select each item to see when to use it, why it does not fit the matching MFTECH situation, and what fits instead:

Price classDùng khi

Limits the set of edge locations that serve the distribution to the maximum price you want to pay: PriceClass_100, PriceClass_200 or PriceClass_All. By default CloudFront serves from edge locations in all regions. With a price class other than PriceClass_All, CloudFront serves from the lowest-latency edge location within the price class; viewers in excluded regions may see slower performance.

Vì sao không chọn trong tình huống này

MFTECH must serve images from S3 and the API from an ALB in one distribution, with a standby origin. A price class only concerns cost and the set of edge locations; it does not route requests to origins.

Phương án phù hợp

Cache behaviors by path pattern (/images/* to S3, /api/* to the ALB) and an origin group for failover (part 3).

Ghi nhớ:
  • A price class sets cost and the set of edge locations; it does not route to origins.
  • An origin request policy decides what is sent to the origin; it grants no permission.
  • HTTPS to the origin protects data in transit; it does not restrict viewers.
  • Lambda@Edge customizes requests and responses at the edge; it does not make the application and database highly available.
  • CloudFront has no built-in Cognito authentication: authenticating at the edge needs Lambda@Edge; the least-code option is letting the ALB behind it authenticate with a Cognito user pool (ELB lesson).

Kiểm tra nhanh

Trả lời để ghi nhận đã đọc phần này. Câu trả lời sai sẽ được nhắc ôn lại vào những ngày sau.

Một thành viên đề xuất bật HTTPS từ CloudFront tới origin để chỉ khách hàng đã đăng nhập mới xem được video. Đánh giá nào đúng?
MFTECH muốn giảm chi phí CloudFront bằng cách chỉ dùng một tập edge location. Thiết lập nào phù hợp?

Đã trả lời 0/2 câu