34
loading...
This website collects cookies to deliver better user experience
Hands-On in 11 simple steps
So let’s start the hands on part:
Let’s go to AWS, make sure you login, and access the AWS Management Console, where you can see the all the products or type for a specific product in AWS.
Let’s go and search for route53 and access it!
Look at the side menu on the left, and go to domains, and under this title there should be a registered domains, now if you don’t have a domain yet then nothing will appear, so we need to create one!
If you have the domain you can skip this step, if not, click on register domain.
Write your target domain name and click next, pick an available one, and press next and very and purchase, complete the order. Check your email.
Let’s go back to Route 53 and create a hosted zone.
In the form to create a hosted zone, write the name of your domain like .com
Hit the Create Hosted Zone button.
Now you should see two A records, one of type NS and one of type SOA.
Take the values from NS and past these values into a notepad or equivalent.
Associate your domain the route 53. On Route 53, go back to that side menu on the left, where it says Domains, and go to the sub link called Registered domains. Click on your domain. Click on add or edit name servers. And paste the ones you have on the notepad, you have to past 1 by one. Save that. Wait a few minutes and look at your email, you will get a notification update email. Check after a few minutes and after the email if the values have been updated.
Creating the s3 bucket: Search for the s3 service on aws. Go to S3. Create a Bucket. Give it a globally unique name. Remove the checkbox for block all public access. Enable server side encryption. Choose Amazon S3 key (SSE-S3) Save your new bucket.
Upload your app code into your s3 bucket. As always if you are using a react or angular app, make sure to build to production and then upload the inside of the resulting folder to your s3 bucket, here you will make the bucket public if you didn’t before and you also need to add a bucket policy.
Use the AWS generator for this here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html
Copy the policy! Make sure to replace your bucket name on example.com! From the auto generated from aws. Save the bucket policy.
Enable Static Website Hosting: Keep scrolling down and in static website hosting, choose enable, in index document add “index.html”, if you have an error page add it on error document, if you don’t have one just type “index.html” as well on it. And save. You will now have a generated endpoint, click on it to see if everything is fine with your app/index.html page.
Add Https
Type Certificate Manager in aws services search bar. Open it. Click on request a certificate, add your target domain name. The one you bought earlier. You can either choose Email or DNS validation. If you choose DNS, click on validation, and you will see a record of type CNAME and a button to create a record in route 53. Click on that. If you choose email you will get the same value for CNAME by email and then you can create it manually on route 53.
Go back to route 53 and double check your CNAME. You should have the certificate value.
Last Step: Use CloudFront
Search for CloudFront. Go to CloudFront.