Serverless Framework - Common Error

Cloudformation stack is deleted right after created

Serverless: Validating template...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
CloudFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - todoList-dev-api-Serverless-v2
CloudFormation - DELETE_IN_PROGRESS - AWS::CloudFormation::Stack - todoList-dev-api-Serverless-v2
CloudFormation - DELETE_COMPLETE - AWS::CloudFormation::Stack - todoList-dev-api-Serverless-v2
Serverless: Stack create finished...

Debugging

  • This usually happens due to error in creation of the stack.
  • To Deug, we can go to AWS Console CloudFormation Services and select to view stacks that are DELETED
  • Then go Events Tab and see the Status reason and debug from there.

Lambda function is too large to enable inline code

This happens because the zipped deployment package exceed 3 MB Another point worth noting is that 'aws-sdk' takes lot of space. Good news is 'aws-sdk' is not needed to be installed. It is already made available by the AWS Lambda framework.