3

I want to deploy a ReactJS application on the AWS S3 (which I managed to do successfully). Now I need to make it HTTPS with lowest cost possible. How can I do this? A quick google search gave me something called Amazon CloudFront I am confused over there that do I need to have a Dedicated IP SSL Certificate to deploy my react application with HTTPS ?

I have referred to this question on deployment with S3.

Thanks

Bilbo Baggins
  • 2,899
  • 10
  • 52
  • 77
  • 1
    Maybe this link helps you out on how to set up CloudFront https://www.h3xed.com/web-development/using-https-with-amazon-s3-and-your-domain – Marco Jan 30 '18 at 07:46

2 Answers2

2

If you are trying to find things in detail, You can have a quick look here. Its just 2 minute reading and cover following things.

  • React Js deployment with Https cloud front
  • Subdomain
  • Configure AWS CLI and deploy build through command

https://bluebash.co/blog/react-deployment-with-aws-ssl-https-with-subdomain/

Anuj Dhanju
  • 523
  • 3
  • 13
1

Answer to Why We need to use Cloudfront is :

Note: We need to do this because SSL certificates can only be assigned to cloudfront distributions or AWS ELB, so you need to create one to enable SSL for your static website.

There are few steps involved in this , assuming you have site properly set up with HTTP end working here are some steps :

1) You need to Request SSL Certifcate from AWS (ACM) it is free and you would not be chraged for this you follow this AWS Documentation

  • Enter one or more domain names, you want to create a SSL certificate for. You can even use a wildcard.
  • Verify the email you will get to email address associated witht the domain.

Note: Choose Region as per your s3 bucket as Cloudfront only accepts certificates hosted in region us-east-1

2) Now you need to create Cloudfront Distribution :

  • Create a new Web distribution and select your S3 bucket as Origin Domain Name. Select HTTPS Only for Viewer Protocol Policy.
  • In the Distribution Settings section enter your domain name you want to host your static files on.
  • Beside that keep all the default settings and click “Create distribution”.

3) Now Assign the SSL certificate to your Cloudfront distribution

  • Go back to Cloudfront and edit your distribution. Now you should be able to select your brand new SSL certificate. Select Custom SSL

Hope This Helps..

Kush Vyas
  • 5,813
  • 2
  • 26
  • 36
  • Thanks for the detailed answer.. can you please explain when I will be needing Dedicated IP SSL certificates (as the cost is too high for this). – Bilbo Baggins Jan 30 '18 at 09:51
  • The certificate issued by AWS are free and you do not need dedicated ip as it is attached to cloudfront , to minimize the cost you can limit cloudfront distribution to particular region. – Kush Vyas Jan 30 '18 at 10:36
  • But does this mean that my application would be accessed only from that particular region ? – Bilbo Baggins Jan 30 '18 at 10:41
  • Nope You can read about CDN , its Content Delivery Network that means if enabled if some one for example accessing your site from India and you hosted it in US Region , the CDN will have cached copy of and will be served to me from Mumbai Region or other edge location which is near to me. CDN (Cloudfront) in your case necessary because you are using AWS SSL and it can only be attachd to Cloudfront and AWS ELB m your site can be accessd from anywhere in world. – Kush Vyas Jan 30 '18 at 10:44
  • ohk, thank you very much for this answer and your time :) – Bilbo Baggins Jan 30 '18 at 10:45
  • Cheers , No Worries brother! – Kush Vyas Jan 30 '18 at 12:43