Reputation: 11
My cloudfront distribution have "*.example.com"
as CNAMEs and a loadbalancer as origin.
I route traffic from my route53 records directly to my cloudfront distribution domain name.
Some records have subsubdomain named randomly. So they look like this: "sub1.sub2.example.com"
, "sub3.sub4.example.com"
.
I don't know if it is ok because sub1 and sub3 are subsubdomain so they are not contain in "*.example.com"
.
Will it work ? By working i mean: The traffic sent to my records will be sent to cloudfront then to my loadbalancer without any issue?
edit: sub3 and sub4 are random.
Upvotes: 1
Views: 314
Reputation: 11
See Using Custom URLs for Files by Adding Alternate Domain Names (CNAMEs) and CNAME Wildcard support for Amazon CloudFront
The CloudFront distribution can be configured to handle alternate domains. This could be "*.example.com" for all subdomains and should cover the sub sub domains as well. Alternatively, you should be able to setup "*.sub2.example.com, *.sub4.example.com" if only the sub sub domain varies randomly.
In addition, CNAME records need to be setup in Route53 to resolve "*.example.com" to your CloudFront distribution.
Also worth noting that if you are using HTTPS alternate domain names must be covered by valid SSL/TLS certificates
Upvotes: 1