0

How can I dynamically add and remove domains (root domains and subdomains) from a CloudFront distribution without creating new ACM certificate for all the domains each time there's a change with the domains I want to allow CloudFront to serve?

Is there maybe a way to move the logic of the allowed domains away from CloudFront to some other service where it'd be easier to manage such use case? I don't even mind allowing all domains on the internet to point to my CloudFront distribution, because due to the nature of my web app any unapproved domains would already be block from serving any content and would only be able to serve an error page of the app.

Right now I'm just trying to understand how to do it from the AWS dashboard and after I figure it out I'll try to do the same actions programmatically, so for now I'm just looking for help with the logical part of the issue, not with coding the solution :)

123
  • 127
  • 3
  • 18

1 Answers1

0

You cannot escape the creation of a certificate for all root domains.

You can use a wildcard alternate domain as described at alternate-domain-names-wildcard.
ex. *.mydomain.com

In this case you can redirect multiple subdomains to your Cloudfront distribution without the need to create a new certificate.

MarcC
  • 413
  • 3
  • 12