【问题标题】:Connect aws postgres db to the vercel将 aws postgres db 连接到 vercel
【发布时间】:2020-12-21 03:42:38
【问题描述】:

我正在尝试使用 aws postgres db 连接到 vercel
我创建了一个免费层 rds 的实例 我得到了端点
这是我的服务器代码

 const connection = await createConnection({
type: 'postgres',
url: process.env.DATABASE_URL,
logging: false,
synchronize: false,

entities: [
  User,
],
});

所以我的主要问题是如何创建 url

我已经尝试过 DATABASE_URL=postgresql://user:password@my aws endpoint:5432/my aws 数据库名称
并没有工作 vercel 错误说
错误:任务在 10.01 秒后超时
我做错了什么?

【问题讨论】:

    标签: postgresql amazon-web-services vercel


    【解决方案1】:

    转到 aws rds db 实例,在右侧(一旦您选择实例)将有 vpc 安全组选择它并为您正在连接的 IP 添加入站和出站防火墙规则,如果它是您的本地它将是你的 wan ip。您也可以通过 allow all tr​​affic 对其进行测试,但我强烈建议您不要这样做。

    【讨论】:

      【解决方案2】:

      Task timed out 几乎总是由于错误或缺少防火墙规则。验证 RDS 实例安全组是否有 vercel 服务器的规则。

      【讨论】:

        猜你喜欢
        • 2022-12-14
        • 1970-01-01
        • 2021-12-29
        • 2021-09-09
        • 1970-01-01
        • 2016-08-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多