Auto-fetching instance credentials and connecting

Deploy the example code

  1. To clone the repository from GitHub, you can use the following command:
    git clone https://github.com/hiepnguyendt/Auto-fetching-instance-credentialsand-connecting.git
    

autofetching

  1. Eit file .env with your database credential
    nano .env
    

autofetching

  • AWS_REGION: your region

autofetching

  1. Run the code:
    npm start
    

autofetching

Now, you are connecting to RDS PostgreSQL by Auto-fetching instance credentials from AWS Secret Manager.

If you got error when you run code. You should check AWS_regin in the AWS CLI