I am playing around with the Cloudformation Serverless Transformation, and am trying to figure out how and when to use AWS::Serverless::Function
or AWS::Lambd
Framework wise there is not much difference between both however, there are minor difference technically as below
Serverless: It creates the IAM role, S3 Bucket, Cloudformation Template, create, update & deploy the code. Can Invoke the program from command.
One more important point, when we would like to delete the function and all associated services like S3, IAM role etc, that can be done using a single line command. In AWS Lambda, we need to manually remove each service one by one
AWS Lambda: It allows snippets of code to execute in response to triggers caused by activity from other AWS resources such as an AWS CloudWatch alarm, changes in a NoSQL table as DynamoDB, an upload event in an S3 bucket, etc.
AWS Lambda function has limits and it is recommended that you keep code size down and break up bigger function to smaller ones.