Currently, every time I need to use serverless offline
, I have to set my function handler in serverless.yml
to the main.go
of the function as such:
hello:
handler: src/hello/main.go
memorySize: 128
timeout: 5
events:
- httpApi:
path: /hello
method: get
iamRoleStatements:
- Effect: 'Allow'
Action:
- 'dynamodb:GetItem'
Resource: !GetAtt DeviceTable.Arn
But keeping this breaks AWS Lambda and I have to change it back to bin/hello
.
A solution is to use serverless offline --useDocker
but testing functions that is running in Docker takes more than 30s, which is super slow.
Is there a way around this?