首页 > 解决方案 > How can I import data from Amazon RDS (MySQL) and render it on my S3 static website?

问题描述

I have a static website hosted on s3, having only one account field. On submitting this form, the Amazon RDS (MySQL) database should be queried (with 'account' as key) and some fields should be returned and displayed on the website.

How do I go about it?

标签: amazon-web-servicesamazon-s3amazon-rds

解决方案


您将需要一个可以适当查询数据库的“计算”组件。

您可以通过对 API Gateway 进行 REST 调用来执行此操作,这可以触发 AWS Lambda 函数。此函数可以运行您提供的代码。该代码可以查询数据库并返回信息。然后,您网页中的 JavaScript 代码可以呈现返回的内容。

如果您以前从未做过此类事情,那就有点复杂了。网上有很多例子,例如:如何使用 AWS Lambda、Amazon API Gateway、Amazon S3、Amazon DynamoDB 和 Amazon Cognito 构建无服务器 Web 应用程序 | AWS


推荐阅读