Using AWS traffic policy to setup weighted routing from a DNS record to two CloudFront distributions


I'm not sure if it just isn't possible, but why is it an option in the flow if it wasn't? I think the other option I saw was to setup a Lambda@edge function, but some of the material I've seen on it seemed a little complex. Any guidance will help!

I've set the before mentioned traffic policy and set the Type A DNS value, but it doesn't seem to be evenly splitting the traffic between the two cloudfront distributions.

Enter image description here

1 Answer

You may encounter an issue when it comes down to SSL. You will have an alias record in a route53 zone which points to a cloudfront distrubtion. The problem is that you will need to create an alternate domain name on the distrubtion. You cant use an alternate domain name on more than one distrubtion.

Im curious to why you would want to have a DNS Name that points to 2 distrubtion's which is a global service?

profile picture
answered 9 months ago
  • I do actually have alternate domains setup on each cloudfront distribution. The reason why I'm trying to set it up like this is because it's the only way I could think of setting up 50/50 weighted routing between two CF distributions. Is there another way to set things up so that when I try to access that it evenly routes traffic between two CF distributions?

  • Do you have the same alternative name on both CF distros because that wasn’t allowed previously? Curious how it works when someone resolves to be sent to 2 x CF distro where only one can have the alternative name of ? This would become and issue when using https Why do you want 2 CF’s. Curious.

  • Different alternative names on each. So how the traffic policy is set up, lets say the start point is It should route half the traffic to the existing CF distro which also has the name and the other half to the newly created CF distro called The end goal here is a blue/green deployment so that the user can get either the existing or new CF distro when going to

  • Thanks for the insight.. Can I assume this is HTTP?

  • No, I have SSL cert set up on both CF distros. Would this be an issue?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions