Save RDS Credentials

Save RDS Credentials to AWS Secrets Manager

The web server you created contains sample code for a simple address book. We must tell the sample code how to find the database and connect to it. We will store this information in AWS Secrets Manager.

In this section, we will create a secret containing the database connection information. Later, we will grant permission to the web server to retrieve this secret.

1.In the console, open the AWS Secrets Manager . Click Store a new secret.

2.Under Secret Type, choose Credentials for Amazon RDS database. Provide the user name and password you entered when you created the database.

3.Under Database, choose the database you just created. Click Next.

4.Name your secret, mysecret. The sample code is written to ask for the secret by this specific name. Click Next.

5.Review your choices. Click Store.