How to add SSL certificate on running your application using Route 53.
In this blog, I have explained how generate SSL certificate and how add that certificate in your application.
There are many third party tools available in which to purchase free domain. I have purchased a domain from freenom. My domain name is harshilv.cf .
Now you have to host static websites via Amazon s3. In the image below I have paste the url of s3 where I host my website.
Now create a hosted zone. For that search Route 53 and on the left side click on the hosted zone. Enter your domain name and press the created hosted zone.
You can see there are two records created by default. Now copy all four name servers and paste that in freenom.
Now create an SSL certificate. For that search Amazon certificate manager and click on request SSL. Choose to request a public certificate and press next. Enter your domain name and click on request. Now go inside the certificate and press create record in route 53 and create new CNAME record.
Go check whether CNAME is there or not in the hosted zone.
Now created cloudfront. For that select create distribution, in origin name select endpoint of s3, after that in viewer choose the redirect HTTP to HTTPS, in setting option add your domain in CNAME section and also add SSL certificate which you have created early.
Now paste endpoint of cloudfront in your browser.
But still not access the domain name because of not adding cloudfront in the hosted zone.
So now create a new record and add the endpoint of cloudfront. For that click on new record and enable alias, choose cloudfront distribution and select endpoint of cloudfront.
Now hit your domain name see what happen !!
If you want to check it is correct or not then press Fn+12 and check server name.
Happy Clouding !!!