SlideShare uma empresa Scribd logo
1 de 104
Baixar para ler offline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
How to deploy a production ready
serverless application
Marcia Villalba
Developer Advocate AWS
@mavi888uy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
About me
AWS Developer Advocate
Working with serverless since 2015
Host of FooBar YouTube Channel
https://youtube.com/foobar_codes
@mavi888uy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Agenda
• CI/CD for serverless applications
• Continuous integration/continuous deployment (CI/CD) foundations
• Infrastructure as code
• Continuous integration
• Continuous deployment
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Development transformation at Amazon: 2001–2002
monolithic application
+ teams
2001
Lesson learned: decompose for agility
2002
microservices
+ 2 pizza teams
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Full ownership
Full accountability
“DevOps”
Focused innovation
Two-pizza teams
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Monolith development lifecycle
monitorreleasetestbuild
developers
delivery pipelines
services
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Microservice development lifecycle
???
developers
delivery pipelines
services
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Microservice development lifecycle
developers services
monitorreleasetestbuild
delivery pipelines
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
ListenIterate
Experiment
Innovation
Flywheel
Experiments power the engine of rapid innovation
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
What changes do you need to make to adopt these best
practices?
Serverless
No provisioning/management
Automatic scaling
Pay for value billing
Availability and resiliency
Microservices
Componentization
Business capabilities
Products not projects
Infrastructure automation
DevOps
Cultural philosophies
Cross-disciplinary teams
CI/CD
Automation tools
DEV OPS
Architectural
patterns
Operational
Model
Software
Delivery
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Stages of the software release process
Source Build Test Production
Developers version,
review and commit
code changes
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Stages of the software release process
Source Build Test Production
Build tasks and unit
testing
Developers version,
review and commit
code changes
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Stages of the software release process
Source Build Test Production
Deploy to testing
environments and
run integration
tests
Developers version,
review and commit
code changes
Build tasks and unit
testing
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Stages of the software release process
Source Build Test Production
Deploy to
production
environment
Developers version,
review and commit
code changes
Build tasks and unit
testing
Deploy to testing
environments and
run integration
tests
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
Approved deploy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
Automated deploy
Approved deploy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Choosing the right tools
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodePipeline
The orchestrator
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodePipeline
• Continuous delivery service for fast and reliable
application updates
• Model and visualize your software release
process
• Builds, tests, and deploys your code every time
there is a code change
• Integrates with third-party tools and AWS
• https://aws.amazon.com/codepipeline/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Example of minimal developer’s pipeline
This pipeline:
• Three stages
• Builds code artifact
• One development environment
• Uses AWS SAM/AWS CloudFormation to deploy
artifact and other AWS resources
• Has Lambda custom actions for testing functions
MyBranch-Source
Source
CodeCommit i
Build
test-build-source
CodeBuild i
MyDev-Deploy
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Run-stubs
Lambda i
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Example of full pipeline
This pipeline:
• Five stages
• Builds code artifact
• Three deployed to “environments”
• Uses AWS SAM/AWS CloudFormation to
deploy artifact and other AWS resources
• Has Lambda custom actions for testing
functions
• Integrates with a third-party tool/service
• Has a manual approval before deploying
to production
Source
Source
GitHub i
Build
test-build-source
CodeBuild i
Deploy-Testing
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Run-stubs
Lambda i
Deploy-Staging
Deploy-Prod
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Post-Deploy-Stack
Lambda i
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
QA-Sign-Off
Manual approval i
Review
Run-API-test
Runscope i
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Example of full pipeline
This pipeline:
• Five stages
• Builds code artifact
• Three deployed to “environments”
• Uses AWS SAM/AWS CloudFormation to
deploy artifact and other AWS resources
• Has Lambda custom actions for testing
functions
• Integrates with a third-party tool/service
• Has a manual approval before deploying
to production
Source
Source
GitHub i
Build
test-build-source
CodeBuild i
Deploy-Testing
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Run-stubs
Lambda i
Deploy-Staging
Deploy-Prod
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Post-Deploy-Stack
Lambda i
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
QA-Sign-Off
Manual approval i
Review
Run-API-test
Runscope i
Dev account
Staging account
Production account
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodePipeline: Supported sources
Pick branch
AWS CodeCommit
GitHub
Pick object or folder
Amazon S3
Automatically kick off release and pull latest source code
Amazon CloudWatch Events
Scheduled (nightly release)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
Code
Infrastructure
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Infrastructure as code goals
1. Make infrastructure changes repeatable and predictable
2. Release infrastructure changes using the same tools as code changes
3. Replicate production environment in a staging environment to enable
continuous testing
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CloudFormation
• Infrastructure as code (IaC)
• Provides a common language for you to
describe and provision all the infrastructure
resources in your cloud environment
• Build and rebuild your infrastructure and
applications, without having to perform
manual actions or write custom scripts
https://aws.amazon.com/cloudformation/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Model function environments with AWS Serverless
Application Model (SAM)
• Open source framework for building serverless
applications on AWS
• Shorthand syntax to express functions, APIs,
databases, and event source mappings
• Transforms and expands SAM syntax into AWS
CloudFormation syntax on deployment
• Supports all AWS CloudFormation resource types
https://aws.amazon.com/serverless/sam/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
AWS Cloud
Amazon API Gateway
Lambda function
Table Role
===
To become
this
Allowing
this
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Tells AWS CloudFormation this is a SAM template it
needs to “transform”
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Just 20 lines to create:
• Lambda function
• IAM role
• API Gateway
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Function configuration
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Permissions for the
function
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS SAM Policy Templates
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Policies:
- CloudWatchPutMetricPolicy: {}
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS SAM Policy Templates
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
All the available policies can
be found in this link
http://bit.ly/sam-policy-
template
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
API Gateway
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
MySimpleTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: mySimpleTableFunction.handler
Runtime: nodejs12.x
CodeUri: ./functions
Policies:
- DynamoDBReadPolicy:
TableName: !Ref MySimpleTable
Events:
MySimpleFunctionApi:
Type: Api
Properties:
Path: /simpleTable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
Creates a Amazon DynamoDB table with 5
Read & Write units
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Use SAM CLI to package and deploy SAM templates
pip install --user aws-sam-cli
sam logs
sam validate
sam local
sam init
sam build
sam package
sam deploy
sam publish
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Use SAM CLI to package and deploy SAM templates
pip install --user aws-sam-cli
sam logs
sam validate
sam local
sam init
sam build
sam package
sam deploy
sam publish
sam deploy –guided
When you want to get things set up easily in
your computer
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
# Global information for all the functions
Globals:
Function:
Runtime: nodejs12.x
MemorySize: 256
Timeout: 100
Tracing: Active
Resources:
MySimpleFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: mySimpleFunction.handler
CodeUri: ./functions
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
Path: /simple
Method: GET
# A function that uses a Simple table function
MySimpleTableFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: mySimpleTableFunction.handler
CodeUri: ./functions
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref MySimpleTable
Environment:
Variables:
TABLE_NAME: !Ref MySimpleTable
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
Path: /simpletable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
AWS SAM Globals
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
# Global information for all the functions
Globals:
Function:
Runtime: nodejs12.x
MemorySize: 256
Timeout: 100
Tracing: Active
Resources:
MySimpleFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: mySimpleFunction.handler
CodeUri: ./functions
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
Path: /simple
Method: GET
# A function that uses a Simple table function
MySimpleTableFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: mySimpleTableFunction.handler
CodeUri: ./functions
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref MySimpleTable
Environment:
Variables:
TABLE_NAME: !Ref MySimpleTable
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
Path: /simpletable
Method: GET
MySimpleTable:
Type: AWS::Serverless::SimpleTable
AWS SAM Globals
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda Environment Variables
• Key-value pairs that you can dynamically pass to your function
• Available via standard environment variable APIs such as
process.env for Node.js or os.environ for Python
• Can optionally be encrypted via AWS Key Management Service
(KMS)
• Useful for creating environments per stage (i.e. dev, testing,
production)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda Environment Variables
In AWS SAM template
MySimpleFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: mySimpleFunction.handler
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref MyDynamoDBTable
Environment:
Variables:
TABLE_NAME: !Ref MyDynamoDBTable
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /simple
Method: GET
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS Lambda Environment Variables
In the handler of the function
MySimpleFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: mySimpleFunction.handler
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref MyDynamoDBTable
Environment:
Variables:
TABLE_NAME: !Ref MyDynamoDBTable
Events:
MySimpleFunctionAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /simple
Method: GET
'use strict';
const TABLE_NAME = process.env.TABLE_NAME;
module.exports.getItem = async (propertyId, sortKey) => {
console.log('getItem');
...
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
DEV STAGE PROD
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
In AWS SAM template
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Mappings:
ResourcesName:
dev:
tableName: MyDynamoDBTable-dev
staging:
tableName: MyDynamoDBTable-staging
prod:
tableName: MyDynamoDBTable-prod
Resources:
MyDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
. . .
TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
In AWS SAM template
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Mappings:
ResourcesName:
dev:
tableName: MyDynamoDBTable-dev
staging:
tableName: MyDynamoDBTable-staging
prod:
tableName: MyDynamoDBTable-prod
Resources:
MyDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
. . .
TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
In AWS SAM template
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Mappings:
ResourcesName:
dev:
tableName: MyDynamoDBTable-dev
staging:
tableName: MyDynamoDBTable-staging
prod:
tableName: MyDynamoDBTable-prod
Resources:
MyDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
. . .
TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
In AWS SAM template
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Mappings:
ResourcesName:
dev:
tableName: MyDynamoDBTable-dev
staging:
tableName: MyDynamoDBTable-staging
prod:
tableName: MyDynamoDBTable-prod
Resources:
MyDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
. . .
TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different resources names for different stages
We need to pass the stage name as a
parameter when we create the AWS
Cloudformation change set
In AWS CodePipeline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodeCommit
• Fully managed source-control service that
hosts secure Git-based repositories
• Allows teams to collaborate on code in a
secure and highly scalable ecosystem
• Automatically encrypts your files in transit
and at rest
• Integrated with AWS Identity and Access
Management (IAM)
• https://aws.amazon.com/codecommit/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Third-party code repositories
private repo
Integrates with AWS
CodeBuild and AWS
CodePipeline
Integrates with AWS
CodeBuild
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Continuous integration goals
1. Automatically kick off a new release when new code is checked in
2. Build and test code in a consistent, repeatable environment
3. Continually have an artifact ready for deployment
4. Continually close feedback loop when build fails
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodeBuild
• Fully managed build service that can compile
source code, run tests, and produce software
packages
• Scales continuously and processes multiple
builds concurrently
• Can consume environment variables from
AWS Systems Manager Parameter Store
• No build servers to manage
• Supports dependency caching
• https://aws.amazon.com/codebuild/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
Use install phase to install packages or any pre-
reqs you may need throughout the build
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
Use pre-build phase to run unit tests
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
In the build phase, we build the project using AWS SAM
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
Use post-build for creating the package of the artifact
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
phases:
install:
commands:
- pip install --upgrade pip
- pip install pipenv –user
- pipenv install awscli aws-sam-cli
- npm install
pre_build:
commands:
- eslint *.js
- npm test
build:
commands:
- sam build
post_build:
commands:
- sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template
packaged.yaml
artifacts:
type: zip
files:
- packaged.yaml
AWS CodeBuild: Lambda buildspec using SAM CLI
Where AWS CodeBuild can find the output artifacts
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Where and what to test
• Code review via pull
request
• Lint/syntax check
• Unit test pass
• Code successfully
compiles
• Application deploys
successfully
• Mocked/stubbed
integration tests
• Application deploys
successfully
• Test against real services
(potentially against
production dependencies)
• Run pre-traffic Lambda tests
• Deploy canaries
• Complete wait period
successfully
• Deploy 100%
• Run post-traffic Lambda
tests
Source
Source
CodeCommit i
Build
test-build-source
CodeBuild i
Deploy-Testing
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Run-stubs
Lambda i
Deploy-Staging
Deploy-Prod
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
Post-Deploy-Stack
Lambda i
create-changeset
AWS CloudFormation i
execute-changeset
AWS CloudFormation i
QA-Sign-Off
Manual approval i
Review
Run-API-test
Runscope i
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different ways to make sure everything is ok
AWS Lambda functions
Third party services
Manual QA
Safe deployments
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using AWS Lambda to perform integration tests…
exports.handler = async (event, context) => {
let jobId = event["CodePipeline.job"].id;
// DO SOME INTEGRATION TESTS
if (testsPassed) {
let params = {
jobId: jobId
};
return codepipeline.putJobSuccessResult(params).promise(data => {
context.succeed('Test passed');
}).catch(error => {
context.fail(error);
});
} else {
let params = {
jobId: jobId,
failureDetails: {
message: JSON.stringify('Test failed’),
type: 'JobFailed’,
externalExecutionId: context.invokeid
}
};
return codepipeline.putJobFailureResult(params).promise(data => {
context.fail(message);
});
}
};
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using AWS Lambda to perform integration tests…
exports.handler = async (event, context) => {
let jobId = event["CodePipeline.job"].id;
// DO SOME INTEGRATION TESTS
if (testsPassed) {
let params = {
jobId: jobId
};
return codepipeline.putJobSuccessResult(params).promise(data => {
context.succeed('Test passed');
}).catch(error => {
context.fail(error);
});
} else {
let params = {
jobId: jobId,
failureDetails: {
message: JSON.stringify('Test failed’),
type: 'JobFailed’,
externalExecutionId: context.invokeid
}
};
return codepipeline.putJobFailureResult(params).promise(data => {
context.fail(message);
});
}
};
Write some integration tests
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using AWS Lambda to perform integration tests…
exports.handler = async (event, context) => {
let jobId = event["CodePipeline.job"].id;
// DO SOME INTEGRATION TESTS
if (testsPassed) {
let params = {
jobId: jobId
};
return codepipeline.putJobSuccessResult(params).promise(data => {
context.succeed('Test passed');
}).catch(error => {
context.fail(error);
});
} else {
let params = {
jobId: jobId,
failureDetails: {
message: JSON.stringify('Test failed’),
type: 'JobFailed’,
externalExecutionId: context.invokeid
}
};
return codepipeline.putJobFailureResult(params).promise(data => {
context.fail(message);
});
}
};
Needs to call the
putJobSuccessuResult
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using AWS Lambda to perform integration tests…
exports.handler = async (event, context) => {
let jobId = event["CodePipeline.job"].id;
// DO SOME INTEGRATION TESTS
if (testsPassed) {
let params = {
jobId: jobId
};
return codepipeline.putJobSuccessResult(params).promise(data => {
context.succeed('Test passed');
}).catch(error => {
context.fail(error);
});
} else {
let params = {
jobId: jobId,
failureDetails: {
message: JSON.stringify('Test failed’),
type: 'JobFailed’,
externalExecutionId: context.invokeid
}
};
return codepipeline.putJobFailureResult(params).promise(data => {
context.fail(message);
});
}
};
Needs to call the
putJobFailureResult
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using AWS Lambda to perform integration tests…
exports.handler = async (event, context) => {
let jobId = event["CodePipeline.job"].id;
// DO SOME INTEGRATION TESTS
if (testsPassed) {
let params = {
jobId: jobId
};
return codepipeline.putJobSuccessResult(params).promise(data => {
context.succeed('Test passed');
}).catch(error => {
context.fail(error);
});
} else {
let params = {
jobId: jobId,
failureDetails: {
message: JSON.stringify('Test failed’),
type: 'JobFailed’,
externalExecutionId: context.invokeid
}
};
return codepipeline.putJobFailureResult(params).promise(data => {
context.fail(message);
});
}
};
More information on how to configure this
https://amzn.to/2SVWZlW
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Using 3rd party service to test
For adding tests there are lots of
3rd party tools supported.
Find more information on how
to configure them with AWS
CodePipeline here:
https://amzn.to/2SV0iK3
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Manual approvals
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Manual approvals
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS CodeDeploy
• Automates code deployments to any instance and
Lambda
• Handles the complexity of updating your applications
• Avoid downtime during application deployment
• Roll back automatically if failure detected
• Deploy to Amazon EC2, Lambda, Fargate, EC2, or on-
premises servers
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Safe Deployment
Canary10Percent30Minutes
Canary10Percent5Minutes
Canary10Percent10Minutes
Canary10Percent15Minutes
Linear10PercentEvery10Minutes
Linear10PercentEvery1Minute
Linear10PercentEvery2Minutes
Linear10PercentEvery3Minutes
AllAtOnce
BeforeAllowTraffic
AfterAllowTraffic
AllowTraffic
Deployment Preference
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Versions are immutable snapshots of
a function – code + configuration
An Alias is a pointer to a version
Lambda Version and aliases
v1
v2
v3
Alias: prod
Alias: dev
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
CodeDeploy – Lambda canary deployment
API
Gateway
Lambda
function
weighted
alias “live”
v1 Lambda
function
code
100%
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
CodeDeploy – Lambda canary deployment
API
Gateway
Lambda
function
weighted
alias “live”
v1 code100%
Run PreTraffic hook against v2 code before it receives traffic
v2 code0%
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
CodeDeploy – Lambda canary deployment
API
Gateway
Lambda
function
weighted
alias “live”
v1 code90%
Wait for 10 minutes, roll back in case of alarm
v2 code10%
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
CodeDeploy – Lambda canary deployment
API
Gateway
Lambda
function
weighted
alias “live”
v1 code0%
Run PostTraffic hook and complete deployment
v2 code100%
Testing using safe deployments
HelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.hello
Runtime: nodejs12.x
CodeUri: ./hello
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
HelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.hello
Runtime: nodejs12.x
CodeUri: ./hello
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
Testing using safe deployments
Instructs AWS SAM to publish a new
version of the function for each new
deployment and link it to the live alias
HelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.hello
Runtime: nodejs12.x
CodeUri: ./hello
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
Testing using safe deployments
Canary10Percent30Minutes
Canary10Percent5Minutes
Canary10Percent10Minutes
Canary10Percent15Minutes
Linear10PercentEvery10Minutes
Linear10PercentEvery1Minute
Linear10PercentEvery2Minutes
Linear10PercentEvery3Minutes
AllAtOnce
HelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.hello
Runtime: nodejs12.x
CodeUri: ./hello
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
Testing using safe deployments
A list of alarms that you want to monitor
You can specify a maximum of 10 alarms
HelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.hello
Runtime: nodejs12.x
CodeUri: ./hello
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery10Minutes
Alarms:
- !Ref AliasErrorMetricGreaterThanZeroAlarm
- !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
Hooks:
PreTraffic: !Ref PreTrafficLambdaFunction
PostTraffic: !Ref PostTrafficLambdaFunction
Testing using safe deployments
Validation Lambda functions that are run
before & after traffic shifting
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different strategies for different stages
DEV STAGE PROD
Linear10PercentEvery10Minutes
Lambda
function
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different strategies for different stages
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Conditions:
IsProd: !Equals [!Ref MyEnvironment, prod]
MySafeDeployedFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: mySafeDeployedFunction.handler
AutoPublishAlias: live
DeploymentPreference:
Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different strategies for different stages
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Conditions:
IsProd: !Equals [!Ref MyEnvironment, prod]
MySafeDeployedFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: mySafeDeployedFunction.handler
AutoPublishAlias: live
DeploymentPreference:
Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Different strategies for different stages
Parameters:
MyEnvironment:
Type: String
Default: dev
AllowedValues:
- dev
- staging
- prod
Conditions:
IsProd: !Equals [!Ref MyEnvironment, prod]
MySafeDeployedFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: mySafeDeployedFunction.handler
AutoPublishAlias: live
DeploymentPreference:
Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Release process stages
Source Build Test Production
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Continuous deployment goals
1. Automatically deploy new changes to staging environments
for testing
2. Deploy to production safely without impacting customers
3. Deliver to customers faster: Increase deployment frequency,
and reduce change lead time and change failure rate
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Monitoring and observability
Amazon CloudWatch
Collects monitoring
and operational data in
the form of logs,
metrics, and events
AWS X-Ray
Provides a trace or an
end-to-end view of
requests traveling
through your application
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
How to get started
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Start working with a template pipeline
https://github.com/aws-samples/cookiecutter-aws-sam-pipeline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Code for the example pipeline
https://github.com/mavi888/demo-cicd-codepipeline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
“Create application” experience
Create a serverless application
from a starter template
• AWS SAM template for IaC
• CI/CD pipeline
• Clone locally for development
with AWS SAM CLI
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
“Create application” experience
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
AWS developer tools
Source Build Test Deploy Monitor
AWS CodeBuild +
third party
Software release steps
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS
CodeStar
AWS X-Ray
Amazon
CloudWatch
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Takeaways
1. Manage your infrastructure as code
2. Frequently build and integrate your code to get a first feedback
3. Continuously release in production using canary releases with monitoring and
automated rollbacks
4. Use canary releases to get both technical and business feedback
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
Thank you!Marcia Villalba
@mavi888uy
YouTube Channel: https://youtube.com/foobar_codes

Mais conteúdo relacionado

Mais procurados

AWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineAWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineJulien SIMON
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAmazon Web Services
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsAmazon Web Services
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWSJulien SIMON
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentAmazon Web Services
 
Testing on AWS - AWS IL meetup
Testing on AWS - AWS IL meetupTesting on AWS - AWS IL meetup
Testing on AWS - AWS IL meetupBoaz Ziniman
 
Convert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaConvert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaAmazon Web Services
 
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018AWS Germany
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Amazon Web Services
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerAmazon Web Services
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Amazon Web Services
 
Introduction to the Serverless Cloud
Introduction to the Serverless CloudIntroduction to the Serverless Cloud
Introduction to the Serverless CloudAmazon Web Services
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Julien SIMON
 
Immersion Day - Estratégias e melhores práticas para ingestão de dados
Immersion Day - Estratégias e melhores práticas para ingestão de dadosImmersion Day - Estratégias e melhores práticas para ingestão de dados
Immersion Day - Estratégias e melhores práticas para ingestão de dadosAmazon Web Services LATAM
 
Workshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDOWorkshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDOJulien SIMON
 
Automate Software Deployments on EC2 with AWS CodeDeploy
Automate Software Deployments on EC2 with AWS CodeDeployAutomate Software Deployments on EC2 with AWS CodeDeploy
Automate Software Deployments on EC2 with AWS CodeDeployAmazon Web Services
 
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...Amazon Web Services
 
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...Amazon Web Services
 

Mais procurados (20)

AWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineAWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipeline
 
AWS CodeDeploy Getting Started
AWS CodeDeploy Getting StartedAWS CodeDeploy Getting Started
AWS CodeDeploy Getting Started
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWS
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application Development
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Testing on AWS - AWS IL meetup
Testing on AWS - AWS IL meetupTesting on AWS - AWS IL meetup
Testing on AWS - AWS IL meetup
 
Convert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaConvert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS Lambda
 
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
 
Introduction to the Serverless Cloud
Introduction to the Serverless CloudIntroduction to the Serverless Cloud
Introduction to the Serverless Cloud
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)
 
Immersion Day - Estratégias e melhores práticas para ingestão de dados
Immersion Day - Estratégias e melhores práticas para ingestão de dadosImmersion Day - Estratégias e melhores práticas para ingestão de dados
Immersion Day - Estratégias e melhores práticas para ingestão de dados
 
Workshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDOWorkshop AWS IoT @ SIDO
Workshop AWS IoT @ SIDO
 
Automate Software Deployments on EC2 with AWS CodeDeploy
Automate Software Deployments on EC2 with AWS CodeDeployAutomate Software Deployments on EC2 with AWS CodeDeploy
Automate Software Deployments on EC2 with AWS CodeDeploy
 
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
 
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
AWS CodeDeploy, AWS CodePipeline, and AWS CodeCommit: Transforming Software D...
 

Semelhante a 20201012 - Serverless Architecture Conference - Deploying serverless applications

CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...Amazon Web Services
 
CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...Amazon Web Services
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSatSistemas
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...Amazon Web Services
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...Amazon Web Services
 
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...Amazon Web Services
 
AWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applicationsAWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applicationsCobus Bernard
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayAmazon Web Services
 
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019Bhuvaneswari Subramani
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeAmazon Web Services
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018Bhuvaneswari Subramani
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateAmazon Web Services
 
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...Amazon Web Services
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelAmazon Web Services
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...Amazon Web Services
 
CICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfCICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfAmazon Web Services
 

Semelhante a 20201012 - Serverless Architecture Conference - Deploying serverless applications (20)

CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
 
CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWS
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...
CI/CD best practices for building modern applications - MAD304 - Chicago AWS ...
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
 
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
 
AWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applicationsAWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applications
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
 
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
 
Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day Israel
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...
Workshop: AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Pract...
 
CICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfCICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdf
 

Mais de Marcia Villalba

20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...Marcia Villalba
 
20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECH20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECHMarcia Villalba
 
Building a personal brand
Building a personal brandBuilding a personal brand
Building a personal brandMarcia Villalba
 
20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverlessMarcia Villalba
 
20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless Marcia Villalba
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCUMarcia Villalba
 
20200513 Getting started with AWS Amplify
20200513   Getting started with AWS Amplify20200513   Getting started with AWS Amplify
20200513 Getting started with AWS AmplifyMarcia Villalba
 
2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverlessMarcia Villalba
 
JFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverlessJFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverlessMarcia Villalba
 
Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020Marcia Villalba
 
ReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsMarcia Villalba
 
Serverless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQLServerless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQLMarcia Villalba
 
AWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQLAWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQLMarcia Villalba
 
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture ConferenceServerless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture ConferenceMarcia Villalba
 
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 stepsServerless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 stepsMarcia Villalba
 
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicasOctubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicasMarcia Villalba
 
Serverless Empowering people
Serverless Empowering peopleServerless Empowering people
Serverless Empowering peopleMarcia Villalba
 

Mais de Marcia Villalba (17)

20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...
 
20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECH20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECH
 
Building a personal brand
Building a personal brandBuilding a personal brand
Building a personal brand
 
20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless
 
20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCU
 
20200513 Getting started with AWS Amplify
20200513   Getting started with AWS Amplify20200513   Getting started with AWS Amplify
20200513 Getting started with AWS Amplify
 
2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless
 
JFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverlessJFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverless
 
Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020
 
ReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsReInvent 2019 reCap Nordics
ReInvent 2019 reCap Nordics
 
Serverless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQLServerless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQL
 
AWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQLAWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQL
 
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture ConferenceServerless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
 
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 stepsServerless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
 
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicasOctubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
 
Serverless Empowering people
Serverless Empowering peopleServerless Empowering people
Serverless Empowering people
 

Último

Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsMFatihSIRA
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Payal Garg #K09
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...ronahami
 
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...dannyijwest
 
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORINTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORTanishkaHira1
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 

Último (20)

Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI Applications
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
Cybercrimes in the Darknet and Their Detections: A Comprehensive Analysis and...
 
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORINTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

20201012 - Serverless Architecture Conference - Deploying serverless applications

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. How to deploy a production ready serverless application Marcia Villalba Developer Advocate AWS @mavi888uy
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. About me AWS Developer Advocate Working with serverless since 2015 Host of FooBar YouTube Channel https://youtube.com/foobar_codes @mavi888uy
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Agenda • CI/CD for serverless applications • Continuous integration/continuous deployment (CI/CD) foundations • Infrastructure as code • Continuous integration • Continuous deployment
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Development transformation at Amazon: 2001–2002 monolithic application + teams 2001 Lesson learned: decompose for agility 2002 microservices + 2 pizza teams
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Full ownership Full accountability “DevOps” Focused innovation Two-pizza teams
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Monolith development lifecycle monitorreleasetestbuild developers delivery pipelines services
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Microservice development lifecycle ??? developers delivery pipelines services
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Microservice development lifecycle developers services monitorreleasetestbuild delivery pipelines monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. ListenIterate Experiment Innovation Flywheel Experiments power the engine of rapid innovation
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. What changes do you need to make to adopt these best practices? Serverless No provisioning/management Automatic scaling Pay for value billing Availability and resiliency Microservices Componentization Business capabilities Products not projects Infrastructure automation DevOps Cultural philosophies Cross-disciplinary teams CI/CD Automation tools DEV OPS Architectural patterns Operational Model Software Delivery
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Stages of the software release process Source Build Test Production Developers version, review and commit code changes
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Stages of the software release process Source Build Test Production Build tasks and unit testing Developers version, review and commit code changes
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Stages of the software release process Source Build Test Production Deploy to testing environments and run integration tests Developers version, review and commit code changes Build tasks and unit testing
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Stages of the software release process Source Build Test Production Deploy to production environment Developers version, review and commit code changes Build tasks and unit testing Deploy to testing environments and run integration tests
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production Approved deploy
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production Automated deploy Approved deploy
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Choosing the right tools
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodePipeline The orchestrator
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodePipeline • Continuous delivery service for fast and reliable application updates • Model and visualize your software release process • Builds, tests, and deploys your code every time there is a code change • Integrates with third-party tools and AWS • https://aws.amazon.com/codepipeline/
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Example of minimal developer’s pipeline This pipeline: • Three stages • Builds code artifact • One development environment • Uses AWS SAM/AWS CloudFormation to deploy artifact and other AWS resources • Has Lambda custom actions for testing functions MyBranch-Source Source CodeCommit i Build test-build-source CodeBuild i MyDev-Deploy create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Run-stubs Lambda i
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Example of full pipeline This pipeline: • Five stages • Builds code artifact • Three deployed to “environments” • Uses AWS SAM/AWS CloudFormation to deploy artifact and other AWS resources • Has Lambda custom actions for testing functions • Integrates with a third-party tool/service • Has a manual approval before deploying to production Source Source GitHub i Build test-build-source CodeBuild i Deploy-Testing create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Run-stubs Lambda i Deploy-Staging Deploy-Prod create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Post-Deploy-Stack Lambda i create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i QA-Sign-Off Manual approval i Review Run-API-test Runscope i
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Example of full pipeline This pipeline: • Five stages • Builds code artifact • Three deployed to “environments” • Uses AWS SAM/AWS CloudFormation to deploy artifact and other AWS resources • Has Lambda custom actions for testing functions • Integrates with a third-party tool/service • Has a manual approval before deploying to production Source Source GitHub i Build test-build-source CodeBuild i Deploy-Testing create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Run-stubs Lambda i Deploy-Staging Deploy-Prod create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Post-Deploy-Stack Lambda i create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i QA-Sign-Off Manual approval i Review Run-API-test Runscope i Dev account Staging account Production account
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodePipeline: Supported sources Pick branch AWS CodeCommit GitHub Pick object or folder Amazon S3 Automatically kick off release and pull latest source code Amazon CloudWatch Events Scheduled (nightly release)
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production Code Infrastructure
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Infrastructure as code goals 1. Make infrastructure changes repeatable and predictable 2. Release infrastructure changes using the same tools as code changes 3. Replicate production environment in a staging environment to enable continuous testing
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CloudFormation • Infrastructure as code (IaC) • Provides a common language for you to describe and provision all the infrastructure resources in your cloud environment • Build and rebuild your infrastructure and applications, without having to perform manual actions or write custom scripts https://aws.amazon.com/cloudformation/
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Model function environments with AWS Serverless Application Model (SAM) • Open source framework for building serverless applications on AWS • Shorthand syntax to express functions, APIs, databases, and event source mappings • Transforms and expands SAM syntax into AWS CloudFormation syntax on deployment • Supports all AWS CloudFormation resource types https://aws.amazon.com/serverless/sam/
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable AWS Cloud Amazon API Gateway Lambda function Table Role === To become this Allowing this
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Tells AWS CloudFormation this is a SAM template it needs to “transform”
  • 34. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Just 20 lines to create: • Lambda function • IAM role • API Gateway
  • 35. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Function configuration
  • 36. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Permissions for the function
  • 37. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS SAM Policy Templates AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Policies: - CloudWatchPutMetricPolicy: {} Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable
  • 38. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS SAM Policy Templates AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable All the available policies can be found in this link http://bit.ly/sam-policy- template
  • 39. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable API Gateway
  • 40. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: MySimpleTableFunction: Type: AWS::Serverless::Function Properties: Handler: mySimpleTableFunction.handler Runtime: nodejs12.x CodeUri: ./functions Policies: - DynamoDBReadPolicy: TableName: !Ref MySimpleTable Events: MySimpleFunctionApi: Type: Api Properties: Path: /simpleTable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable Creates a Amazon DynamoDB table with 5 Read & Write units
  • 41. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Use SAM CLI to package and deploy SAM templates pip install --user aws-sam-cli sam logs sam validate sam local sam init sam build sam package sam deploy sam publish
  • 42. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Use SAM CLI to package and deploy SAM templates pip install --user aws-sam-cli sam logs sam validate sam local sam init sam build sam package sam deploy sam publish sam deploy –guided When you want to get things set up easily in your computer
  • 43. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. # Global information for all the functions Globals: Function: Runtime: nodejs12.x MemorySize: 256 Timeout: 100 Tracing: Active Resources: MySimpleFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: mySimpleFunction.handler CodeUri: ./functions Events: MySimpleFunctionAPI: Type: Api Properties: Path: /simple Method: GET # A function that uses a Simple table function MySimpleTableFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: mySimpleTableFunction.handler CodeUri: ./functions Policies: - DynamoDBCrudPolicy: TableName: !Ref MySimpleTable Environment: Variables: TABLE_NAME: !Ref MySimpleTable Events: MySimpleFunctionAPI: Type: Api Properties: Path: /simpletable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable AWS SAM Globals
  • 44. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. # Global information for all the functions Globals: Function: Runtime: nodejs12.x MemorySize: 256 Timeout: 100 Tracing: Active Resources: MySimpleFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: mySimpleFunction.handler CodeUri: ./functions Events: MySimpleFunctionAPI: Type: Api Properties: Path: /simple Method: GET # A function that uses a Simple table function MySimpleTableFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: mySimpleTableFunction.handler CodeUri: ./functions Policies: - DynamoDBCrudPolicy: TableName: !Ref MySimpleTable Environment: Variables: TABLE_NAME: !Ref MySimpleTable Events: MySimpleFunctionAPI: Type: Api Properties: Path: /simpletable Method: GET MySimpleTable: Type: AWS::Serverless::SimpleTable AWS SAM Globals
  • 45. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda Environment Variables • Key-value pairs that you can dynamically pass to your function • Available via standard environment variable APIs such as process.env for Node.js or os.environ for Python • Can optionally be encrypted via AWS Key Management Service (KMS) • Useful for creating environments per stage (i.e. dev, testing, production)
  • 46. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda Environment Variables In AWS SAM template MySimpleFunction: Type: "AWS::Serverless::Function" Properties: Handler: mySimpleFunction.handler Policies: - DynamoDBCrudPolicy: TableName: !Ref MyDynamoDBTable Environment: Variables: TABLE_NAME: !Ref MyDynamoDBTable Events: MySimpleFunctionAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /simple Method: GET
  • 47. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS Lambda Environment Variables In the handler of the function MySimpleFunction: Type: "AWS::Serverless::Function" Properties: Handler: mySimpleFunction.handler Policies: - DynamoDBCrudPolicy: TableName: !Ref MyDynamoDBTable Environment: Variables: TABLE_NAME: !Ref MyDynamoDBTable Events: MySimpleFunctionAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /simple Method: GET 'use strict'; const TABLE_NAME = process.env.TABLE_NAME; module.exports.getItem = async (propertyId, sortKey) => { console.log('getItem'); ...
  • 48. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages DEV STAGE PROD
  • 49. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages In AWS SAM template Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Mappings: ResourcesName: dev: tableName: MyDynamoDBTable-dev staging: tableName: MyDynamoDBTable-staging prod: tableName: MyDynamoDBTable-prod Resources: MyDynamoDBTable: Type: "AWS::DynamoDB::Table" Properties: . . . TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
  • 50. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages In AWS SAM template Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Mappings: ResourcesName: dev: tableName: MyDynamoDBTable-dev staging: tableName: MyDynamoDBTable-staging prod: tableName: MyDynamoDBTable-prod Resources: MyDynamoDBTable: Type: "AWS::DynamoDB::Table" Properties: . . . TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
  • 51. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages In AWS SAM template Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Mappings: ResourcesName: dev: tableName: MyDynamoDBTable-dev staging: tableName: MyDynamoDBTable-staging prod: tableName: MyDynamoDBTable-prod Resources: MyDynamoDBTable: Type: "AWS::DynamoDB::Table" Properties: . . . TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
  • 52. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages In AWS SAM template Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Mappings: ResourcesName: dev: tableName: MyDynamoDBTable-dev staging: tableName: MyDynamoDBTable-staging prod: tableName: MyDynamoDBTable-prod Resources: MyDynamoDBTable: Type: "AWS::DynamoDB::Table" Properties: . . . TableName: !FindInMap [ResourcesName, !Ref MyEnvironment, tableName]
  • 53. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different resources names for different stages We need to pass the stage name as a parameter when we create the AWS Cloudformation change set In AWS CodePipeline
  • 54. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodeCommit • Fully managed source-control service that hosts secure Git-based repositories • Allows teams to collaborate on code in a secure and highly scalable ecosystem • Automatically encrypts your files in transit and at rest • Integrated with AWS Identity and Access Management (IAM) • https://aws.amazon.com/codecommit/
  • 55. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Third-party code repositories private repo Integrates with AWS CodeBuild and AWS CodePipeline Integrates with AWS CodeBuild
  • 56. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production
  • 57. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Continuous integration goals 1. Automatically kick off a new release when new code is checked in 2. Build and test code in a consistent, repeatable environment 3. Continually have an artifact ready for deployment 4. Continually close feedback loop when build fails
  • 58. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodeBuild • Fully managed build service that can compile source code, run tests, and produce software packages • Scales continuously and processes multiple builds concurrently • Can consume environment variables from AWS Systems Manager Parameter Store • No build servers to manage • Supports dependency caching • https://aws.amazon.com/codebuild/
  • 59. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI
  • 60. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI Use install phase to install packages or any pre- reqs you may need throughout the build
  • 61. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI Use pre-build phase to run unit tests
  • 62. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI In the build phase, we build the project using AWS SAM
  • 63. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI Use post-build for creating the package of the artifact
  • 64. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. phases: install: commands: - pip install --upgrade pip - pip install pipenv –user - pipenv install awscli aws-sam-cli - npm install pre_build: commands: - eslint *.js - npm test build: commands: - sam build post_build: commands: - sam package –template-file template.yaml –s3-bucket $BUCKET_NAME –output-template packaged.yaml artifacts: type: zip files: - packaged.yaml AWS CodeBuild: Lambda buildspec using SAM CLI Where AWS CodeBuild can find the output artifacts
  • 65. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production
  • 66. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Where and what to test • Code review via pull request • Lint/syntax check • Unit test pass • Code successfully compiles • Application deploys successfully • Mocked/stubbed integration tests • Application deploys successfully • Test against real services (potentially against production dependencies) • Run pre-traffic Lambda tests • Deploy canaries • Complete wait period successfully • Deploy 100% • Run post-traffic Lambda tests Source Source CodeCommit i Build test-build-source CodeBuild i Deploy-Testing create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Run-stubs Lambda i Deploy-Staging Deploy-Prod create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i Post-Deploy-Stack Lambda i create-changeset AWS CloudFormation i execute-changeset AWS CloudFormation i QA-Sign-Off Manual approval i Review Run-API-test Runscope i
  • 67. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different ways to make sure everything is ok AWS Lambda functions Third party services Manual QA Safe deployments
  • 68. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using AWS Lambda to perform integration tests… exports.handler = async (event, context) => { let jobId = event["CodePipeline.job"].id; // DO SOME INTEGRATION TESTS if (testsPassed) { let params = { jobId: jobId }; return codepipeline.putJobSuccessResult(params).promise(data => { context.succeed('Test passed'); }).catch(error => { context.fail(error); }); } else { let params = { jobId: jobId, failureDetails: { message: JSON.stringify('Test failed’), type: 'JobFailed’, externalExecutionId: context.invokeid } }; return codepipeline.putJobFailureResult(params).promise(data => { context.fail(message); }); } };
  • 69. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using AWS Lambda to perform integration tests… exports.handler = async (event, context) => { let jobId = event["CodePipeline.job"].id; // DO SOME INTEGRATION TESTS if (testsPassed) { let params = { jobId: jobId }; return codepipeline.putJobSuccessResult(params).promise(data => { context.succeed('Test passed'); }).catch(error => { context.fail(error); }); } else { let params = { jobId: jobId, failureDetails: { message: JSON.stringify('Test failed’), type: 'JobFailed’, externalExecutionId: context.invokeid } }; return codepipeline.putJobFailureResult(params).promise(data => { context.fail(message); }); } }; Write some integration tests
  • 70. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using AWS Lambda to perform integration tests… exports.handler = async (event, context) => { let jobId = event["CodePipeline.job"].id; // DO SOME INTEGRATION TESTS if (testsPassed) { let params = { jobId: jobId }; return codepipeline.putJobSuccessResult(params).promise(data => { context.succeed('Test passed'); }).catch(error => { context.fail(error); }); } else { let params = { jobId: jobId, failureDetails: { message: JSON.stringify('Test failed’), type: 'JobFailed’, externalExecutionId: context.invokeid } }; return codepipeline.putJobFailureResult(params).promise(data => { context.fail(message); }); } }; Needs to call the putJobSuccessuResult
  • 71. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using AWS Lambda to perform integration tests… exports.handler = async (event, context) => { let jobId = event["CodePipeline.job"].id; // DO SOME INTEGRATION TESTS if (testsPassed) { let params = { jobId: jobId }; return codepipeline.putJobSuccessResult(params).promise(data => { context.succeed('Test passed'); }).catch(error => { context.fail(error); }); } else { let params = { jobId: jobId, failureDetails: { message: JSON.stringify('Test failed’), type: 'JobFailed’, externalExecutionId: context.invokeid } }; return codepipeline.putJobFailureResult(params).promise(data => { context.fail(message); }); } }; Needs to call the putJobFailureResult
  • 72. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using AWS Lambda to perform integration tests… exports.handler = async (event, context) => { let jobId = event["CodePipeline.job"].id; // DO SOME INTEGRATION TESTS if (testsPassed) { let params = { jobId: jobId }; return codepipeline.putJobSuccessResult(params).promise(data => { context.succeed('Test passed'); }).catch(error => { context.fail(error); }); } else { let params = { jobId: jobId, failureDetails: { message: JSON.stringify('Test failed’), type: 'JobFailed’, externalExecutionId: context.invokeid } }; return codepipeline.putJobFailureResult(params).promise(data => { context.fail(message); }); } }; More information on how to configure this https://amzn.to/2SVWZlW
  • 73. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Using 3rd party service to test For adding tests there are lots of 3rd party tools supported. Find more information on how to configure them with AWS CodePipeline here: https://amzn.to/2SV0iK3
  • 74. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Manual approvals
  • 75. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Manual approvals
  • 76. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CodeDeploy • Automates code deployments to any instance and Lambda • Handles the complexity of updating your applications • Avoid downtime during application deployment • Roll back automatically if failure detected • Deploy to Amazon EC2, Lambda, Fargate, EC2, or on- premises servers
  • 77. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Safe Deployment Canary10Percent30Minutes Canary10Percent5Minutes Canary10Percent10Minutes Canary10Percent15Minutes Linear10PercentEvery10Minutes Linear10PercentEvery1Minute Linear10PercentEvery2Minutes Linear10PercentEvery3Minutes AllAtOnce BeforeAllowTraffic AfterAllowTraffic AllowTraffic Deployment Preference
  • 78. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Versions are immutable snapshots of a function – code + configuration An Alias is a pointer to a version Lambda Version and aliases v1 v2 v3 Alias: prod Alias: dev
  • 79. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 Lambda function code 100%
  • 80. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 code100% Run PreTraffic hook against v2 code before it receives traffic v2 code0%
  • 81. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 code90% Wait for 10 minutes, roll back in case of alarm v2 code10%
  • 82. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 code0% Run PostTraffic hook and complete deployment v2 code100%
  • 83. Testing using safe deployments HelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.hello Runtime: nodejs12.x CodeUri: ./hello AutoPublishAlias: live DeploymentPreference: Type: Linear10PercentEvery10Minutes Alarms: - !Ref AliasErrorMetricGreaterThanZeroAlarm - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PostTrafficLambdaFunction
  • 84. HelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.hello Runtime: nodejs12.x CodeUri: ./hello AutoPublishAlias: live DeploymentPreference: Type: Linear10PercentEvery10Minutes Alarms: - !Ref AliasErrorMetricGreaterThanZeroAlarm - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PostTrafficLambdaFunction Testing using safe deployments Instructs AWS SAM to publish a new version of the function for each new deployment and link it to the live alias
  • 85. HelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.hello Runtime: nodejs12.x CodeUri: ./hello AutoPublishAlias: live DeploymentPreference: Type: Linear10PercentEvery10Minutes Alarms: - !Ref AliasErrorMetricGreaterThanZeroAlarm - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PostTrafficLambdaFunction Testing using safe deployments Canary10Percent30Minutes Canary10Percent5Minutes Canary10Percent10Minutes Canary10Percent15Minutes Linear10PercentEvery10Minutes Linear10PercentEvery1Minute Linear10PercentEvery2Minutes Linear10PercentEvery3Minutes AllAtOnce
  • 86. HelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.hello Runtime: nodejs12.x CodeUri: ./hello AutoPublishAlias: live DeploymentPreference: Type: Linear10PercentEvery10Minutes Alarms: - !Ref AliasErrorMetricGreaterThanZeroAlarm - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PostTrafficLambdaFunction Testing using safe deployments A list of alarms that you want to monitor You can specify a maximum of 10 alarms
  • 87. HelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.hello Runtime: nodejs12.x CodeUri: ./hello AutoPublishAlias: live DeploymentPreference: Type: Linear10PercentEvery10Minutes Alarms: - !Ref AliasErrorMetricGreaterThanZeroAlarm - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PostTrafficLambdaFunction Testing using safe deployments Validation Lambda functions that are run before & after traffic shifting
  • 88. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
  • 89. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark.
  • 90. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different strategies for different stages DEV STAGE PROD Linear10PercentEvery10Minutes Lambda function
  • 91. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different strategies for different stages Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Conditions: IsProd: !Equals [!Ref MyEnvironment, prod] MySafeDeployedFunction: Type: "AWS::Serverless::Function" Properties: Handler: mySafeDeployedFunction.handler AutoPublishAlias: live DeploymentPreference: Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
  • 92. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different strategies for different stages Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Conditions: IsProd: !Equals [!Ref MyEnvironment, prod] MySafeDeployedFunction: Type: "AWS::Serverless::Function" Properties: Handler: mySafeDeployedFunction.handler AutoPublishAlias: live DeploymentPreference: Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
  • 93. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Different strategies for different stages Parameters: MyEnvironment: Type: String Default: dev AllowedValues: - dev - staging - prod Conditions: IsProd: !Equals [!Ref MyEnvironment, prod] MySafeDeployedFunction: Type: "AWS::Serverless::Function" Properties: Handler: mySafeDeployedFunction.handler AutoPublishAlias: live DeploymentPreference: Type: !If [IsProd, Linear10PercentEvery1Minute, AllAtOnce]
  • 94. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Release process stages Source Build Test Production
  • 95. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Continuous deployment goals 1. Automatically deploy new changes to staging environments for testing 2. Deploy to production safely without impacting customers 3. Deliver to customers faster: Increase deployment frequency, and reduce change lead time and change failure rate
  • 96. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Monitoring and observability Amazon CloudWatch Collects monitoring and operational data in the form of logs, metrics, and events AWS X-Ray Provides a trace or an end-to-end view of requests traveling through your application
  • 97. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. How to get started
  • 98. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Start working with a template pipeline https://github.com/aws-samples/cookiecutter-aws-sam-pipeline
  • 99. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Code for the example pipeline https://github.com/mavi888/demo-cicd-codepipeline
  • 100. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. “Create application” experience Create a serverless application from a starter template • AWS SAM template for IaC • CI/CD pipeline • Clone locally for development with AWS SAM CLI
  • 101. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. “Create application” experience
  • 102. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. AWS developer tools Source Build Test Deploy Monitor AWS CodeBuild + third party Software release steps AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline AWS CodeStar AWS X-Ray Amazon CloudWatch
  • 103. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Takeaways 1. Manage your infrastructure as code 2. Frequently build and integrate your code to get a first feedback 3. Continuously release in production using canary releases with monitoring and automated rollbacks 4. Use canary releases to get both technical and business feedback
  • 104. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. Thank you!Marcia Villalba @mavi888uy YouTube Channel: https://youtube.com/foobar_codes