Need to do white-labeling which is based on domain used, we have just one CloudFront distribution though, any ideas on how to handle SSL certificates when a new customer is added? Is my only option always to create a new ACM certificate with the exis

Our white-labeling is quite simple, it’s only style changes, not really a multi-tenant application, all users still share the DB access and this is not a problem.

So far we have in the CF distribution:

ourcompany.com
*.ourcompany.com
example1.com

But let’s say that now example2.org is becoming a new customer. I now have to re-create the ACM certificate with the existing list I had plus the new one, and replace it in the CF distrib. Is this the best/unique solution to this problem? As there’s no such thing in CloudFront as multiple certificates in the same distribution.

We don’t expect the number of domains to grow much larger than a few dozen (so the (apparent) hard-limit of AWS of 100 domain names upon quote increase request is sufficient).

this seems wrong but I don’t know why

What about offering a subdomain?

You should offer ONLY subdomains to your customers, the way every other SaaS on this planet is doing, as in:

Then, you just need a star certificate and you route/process the requests based on host header in your app.

Is there a particular reason you don’t want to make another distribution? The cost should be about the same either way.

Yeah and if you set it up as IAC, it’s just another var set.

Offering custom domains for SaaS is very common

I’d add a new distribution per customer, but keep your wildcard subdomain under a single distribution as well.

Distributions don’t have cost, so just make a new one

Are you really proposing to have a single cert for *.ourcompany.com, *.example1.com, and *.example2.org? That’s a terrible idea.

You could maybe limit it with subdomains but your blast radius for any problems is huge.

No, for the customers it would be limited to a subdomain.

For CloudFront, you can attach a single cert with up to 100 SANs, but this isn’t great because you will leak your other customers in the cert every time someone visits the site, which looks tacky as well as possibly being a slight security/visibility concern for your other customers.

You’re better off making one distro per customer, as was already recommended. Multiple distributions can front the same origin, so your cost will be flat compared to trying to fit everything into a single cert.

Then it’s not a SaaS.

It’s a PaaS masquerading as a SaaS.

Shopify, Teachable, Podia, Shootproof, Wordpress, Ghost…? Literally the very definition of saas

Makes sense.

Going to shut up now :grinning_face:

This is the right answer. We have 28K+ Cloudfront distributions. We never share domain names on a single cloudfront distro. The cert management would be incredibly annoying. Also, tracking traffic is way easier with it split out.

Everyone’s mentioned new CF distributions…

Depending on what you are doing using (Caddy)[https://caddyserver.com/] could be an option. It does force you to do SSL term on the box which is not great, but it also lets you have someone point a CNAME at you and boom, working domain.

Outside of that, you could create a ACM cert programatically and tell them what DNS records to create to enable that, and then (using IAC or a simple script) create the CF distribution or API gateway or whatever you need.

You can create more CF distributions for each domain, or you could use a service like approximated.app if you’d rather have a service dedicated to it.