Reputation: 566
I have an aws s3 bucket at bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder/
I want to route a domain directly to the sub-folder /subfolder/static-site-folder/
This is because I want to have multiple static sites on a single bucket.
So I want something like this
example-domain.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-1/
example-domain-2.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-2/
example-domain-3.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-3/
Are there any solutions in aws? Or is my only option to setup a proxy server with Kubernetes to route traffic?
Upvotes: 1
Views: 2174
Reputation: 238837
Domain Name System (DNS) web service providers, such as Route53, do not "see" your folders. They only operate at the domain level, but url paths.
Probably the easiest way to achieve what you want would be by setting up CloudFront distro for your S3 and specifiyign Origin Path
for your folder:
If you want CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin, enter the directory name here, beginning with a /. CloudFront appends the directory name to the value of Origin Domain Name when forwarding the request to your origin, for example, myawsbucket/production. Do not include a / at the end of the directory name.
Upvotes: 1