In Api Gateway I've created one custom domain, foo.example.com
, which creates a Cloud Front distribution with that CNAME
.
I also want to create a wildcard domain, *.example.com
, but when attempting to create it, CloudFront throws an error:
CNAMEAlreadyExistsException: One or more of the CNAMEs you provided are already associated with a different resource
AWS in its docs states that:
However, you can add a wildcard alternate domain name, such as *.example.com, that includes (that overlaps with) a non-wildcard alternate domain name, such as www.example.com. Overlapping domain names can be in the same distribution or in separate distributions as long as both distributions were created by using the same AWS account.
So I might have misunderstood this, is it possible to accomplish what I've described?