Title
AWS re:Invent 2022 - Building real-world serverless applications with AWS SAM (SVS303)
Summary
- Eric Johnson, Principal Developer Advocate for Serverless at AWS, presented on AWS SAM (Serverless Application Model).
- The session covered an introduction to SAM, its components, and real-world application development using SAM.
- SAM consists of transform templates (infrastructure as code) and the SAM CLI, which is built specifically for serverless development.
- SAM is built on top of CloudFormation and can use any CloudFormation resources.
- SAM Local allows for local testing of serverless applications using commands like
sam local start-api
,sam local invoke
, andsam local generate-event
. - SAM Accelerate speeds up the development cycle by enabling quick syncing of code to the cloud without full deployment.
- SAM Logs aggregates logs from various services for easier debugging.
- SAM Pipelines automate deployment across different environments.
- New features include OIDC authorizer support, nested stack support, ESBuild for Node and TypeScript, Terraform support for local testing, and SAM connectors for easier IAM management.
- Eric shared his personal development cycle and best practices, including starting with patterns, using the SAM config.toml file, avoiding hard-coded resource names, managing step functions with Workflow Studio, and always using
sam delete
for cleanup. - Additional resources were provided for deeper learning on SAM and serverless development.
Insights
- SAM is a powerful tool for building serverless applications, providing both infrastructure as code and a CLI designed for serverless.
- Local testing is a critical part of serverless development, and SAM Local provides a suite of tools to facilitate this.
- SAM Accelerate and SAM Sync are designed to improve the developer experience by reducing the time between code changes and testing in a cloud environment.
- SAM Pipelines provide a guided approach to setting up CI/CD, which is essential for production-grade serverless applications.
- The introduction of SAM connectors indicates AWS's commitment to simplifying IAM role management, which is traditionally complex.
- Eric Johnson's personal development cycle and best practices offer practical insights into efficient serverless application development using SAM.
- The session highlighted the importance of automation and the use of SAM's features to streamline the serverless development lifecycle.