How it works...

This template focuses on utilizing the features of a Route 53 record set group, and the most useful properties have been parameterized.

The value for your DomainName parameter will be created as multiple CNAME records in your hosted zone (as set in HostedZoneName), one for each of your resources, old and new.

The OldResource and NewResource parameters represent the target domain names that the incoming requests will be shared between.

Once the stack is deployed, you will be able to go to your domain name and see your old resource. By default, this template will send all traffic to the old resource endpoint.

Once you've verified the setup is working correctly, you can start to deploy by updating the stack to send some of your requests to the new resource.

Changing the resource record set's weightings via the CLI is quite involved, as it requires passing a complex JSON object as an argument. It is much simpler and safer to simply update the existing CloudFormation stack you deployed, changing just the weighting parameters that are already present.

With the update-stack command, the new weightings will be propagated to your record set group members (without interruption) and the new distribution of traffic will start taking effect.

For the parameters without default values, you must explicitly tell CloudFormation to use the previous values, as well as the template body supplied previously.

Remember that the distribution will be determined by the target's weight divided by the total weight value of all targets. This means you can easily turn off a target by setting its weight to 0, regardless of the other weight values. In this recipe, we have used 0 and 1 as simple values to illustrate the impact, but you can (and should) use more fine-grained parameters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset