Soru

Zorluk: OrtaDeployment Strategy Design

A company is designing a deployment pipeline for a single-page web application (SPA) hosted on Amazon S3 and served via Amazon CloudFront. The development team wants to implement a canary deployment strategy where 10%10\% of live user traffic is routed to a new version of the frontend hosted in a separate S3 bucket. The traffic must be monitored for 3030 minutes. If no errors are detected, the deployment must complete by serving the new version to all users. If errors are detected, the traffic must immediately revert to the original version.

Which two actions should the solutions architect take to configure this deployment strategy? (Select two.)

  1. Create a staging CloudFront distribution that points to the new S3 bucket origin.Cevap
  2. Create a continuous deployment policy on the primary CloudFront distribution to route 10%10\% of live traffic to the staging distribution, and promote the staging distribution to primary once validated.Cevap
  3. C
    Configure an Amazon Route 53 weighted routing policy to split traffic 90/1090/10 between the primary distribution and a new standalone primary distribution pointing to the new S3 bucket.
  4. D
    Configure a CloudFront origin group with the primary origin pointing to the existing S3 bucket and the secondary origin pointing to the new S3 bucket, setting failover criteria to trigger on 4xx4\text{xx} or 5xx5\text{xx} errors.
  5. E
    Create an AWS Lambda@Edge function associated with the primary distribution's Viewer Request event to randomly rewrite the request URI to the new S3 bucket for 10%10\% of the incoming requests.

Cevap

Create a staging CloudFront distribution that points to the new S3 bucket origin, and create a continuous deployment policy on the primary CloudFront distribution to route 10%10\% of live traffic to the staging distribution, promoting the staging distribution to primary once validated.
To implement a canary deployment on CloudFront, the solutions architect should use CloudFront's native continuous deployment feature. This requires creating a staging distribution pointing to the new version's S3 bucket, and then configuring a continuous deployment policy on the primary distribution to route 10%10\% of traffic to the staging distribution. Once validated, promoting the staging distribution updates the primary distribution for all users.

Adım Adım Çözüm

1
Set up a staging CloudFront distribution.
A staging distribution is created as a child of the primary distribution, pointing to the new S3 bucket containing the updated frontend code.
CloudFront continuous deployment requires a staging distribution to hold the new configuration and origin settings for validation before promotion.
2
Configure the continuous deployment policy on the primary distribution.
A policy is attached to the primary distribution, specifying a 10%10\% traffic weight routed to the staging distribution ID.
This establishes the canary routing pattern, safely directing a fraction of production traffic to the new version without affecting the rest of the users.
3
Validate the deployment and promote the staging distribution.
If validation succeeds, the staging distribution is promoted, causing its configuration to overwrite the primary distribution. If validation fails, the policy is detached or modified, immediately reverting all traffic to the original origin.
Promotion seamlessly updates the main distribution's configuration for all users, while detaching the policy provides an instantaneous rollback mechanism that bypasses DNS propagation delays.

Anahtar Kavram

CloudFront Continuous Deployment
Bu soruyu puanla