Lambda to fetch a poll

Following are the contents of /resources/functions/pollGetter.yml file:

pollGetter:  handler: com.packt.serverless.kotlin.letspoll.handlers.PollGetter  environment:    databaseUsername: ${env:LP_DATABASE_USERNAME}    databasePassword: ${env:LP_DATABASE_PASSWORD}    databaseUrl: { Fn::GetAtt: [ "letsPollDatabase", "Endpoint.Address" ] }    databasePort: ${env:LP_DATABASE_PORT}    databaseName: ${env:LP_DATABASE_NAME}  events:    - http:        path: /polls/{pollId}/        method: GET        cors: true        private: true        request:          parameters:            paths:              pollId : true        reqValidatorName: requestParmaterValidator        documentation:          summary: Gets a single poll by Id          tags:            - Name          description: >            Gets a Poll          methodResponses:            - statusCode: '200'              responseModels:                "application/json" ...

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.