Reputation: 269
Is it possible for an application load balancer to route to an s3 bucket to host a static website? The same alb would also route to apigateway via a vpc endpoint.
Upvotes: 3
Views: 3292
Reputation: 343
It's possible with vpc 3s interface endpoint.
Major problem with this approach through is that interface endpoint uses s3 REST API. Which means that you couldn't specify fallback to your index.html
in case of 404 errors. This means that if you host your SPA code and user enter in a browser host:port/some/logical/path/within/your/app
you will get XML 403 or 404 error instead of served index.html
.
And this problem makes this feature almost non-usable, if you have a requirement to allow bootstarp of your apps from deep links
Upvotes: 4
Reputation: 105
As far as I know, this isn't possible.
Take a look at Cloudfront instead: https://docs.aws.amazon.com/cloudfront/index.html
Use your S3 bucket and the ALB as origins in your setup.
Upvotes: 3