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?

CloudShellからAuroraへアクセスするための方法

Posted at

概要

CloudShellをVPC内に配置出来るようになったので、VPC内にあるリソースへの接続確認に利用出来るようになったので試してみる

VPC上にCloudShellコンテナを起動

  1. AWSコンソールにログインし、画面右上の 「CloudShell」 をクリック

  2. CloudShellの画面が立ち上がるので、
    「アクション」 > 「Create VPC envirionment (max2)」 を選択

  3. CloudShellのコンテナを立ち上げるVPCの設定画面になるので、以下を任意で設定し Create をクリック

    • Name
    • Virtual private cloud (VPC)
    • Subnet
    • Security group

    ※「Security group」はアウトバウンドルールでAuroraへのアクセスが許可されている必要あり

  4. 「環境を作成中です」からターミナル画面に戻れば設定完了
    環境設定が完了すれば、以降はタブを増やす際に設定した環境を指定して起動できます。


CloudShellからAurora (PostgreSQL) へアクセス

  1. 前述で環境設定したCloudShellを開く

  2. psql コマンドを使用して対象DBへ接続

    • デフォルトでSSL接続が可能なため PGSSLMODE=require を指定します。
    PGSSLMODE=require psql -h <エンドポイント> -U <ユーザ名> -d <DB名>
    
    
  3. パスワードが要求されるので、事前に設定したDBパスワードを入力

  4. ターミナルのユーザー名がDB名=>となっていれば接続完了

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?