Cloudfront with Latency-Based Routing

0

Okay, I have spent hours trying to figure this out.

I have three cloudfront distributions, us-east-1, eu-west-1 and ap-northeast-2. These point to fargate clusters. This is working fine.

I have been trying to create cloudfront distributions with the same domain name in aliases, but this does not work since you can only have one unique domain per cloudfront. This confuses me because when I set them up with unique names like global-{region}.domain.com and then create the latency based dns, I get this weird error:

This site can’t provide a secure connection. DOMAIN uses an unsupported protocol. ERR_SSL_VERSION_OR_CIPHER_MISMATCH.
Unsupported protocol The client and server don't support a common SSL protocol version or cipher suite.

(Additionally I have configured the latency-based route53 entries pointing to the cloudfront distros)

When I change the domain from the region-specific domain to the global.domain.com, it only can be entered on one cloudfront distro, but it works without the error above. This seems like a red herring because I'm using the latest tls with the cert and the distro. I also tried to refactor with wildcard domains in the aliases, but it didn't work.

I guess I'm confused about how best to do this and really confused why cloudfront can't be configured with the same domain. Technically, to me that makes zero sense. I don't care to know the answer to this since it cannot be done, it just baffles me.

I've gone back and forth a billion different ways to no avail.

I simply want to point global.domain.com with latency-based routing -> 3 regional-based cloudfront distros. I guess I need a little direction on how the stink to do this. :(

I'm using a wildcard cert on all distros *.domain.com. I also tried changing all of the aliases to wildcard domains, but it would only set it on one distro.

Not sure that it matters, but I'm using python pulumi to do this.

3 Answers
1

CloudFront is already a global service with 600+ points of presence around the world - your users will be routed to the closest (in terms of routing) location without you having to do anything else. That's why you don't need to (and why CloudFront won't allow you to) configure more than a single distribution with a specific domain name.

What you probably want to do is have the request from CloudFront to your origin go to the closest AWS region which is hosting your application based on the CloudFront POP where the request landed. If that is the case, check out this blog post.

profile pictureAWS
EXPERT
answered 6 days ago
0

Yeah, I wouldn't say great detail. I've already read that. It was okay, but it didn't get into great detail.

Okay please, please! I've been doing aws stuff for years! Years! It just so happens that I haven't done this specific thing yet. I would appreciate not being spoken to as if I am a neophyte. I already tried to set up all the origins in one cloudfront, but to me it didn't seem like it was working, perhaps it was. There was no indication to me that it was hitting the right origin for cache invalidations.

It would be nice if you answered my specific questions. I don't appreciate a rtfm answer which is what yours was. Here's a link, read that.

Okay, so you said, I need one cloudfront, then you mention route53 latency-based routing. How about, giving me a specific little example of what that looks like with domain.com? All I need is a birds eye view of what to do and I can do it. As I said, I'm doing this in python pulumi, not click ops.

In the requirements I had to add a custom header of region, so I figured that I needed 3 cloudfronts, but either that isn't possible, or there is another way to do things. I'm extremely pissed off that aliases only allow you one unique domain.

Cube
answered 7 days ago
0

haha Okay now I'm confused, it looked like someone answered my question, but now it's gone. wtf

Cube
answered 7 days ago