1
votes

My website abc.domain.com is hosted on EC2.

In cloudfront I put abc.domain.com in the “Origin Domain Name” field and the "Alternate Domain Names (CNAMEs)" field.

Origin Domain Name: abc.domain.com

Alternate Domain Names (CNAMEs): abc.domain.com

The “Domain Name” of this distribution is xxx.cloudfront.net. In route53 I setup ALIAS A record with abc.domain.com point to xxx.cloudfront.net.

The problem is that with abc.domain.com point to xxx.cloudfront.net, route53 will not allow me to make another A record with abc.domain.com point to the IP of this EC2 so the "Origin Domain Name: abc.domain.com" will not work.

========================== Possible Solution =====================

Origin Domain Name: abc2.domain.com

Alternate Domain Names (CNAMEs): abc.domain.com

In route53 Setup ALIAS A record with abc.domain.com point to xxx.cloudfront.net.

In route53 make abc2.domain.com point to the IP of this EC2 so the "Origin Domain Name: abc2.domain.com" will work.

1
stackoverflow.com/help/someone-answers Help by voting and accepting answer if its worksaviboy2006

1 Answers

1
votes

If you have to use CloudFront+ EC2+ Route53 for domain abc.domain.com then you required below :

  1. Create ELB( Elastic load balancing ) with EC2
  2. Then you map your CloudFront to ELB point.
  3. In Route53 mappend your CloudFront.

Step which you following is will not allow you to create duplicate record entry. This is mandatory to use ELB if you want to use CloudFront with EC2.

If you dont want to use ELB then another option is purchase SSL certificate from external vendor and install it in EC2. Then you can directly point EC2 Ip to Route53. In this you don't require CloudFront.

Ask if you have any doubt.