AWS SAM (Serverless Application Model) is an open-source framework to develop and deploy serverless applications on AWS. The serverless application in the case of AWS is a combination of Amazon Lambda, databases, Amazon API Gateway etc. If you like to read more about serverless computing before diving deep into the AWS SAM, you can read it here.
What is a Serverless Application?
Before we understand AWS SAM, let us first understand what is a serverless application.
A Serverless Application is a combination of various serverless services provided by AWS. These services are Amazon Lambda, Amazon API Gateway etc. All these services work together with each other and form an application to serve your customers.
Benefits of AWS SAM
Some of the benefits of AWS SAM are:
- Testing & Debugging: We discussed in the serverless computing post that it is hard to test and debug serverless applications. To solve this AWS SAM provides an AWS Lambda like local execution environment which you can use to run and debug the functions locally.
- CloudFormation Support: AWS Sam is built on CloudFormation and supports all the resources of Cloudformation in its config file. The AWS SAM team have also created some special construct which you can use to create and deploy resources with less amount of code. For example, AWS::Serverless::Functionallows you to create an AWS Lambda function along with all the required events configured in the config. If you have configured an API gateway event for your AWS Lambda function, the AWS SAM will deploy that API gateway as well.
- Single Deployment Configuration:As I mentionedthat AWS SAM can deploy resources using a construct and also supports other CloudFormation resources as well, you will only need a single deployment config to define and deploy your resources on AWS.
- Integration: AWS SAM can also integrate with your CI/CD tool of choice to automate your deployment pipeline. In AWS, AWS Cloud9 IDE supports AWS SAM so you can author, test serverless applications.
That was a quick introduction to AWS SAM. I will be adding more posts around getting started with AWS SAM and building applications using AWS SAM.