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

0

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
0

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
EXPERT
answered 7 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 www.example.com 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 www.example.com to be sent to 2 x CF distro where only one can have the alternative name of www.example.com ? 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 example.com. It should route half the traffic to the existing CF distro which also has the name example.com and the other half to the newly created CF distro called qa-example.com. 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 example.com

  • 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