Lambda to create polls

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

pollCreator:  handler: com.packt.serverless.kotlin.letspoll.handlers.PollCreator  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/        method: POST        cors: true        private: true        reqValidatorName: requestBodyValidator        documentation:          summary: Creates a Poll          tags:            - Name          description: >            Creates a Poll          requestBody:            description: "Request body description"          requestModels:            "application/json": "PollCreationRequest"          methodResponses: -  ...

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.