Route 53 to route traffic to an S3 bucket , when both the services are in different AWS accounts.
A very complicated title with a short and sweet implementation.
My current scenario deals with having 2 different accounts on AWS .
Here , I assume that you have a Hosted Zone created and a S3 bucket with Static Web Hosting enabled .
Account 1- Has a Hosted Zone in Route 53.
Account 2- Has an S3 bucket with static web hosting enabled.
- Will start with Route 53 , click the services drop down from the AWS Console and select Route 53 which is placed under Networking & Content Delivery.
- Click on the Hosted Zones , from the left navigation pane.
- Select the hosted zone that has the domain name that you want to use to route traffic to your S3 bucket.
- The “Go to Record Sets” button is disabled in the above image since I had not selected the hosted zone .
- Once you select a Hosted Zone , the option would be enabled for you to select .
- On clicking , it will show you all the record sets for the selected Hosted Zone .
- You can select “Create Record Set” .
- Next you need to add these details :
- Name : The domain name that you wish to use to route traffic to S3 bucket . The default being your hosted zone name .
Hosted Zone name : “test.com”
S3 bucket name : “dummy.test.com”
Record name : “dummy”
2. Type : Select A-IPv4 Address from the drop down.
3. Alias : Choose Yes.
4. Alias Target : The region where your S3 bucket is located .You can get the exact name of the region from the Website Endpoint column in the Amazon Simple Storage Service Website Endpoints . (My S3 bucket is located in Asia Pacific (Mumbai) and it corresponds to : s3-website.ap-south-1.amazonaws.com)
5. Routing Policy : Choose the one which is applicable .
6. Evaluate Target Health : Keep it as default.
7. Choose Create.
According to the AWS Documentation , the changes generally propagate to all Route 53 servers within 60 seconds , but for me it took couple of minutes .
If everything is configured correctly , Route 53 would start routing traffic to your S3 bucket.
With this , we are good to go .
Please get in touch in case of any queries …
Thanks.