In this section, we'll set up a testbed. The test will consist of greeting the user and fetching the time either from the database by firing a select * from now() query or as a fallback to supply the default time of the lambda function.
We will use the Postgres database that we set up in Chapter 4, Developing your Serverless Application. Please note that the database is publicly accessible. Let's revise the database parameters as follows:
- URL: letspolldb.c9mlwulrnppz.us-west-1.rds.amazonaws.com
- Port: 5432
- Username: letspollDB_master
- Master Password: obfuscated
- Database Name: letsPoll
To query the database, we will use a nifty tool called JOOQ.