Bilbo Baggins
Bilbo Baggins

Reputation: 3019

Deploying ReactJS application on AWS S3 with HTTPS

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

Upvotes: 3

Views: 3040

Answers (2)

Anuj Dhanju
Anuj Dhanju

Reputation: 523

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/

Upvotes: 2

Kush Vyas
Kush Vyas

Reputation: 6099

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..

Upvotes: 1

Related Questions