Infrastructure as code
Noback leverages the Serverless Application Model (SAM) to simplify serverless backend development. SAM simplifies the definition of AWS resources like Lambda functions, APIs, DynamoDB tables… while defining roles and policies for them, and it uses a convenient and concise syntax.
Having SAM as part of the main repository, allow us version control over both infrastrucure and business logic, enhancing collaboration and auditability.
Core Components
YAML templates
SAM applications are defined on a yaml file, specifying resources, their configurations, and dependencies. On noback you will find a template.yaml
on the root folder, and is extended with more yaml files inside /templates
folder. If you include any additional AWS services, try to keep templates modular into multiple files inside templates folder, and reference them as required on the main yaml file.
AWS SAM CLI
A command-line tool that manages the lifecycle of your serverless applications (building, testing, deploying). While using noback, there is ./deploy.sh
script that orchestrate the whole deployment process.
Best Practices
- Use parameters and environment variables to manage settings across environments (development, staging, production).
- Leverage built-in SAM policies to securely grant your Lambda functions the required permissions without excess privilege.