To Reproduce

  1. yarn install
  2. docker-compose up
  3. yarn deploy
  4. awslocal lambda invoke --function-name=serverless-local-hello /dev/null
  5. awslocal logs tail "/aws/lambda/serverless-local-hello"
  6. See 'Initialising handler' occur once even if invoked multiple times
  7. Add LOCALSTACK_API_KEY to docker-compose.yml environment
  8. Repeat steps 3-6
  9. See 'Initialising handler occur' for every invocation