Hosting static website with AWS S3 and Route 53

+1 vote

 I currently have website www.myblog.com (entirely static) on a dedicated server and I want to switch to AWS. So far I have done the following:

  • Create bucket www.a.com, give proper permission to make it visible for public and uploaded all files
  • created Hosted Zone in AWS Route 53 and automatically got two Record Sets, NS and SOA. Next, I added a CNAME for *.myblog.com
Question is now, what do I add for an A record? I don't have an IP

Dec 4, 2018 in AWS by datageek
• 3,090 points
1,106 views

1 answer to this question.

+1 vote

Add an additional bucket called myblog.com and working off of that, don't delete www.myblog.com though, you'll later add a CNAME to that so www.myblog.com redirects to myblog.com in the browser.

Now that you've created the myblog.com bucket, go to Properties > Static Website Hosting > Enable Website Hosting > enter index.html and upload a file with that name to your bucket.

Then go Properties > Permissions > Edit Bucket Policy > Paste the code below:

{
  "Version":"2008-10-17",
  "Statement":[{
    "Sid":"PublicReadForGetBucketObjects",
        "Effect":"Allow",
      "Principal": {
            "AWS": "*"
         },
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::example-bucket/*"
      ]
    }
  ]
}

Change {example-bucket} to {myblog.com} and save.

Now go to Route53 > Select your domain > Go to record sets > create record set

Make sure 'Type' is set to 'A' and then select 'Yes' next to 'Alias'. Click into the Alias Target area and under S3 websites you should now see a.com. Select it and then at the bottom choose 'Create record set'.

It should work now!

answered Dec 4, 2018 by Archana
• 5,640 points

Related Questions In AWS

0 votes
1 answer

S3 Static Website Hosting Route All Paths to Index.html

Yes there is an easy way to ...READ MORE

answered Apr 8, 2018 in AWS by code_ninja
• 6,300 points
3,450 views
0 votes
1 answer

Cannot access AWS domain purchased with Route 53

You will need to start by creating ...READ MORE

answered Sep 14, 2018 in AWS by Priyaj
• 58,020 points
838 views
0 votes
1 answer

Cannot access AWS domain purchased with Route 53

You will need to start by creating ...READ MORE

answered Sep 17, 2018 in AWS by Priyaj
• 58,020 points
545 views
+6 votes
3 answers
+1 vote
2 answers

AWS CloudWatch Logs in Docker

The awslogs works without using ECS. you need to configure ...READ MORE

answered Sep 7, 2018 in AWS by bug_seeker
• 15,510 points
2,057 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,731 views
0 votes
1 answer

How can I just increase the size of my root disk on AWS EC2 for use with Elastic Beanstalk?

This can be done using the following ...READ MORE

answered Nov 12, 2018 in AWS by Archana
• 5,640 points
3,294 views
0 votes
1 answer

Database with AWS Ealstic Beanstalk

Elastic Beanstalk can automatically provision an Amazon ...READ MORE

answered Nov 21, 2018 in AWS by Archana
• 5,640 points
693 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP