I have created a hosted zone: "abc.com" and 2 s3 buckets: "app1.abc.com" and "app2.abc.com" with respective index.html. I am able to accesss individual default s3 website successfully (ex: app1.abc.com.s3-website-ap-southeast-1.amazonaws.com and app2.abc.com.s3-website-ap-southeast-1.amazonaws.com)
Now, How to create record sets to redirect traffic lets say if "app1.abc.com" called, then index.html of "app1.abc.com" bucket should be accessed. If "app2.abc.com" called, then index.html of "app2.abc.com" bucket should be accessed.
Is it possible to do with s3 and route53? If not any other ways to redirect traffic based on url to s3 bucket?
I went through documentation but no clue. Appreciate for help.
You simply need to create a CNAME record that point app1.abc.com
to app1.abc.com.s3-website-ap-southeast-1.amazonaws.com
. The procedure is the same for the second bucket.
For documentation, see https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs