-
Notifications
You must be signed in to change notification settings - Fork 1
Framework Evaluation
Fabian Mastenbroek edited this page May 7, 2020
·
4 revisions
AWS Serverless Application Model (SAM) is a framework for building serverless applications on top of AWS' CloudFormation. Applications are defined declaratively using AWS CloudFormation templates.
See aws-sam for a possible implementation using AWS SAM.
Pros
- Supported by AWS and specifically built for Serverless applications.
- Support for local testing and debugging
- Since AWS CloudFormation templates are used, we can also use it to deploy other resources like DynamoDB tables.
- External dependencies are managed automatically
- Support for editors (VS Code and IntelliJ)
Cons
- Somewhat inflexible compared to alternatives: nested stacks do not work properly, no way to provide exclusions, e.g.
- Use of Layers for dependencies can only be done manually.
AWS CDK is built on top of AWS CloudFormation and provides an imperative API for defining cloud infrastructure using your preferred language.
Pros
- We can define our reproducible setup entirely in Python: might be easier to understand than CloudFormation templates
- As a result, a lot of freedom in project structure.
- Support for other resources like DynamoDB or frameworks like Chalice, or even SAM templates.
Cons
- Local testing and debugging requires some workaround via SAM cli.
- External dependencies need to be packaged manually (!!).
- Lacks most editor functionality that SAM offers (and only supported in VS Code for now)
Serverless is a framework for declaratively building applications on top of AWS Lambda (and many other FaaS providers).
See serverless for a possible implementation using AWS SAM.
Pros
- Configuration is rather straightforward compared to SAM using
serverless.yml - Support for local testing and debugging via offline mode (and can even simulate DynamoDB or AWS SNS/SQS)
- External dependencies are managed automatically (with support for tools like
pipenvorpoetry) and may optionally use AWS Layers. - Easily (un)group functions into a single/multiple lambdas
Cons
- Not officially supported by AWS
- No way to link services (unless we use Serverless Components, at the cost of offline mode).
- No editor integration