[英]Why would you use AWS Lambda/API Gateway to serve up HTML content vs. S3 bucket for serverless architecture
[英]AWS API Gateway Serve S3 Content and Lambda
我用ACM创建了一个SSL证书。 我想使用此证书来提供来自S3存储桶和我的lambdas的静态内容。 目前,我希望避免使用CloudFront并使用API网关代理S3和Lambda,以便从单个SSL域提供所有内容(无CORS问题)。
理想情况下,我会打电话:
https://my.customdomain.com/ (lambda redirects to /web/index.html)
https://my.customdomain.com/api/* (lambdas)
https://my.customdomain.com/web/* (static content - s3)
上述架构是否合理/可行?
是的,架构是可行的。
API Gateway具有此目标。 作为未向客户公开的后端服务的网关 。 与API Gateway集成的一个选项是Amazon S3。
基本上,您将向S3发送对象密钥,并使用S3 API调用(由API网关执行)请求此对象。 您只需要为API Gateway提供正确的权限,即可使用正确的凭据进行此调用。
您可以在此处找到使其工作所需的信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.