How to Multiple websites on same S3 bucket using Cloudfornt and Lambda@edge?

0

I have use case were I need to host multiple websites in same s3 bucket. The content is seperated inside the S3 bucket via directories. Ex: S3:abc/app1 S3:abc/app2 It will be access via cloudfront URL The cloudfront URL should be able to fetch d7mb****.cloufront.net/app1 d7mb****.cloufront.net/app2

2回答
0

Have you looked into this? https://dev.to/unfor19/multiple-static-sites-in-a-single-s3-bucket-served-by-cloudfront-3ako? That should give you a good view on how to host individual sites in different “folders” of a single bucket.

If instead looking into microfrontends, I wrote a series which ends up hosting an app shell and multiple frontends in a single CloudFront distribution with a single S3 bucket. Hope you enjoy it/is helpful: https://levelup.gitconnected.com/a-complete-aws-architecture-for-module-federated-micro-frontends-a0306ba466e3 and https://alatech.medium.com/lerna-module-federation-for-aws-micro-frontends-c26ec6610016

profile picture
エキスパート
回答済み 9ヶ月前
0

Hi, thanks for asking this question on re:Post!

You don't necessarily need a Lambda@Edge to rewrite URLs in this case. If the only missing thing is ability to point to multiple index.html files stored under different prefixes on S3 (such as app1, app2), you may use a CloudFront Function to add index.html to request URLs that don’t include a file name. Please let us know if this solves your issue, or provide us with more details about your use case!

AWS
Piotrek
回答済み 9ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ