amazon-web-services - 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?
解决方案
您将需要一个可以适当查询数据库的“计算”组件。
您可以通过对 API Gateway 进行 REST 调用来执行此操作,这可以触发 AWS Lambda 函数。此函数可以运行您提供的代码。该代码可以查询数据库并返回信息。然后,您网页中的 JavaScript 代码可以呈现返回的内容。
如果您以前从未做过此类事情,那就有点复杂了。网上有很多例子,例如:如何使用 AWS Lambda、Amazon API Gateway、Amazon S3、Amazon DynamoDB 和 Amazon Cognito 构建无服务器 Web 应用程序 | AWS
推荐阅读
- elasticsearch - 弹性搜索中的自定义亮点
- java - 如何从 LinkedList 的对象访问 getter
- c# - 如何在 WCF 中添加用户/通过身份验证
- node.js - 路由器错误处理静态文件加载
- sql - sql查询金额和汇率
- gnuplot - 如何确保我的比例轴不会因定义了相同的设置调色板而从一个图形变化到另一个图形?
- javascript - Flow中不允许直接导出?
- bash - 在 Finder 中的选定文件上运行 Bash 脚本
- node.js - 如何使用 es2017 访问 typescript 中的文档/窗口?
- algorithm - 给定一个随机整数生成器 [0-5],生成 [0-7]