ASW SAM is an open source framework that is used to build serverless applications. A serverless application is combination of lambda functions, event sources and other resources (APIs, DB, event source mappings, etc.) that work together to perform a task.
AWS SAM provides 2 components to generate SAM – Template specifications (.yaml or .json file) & CLI. CLI is used to build serverless application that is defined by template specifications.
A few advantages of SAM
Single deployment configuration: easy to organize related components
Extension to CloudFormation: all features of CloudFormation + additional components – template difference is identified by ‘Transform’ declaration
Built-in best practices: code review, code deploy, enabling AWS X-Ray for trace
Local debugging and testing: SAM provide an execution environment locally
Deep integration with Dev tools: CodeBuild, CodeDeploy, CodePipeline, etc.
AWS SAM Template properties
AWS::Serverless::Function – Creates a lambda function, IAM roles and event source mappings that trigger the function
AWS::Serverless::Api – Creates a collection of API Gateway resources & methods that can be invoked through HTTPS endpoints
AWS::Serverless::SimpleTable – Defines DynamoDB table with single attribute primary key
AWS::Serverless::LayerVersion – Creates a lambda LayerVersion (Refer Lambda Layers)
AWS::Serverless::Application – Embeds a serverless application from serverless application repository or S3 bucket as a nested application
AWS::Serverless::HttpApi – Creates an API Gateway HTTP API to enable RESTful APIs
No comments:
Post a Comment