From 27e1428488a8850bc86cd3271e2a4a655441a6fa Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Sat, 9 May 2020 22:00:20 +1000 Subject: [PATCH] update readme --- aws/aws-rds-hello-world/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/aws/aws-rds-hello-world/README.md b/aws/aws-rds-hello-world/README.md index 8e3e03a..cf36e4c 100644 --- a/aws/aws-rds-hello-world/README.md +++ b/aws/aws-rds-hello-world/README.md @@ -1,4 +1,4 @@ -# RDS Hello World +# RDS Hello World Application This is a simple Spring Boot application which requires access to a PostgreSQL database. @@ -7,3 +7,19 @@ The application has a single endpoint `/hello` which prints out if the database Get it in a Docker image via `docker pull reflectoring/aws-rds-hello-world`. Use the image instead of your real application to test AWS CloudFormation stacks which need access to a database. + +## Testing AWS RDS connectivity with this application + +1. Create an RDS PostgreSQL database with the AWS console. +2. Note the endpoint of your RDS database in the AWS console. +3. Deploy the Docker container `reflectoring/aws-rds-hello-world` into AWS instead of your real application (this could be via a CloudFormation stack, manually, or however you are deploying your app). +4. Configure your deployment in a way that Docker will pass the coordinates to your RDS database as environment variables, equivalent to this command: + ``` + docker run \ + -e SPRING_DATASOURCE_URL=jdbc:postgresql://:5432/postgres \ + -e SPRING_DATASOURCE_USERNAME= \ + -e SPRING_DATASOURCE_PASSWORD= \ + -p 8080:8080 reflectoring/aws-rds-hello-world + ``` +5. If the Spring Boot application can connect to the database, it will start up sucessfully and serve a message on the endpoint `/hello`. +