0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【RDS】「Error: P1001: Can't reach database server at `<RDS_ENDPOINT>:5432`」の解決方法

0
Posted at

はじめに

RDS, Prismaでマイグレーションを実行したところエラーが発生した。

問題

実行したコマンド

npx prisma migrate dev --name init

発生したエラー

Error: P1001: Can't reach database server at `<RDS_ENDPOINT>:5432`

解決方法

パブリックアクセスを有効化する

手順

Aurora and RDSデータベース変更接続追加設定パブリックアクセス可能を選択

おわりに

RDSはデフォルトだとパブリックアクセス不可であることを知りました。
ただ、パブリックアクセスが可能である状態はセキュリティ上よくないので、

  • セキュリティグループのインバウンドルールでIPアドレス制限をする
  • EC2にデプロイし、セキュリティグループでインバウンドのルールを追加する
  • EC2を踏み台サーバーとして立てる
    など色々方法はあるようです。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?