Swapping an environment CNAME
Every environment that you stand up with Elastic Beanstalk gets a unique CNAME. These CNAMEs are useful when you manage your deployment using the blue/green deployment strategy, as there is a need for you to swap the URLs, or you may want to route traffic based on the weighted routing policy in Route 53. The Set-EBEnvironmentCNAME
cmdlet lets you swap the CNAME of two environments. Let's plan to switch the CNAME of the two environment that we created in this chapter. You can do this as follows:
PS D:\scripts> Set-EBEnvironmentCNAME -SourceEnvironmentId "e-vncgsvupfb" -SourceEnvironmentName "prd-WebWorldPressApp" -DestinationEnvironmentId "e-s3b62feki2" -DestinationEnvironmentName "dev-WebWorldPressApp"

Note
Note that, when you have a production environment and there is a need for you to swap URLs, you should ensure that the DNS cache does not create issues for your user. Some browsers do not respect TTL defined in the DNS configuration, resulting in weird and...