Setting up the test bed

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:

  • URLletspolldb.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. 

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.