Answer - B.
The AWS Documentation mentions the following to support this.
Weighted Routing.
Weighted routing lets you associate multiple resources with a single domain name (example.com) or subdomain name (acme.example.com) and choose how much traffic is routed to each resource.
This can be useful for various purposes, including load balancing and testing new versions of software.
To configure weighted routing, you create records that have the same name and type for each of your resources.
You assign each record a relative weight that corresponds with how much traffic you want to send to each resource.
Amazon Route 53 sends traffic to a resource based on the weight that you assign to the record as a proportion of the total weight for all records in the group:
Formula for how much traffic is routed to a given resource:
weight for a specified record/sum of the weights for all records.
For example, if you want to send a tiny portion of your traffic to one resource and the rest to another resource, you might specify weights of 1 and 255
The resource with a weight of 1 gets 1/256th of the traffic (1/1+255), and the other resource gets 255/256ths (255/1+255)
You can gradually change the balance by changing the weights.
If you want to stop sending traffic to a resource, you can change the weight for that record to 0.
Options A and C is incorrect since this would cause a full flown deployment of the new app and is just a maintenance overhead to port the application to a new service environment.
Option D is incorrect since this should only be used for failover conditions.
For more information on the weighted routing policy, please refer to the below Link-
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted
The best answer to achieve this task is B. Use Route 53 weighted routing policies.
Explanation:
Weighted Routing policies allow you to distribute traffic across multiple resources, such as web servers or Amazon EC2 instances, in proportions that you specify. You can use this feature to perform A/B testing of your new application by routing a portion of the traffic to the new application while keeping the rest of the traffic on the existing application.
To do this, you need to follow these steps:
Deploy the new version of the application to a new set of servers or EC2 instances.
Create a new record set in Route 53 for the new version of the application.
Create a weighted routing policy in Route 53 that points to both the old and new record sets.
Specify the proportion of traffic that should be sent to each record set.
For example, you can configure the weighted routing policy to send 80% of the traffic to the old record set and 20% of the traffic to the new record set.
Wait for DNS propagation to complete.
Test the new version of the application using the new record set's DNS name.
Note: It's important to keep in mind that Route 53 doesn't support session affinity, so users may end up switching between the old and new versions of the application if they refresh their browser or use multiple tabs.
Option A. Elastic Beanstalk with Swap URL feature: The Swap URL feature of Elastic Beanstalk allows you to deploy a new version of an application to a separate environment, test it, and then swap the URLs of the environments to make the new version live. However, this is not the best solution in this case because it involves creating a separate environment and can take a longer time to deploy the new version. Additionally, it requires you to manage two separate environments, which may not be ideal for testing purposes.
Option C. Port the application onto Opswork by creating a new stack: Opswork is a configuration management service that allows you to create stacks of AWS resources, such as EC2 instances, load balancers, and databases. While it is possible to create a new stack in Opswork for the new version of the application, it is not the best solution for testing purposes. This is because creating a new stack is time-consuming and can be complicated to set up. Additionally, it may require you to duplicate existing resources, which can be expensive.
Option D. Use Route 53 failover Routing policies: Failover routing policies are used to route traffic to a secondary resource, such as a backup server or site, in case the primary resource becomes unavailable. While it is possible to use failover routing policies to test a new version of an application, it is not the best solution in this case. This is because failover routing policies are designed for high availability rather than testing purposes. Additionally, failover routing policies can take time to propagate, which may not be ideal for testing purposes.