SAP-C02 · Question #89
A company is hosting a single-page web application in the AWS Cloud. The company is using Amazon CloudFront to reach its goal audience. The CloudFront distribution has an Amazon S3 bucket that is conf
The correct answer is A. Create a second CloudFront distribution for the new version of the application. Update the Route. To implement a canary deployment strategy for a single-page web application served by CloudFront from an S3 origin, the recommended approach is to create a second CloudFront distribution for the new application version. Then, use Amazon Route 53's weighted routing policy to direc
Question
A company is hosting a single-page web application in the AWS Cloud. The company is using Amazon CloudFront to reach its goal audience. The CloudFront distribution has an Amazon S3 bucket that is configured as its origin. The static files for the web application are stored in this S3 bucket. The company has used a simple routing policy to configure an Amazon Route S3 A record. The record points to the CloudFront distribution. The company wants to use a canary deployment release strategy for new versions of the application. What should a solutions architect recommend to meet these requirements?
Options
- ACreate a second CloudFront distribution for the new version of the application. Update the Route
- BCreate a Lambda@Edge function. Configure the function to implement a weighting algorithm and
- CCreate a second S3 bucket and a second CloudFront origin for the new S3 bucket. Create a
- DCreate two Lambda@Edge functions. Use each function to serve one of the application versions.
How the community answered
(21 responses)- A62% (13)
- B24% (5)
- C10% (2)
- D5% (1)
Why each option
To implement a canary deployment strategy for a single-page web application served by CloudFront from an S3 origin, the recommended approach is to create a second CloudFront distribution for the new application version. Then, use Amazon Route 53's weighted routing policy to direct a controlled percentage of traffic to the new CloudFront distribution while the majority continues to serve the old version.
Creating a second CloudFront distribution for the new version of the application allows for independent deployment and serving of the updated static files. By then updating the Amazon Route 53 A record with a weighted routing policy, traffic can be precisely split between the two CloudFront distributions (old and new versions), enabling a controlled canary release.
While Lambda@Edge can modify requests, implementing a complex weighted routing algorithm directly within a Lambda@Edge function for canary deployments of static content is less efficient and more complex than leveraging Amazon Route 53's native weighted routing capabilities, which are designed for this exact purpose.
This option correctly describes setting up the infrastructure for a new version (second S3, second origin), but then proposes using Lambda@Edge to forward headers/cookies for traffic splitting. This is not the standard or most efficient way to perform weighted canary routing of static websites, as Route 53's weighted routing is more suitable for directing traffic to different CloudFront distributions.
Lambda@Edge functions are designed for modifying requests and responses at the edge, not for directly serving or hosting entire web application versions from scratch, as the static files for the application reside in S3 and are served via CloudFront.
Concept tested: Canary deployments using Route 53 weighted routing and CloudFront
Source: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html
Community Discussion
No community discussion yet for this question.