- [Instructor] Building serverless applications
directly on the AWS Console is tedious and prone to errors.
Usually, this is not the way we want
to build our production applications.
For production applications we want to have a process
that can be maintain with time
and also replicated in different environments
such as testing, development and production.
For building serverless applications for production
using infrastructure as code is a recommended practice.
I will discuss why this is so important later on.
We can implement the infrastructure as code practice
in many ways while building serverless applications.
One way is to code the infrastructure directly
and package the scripts and deploy them to the cloud.
Another way is to use a framework
that already has some tools to assist us
in developing and deploying the applications.
In this course, we will use SAM.
SAM stands for Serverless Application Model.
And it's an open-source framework
for building serverless applications.
SAM will help you to build your infrastructure
as it has a simple notation to create functions,
APIs and database tables
that are quite common resources needed
in serverless applications.
The infrastructure is defined in a YML file.
And then it can be deployed
with the help of SAM to the cloud.
SAM syntax will get transformed into CloudFormation
during the deployment process.
CloudFormation is the AWS infrastructure as code syntax
for defining all the AWS resources.
This is very portable within different accounts
and maintainable over time.
SAM comes with a rich set of features
available to developers.
The SAM template will contain all the definitions
for the right components of the serverless applications
and their configuration.
All these can deployed as one single entity.
SAM integrates with many AWS serverless tools
like Cloud9 that is an Online IDE,
AWS CodeBuild, CodeDeploy and CodePipeline
that they are tools to build CI/CD pipelines.
Local testing and debugging cloud applications can be hard,
but SAM provides tools that make it easier.
Developers who starting out
with serverless loved this feature about SAM.
SAM syntax is translated to CloudFormation
during the packaging time.
CloudFormation syntax can also be added
in some SAM templates and that gives a lot of flexibility.
To work with SAM and develop serverless applications,
it is recommended that you use the AWS SAM CLI.
SAM CLI is a command-line interface
that supports building SAM-based applications.
SAM CLI supports local development, testing
and you can choose between multiple languages
to work with your SAM application.
In our project, we are going to use SAM and SAM CLI.