SlideShare a Scribd company logo
© 2020, Amazon Web Services, Inc. or its Affiliates.
What’s NewWith SAM?
Ben Smith
Senior Developer Advocate, AWS Serverless
@benjamin_l_s
© 2020, Amazon Web Services, Inc. or its Affiliates.
S
A
M
© 2020, Amazon Web Services, Inc. or its Affiliates.
Serverless
Application
Model
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM comes in 2 parts
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM comes in 2 parts
SAM templates SAM CLI
Using shorthand syntax to
express resources and event
source mappings, it provides
infrastructure as code (IaC)
for serverless applications.
Provides tooling for local
development, debugging,
build, packaging, and
deployment for serverless
applications
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAMTemplates
• Can mix in other CloudFormation resources
• i.e. Amazon S3, Amazon Kinesis, AWS Step
Functions
• Supports use of Parameters, Mappings, Outputs,
• Supports Intrinsic Functions
• ie: Ref, Sub, Join, Select, Split
• YAML or JSON
© 2020, Amazon Web Services, Inc. or its Affiliates.
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetProductsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.getProducts
Runtime: nodejs10.x
CodeUri: src/
Policies:
- DynamoDBReadPolicy:
TableName: !Ref ProductTable
Events:
GetResource:
Type: Api
Properties:
Path: /products/{productId}
Method: get
ProductTable:
Type: AWS::Serverless::SimpleTable
In just 20 lines:
• Lambda function
• IAM role
• API Gateway
• DynamoDB table
SAMTemplates
© 2020, Amazon Web Services, Inc. or its Affiliates.
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetProductsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.getProducts
Runtime: nodejs10.x
CodeUri: src/
Policies:
- DynamoDBReadPolicy:
TableName: !Ref ProductTable
Events:
GetResource:
Type: Api
Properties:
Path: /products/{productId}
Method: get
ProductTable:
Type: AWS::Serverless::SimpleTable
SAMTemplates
AWS Cloud
Amazon API Gateway
Lambda function
Table Role
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM Command
Line Interface
CLI tool for local development, debugging,
testing, deploying, and monitoring of serverless
applications
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
Minimized Deployment
Commands
This:
sam package --s3-bucket my-regional-bucket --
output-template-file out.yaml
sam deploy --template-file out.yaml --capabilities
CAPABILITY_IAM --stack-name MyStackName
> sam deploy
Is now this:
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
S3 Bucket Management
• SAM CLI now automatically creates a Bucket
> sam deploy
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• A new Interactive deployment process
> sam deploy –g (--guided)
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
The Guided Deployment
• Deployment config saved in samconfig.toml.
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
Updated User Interface
• More feedback and validation choices
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
Updated User Interface
• Developers can confirm changeset before
deploying
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI
Updated User Interface
• Console displays changes and outputs
© 2020, Amazon Web Services, Inc. or its Affiliates.
• SAM CLI outputs example
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI - FAQ
Backwards Compatibility ?
• SAM package still exists
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI - FAQ
Backwards Compatibility ?
• Parameters can be passed in for CICD
deployments
sam package --s3-bucket aws-sam-cli-managed-default-
samclisourcebucket-xic3fipuh9n9 --output-template-file
out.yaml
sam deploy --template-file out.yaml --capabilities
CAPABILITY_IAM --stack-name sam-app --region us-west-2
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI - FAQ
How many buckets are
Created ?
1 bucket per Region for a root level account
© 2020, Amazon Web Services, Inc. or its Affiliates.
SAM CLI - FAQ
What if samconfig.toml
is deleted ?
• SAM treats the application as new.
• Use the -g flag to reconfigure the application.
© 2020, Amazon Web Services, Inc. or its Affiliates.
Summary
• Streamlining the deployment process
• Removing the need to manage an S3 bucket
• Providing clear deployment feedback and data
Latest version of SAM CLI makes serverless development easier for developers by:
© 2020, Amazon Web Services, Inc. or its Affiliates.
Thank you
Ben Smith
Senior Developer Advocate, AWS Serverless
@benjamin_l_s

More Related Content

Similar to AWS re:Invent serverless recap day: What's new with SAM

Continuous Delivery on AWS with Zero Downtime
Continuous Delivery on AWS with Zero DowntimeContinuous Delivery on AWS with Zero Downtime
Continuous Delivery on AWS with Zero Downtime
Casey Lee
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit Berlin
Boaz Ziniman
 
AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...
Cobus Bernard
 
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
Amazon Web Services
 
AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...
Cobus Bernard
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
Boaz Ziniman
 
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
Amazon Web Services Korea
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
Amazon Web Services
 
Ci/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubCi/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO Club
Boaz Ziniman
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Amazon Web Services
 
Serverless-First Function: Serverless application security
Serverless-First Function: Serverless application securityServerless-First Function: Serverless application security
Serverless-First Function: Serverless application security
RobSutter2
 
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud MeetupCI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
Boaz Ziniman
 
AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...
Cobus Bernard
 
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Amazon Web Services
 
AWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWSAWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWS
Cobus Bernard
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
Sébastien ☁ Stormacq
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
Amazon Web Services Japan
 
Operationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
Operationalizing Microsoft Workloads, AWS Federal Pop-Up LoftOperationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
Operationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
Amazon Web Services
 
Private Equity Value Creation Carve Outs, Divestitures and mergers
Private Equity Value Creation Carve Outs, Divestitures and mergersPrivate Equity Value Creation Carve Outs, Divestitures and mergers
Private Equity Value Creation Carve Outs, Divestitures and mergers
Tom Laszewski
 
AWS Summit Stockholm - Fargate: deploy containers, not infrastructure
AWS Summit Stockholm - Fargate: deploy containers, not infrastructureAWS Summit Stockholm - Fargate: deploy containers, not infrastructure
AWS Summit Stockholm - Fargate: deploy containers, not infrastructure
Massimo Ferre'
 

Similar to AWS re:Invent serverless recap day: What's new with SAM (20)

Continuous Delivery on AWS with Zero Downtime
Continuous Delivery on AWS with Zero DowntimeContinuous Delivery on AWS with Zero Downtime
Continuous Delivery on AWS with Zero Downtime
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit Berlin
 
AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...
 
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 DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
 
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
[AWS Innovate 온라인 컨퍼런스] Kubernetes와 SageMaker를 활용하여 Machine Learning 워크로드 관리하...
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
 
Ci/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubCi/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO Club
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
 
Serverless-First Function: Serverless application security
Serverless-First Function: Serverless application securityServerless-First Function: Serverless application security
Serverless-First Function: Serverless application security
 
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud MeetupCI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
 
AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...
 
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
 
AWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWSAWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWS
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
 
Operationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
Operationalizing Microsoft Workloads, AWS Federal Pop-Up LoftOperationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
Operationalizing Microsoft Workloads, AWS Federal Pop-Up Loft
 
Private Equity Value Creation Carve Outs, Divestitures and mergers
Private Equity Value Creation Carve Outs, Divestitures and mergersPrivate Equity Value Creation Carve Outs, Divestitures and mergers
Private Equity Value Creation Carve Outs, Divestitures and mergers
 
AWS Summit Stockholm - Fargate: deploy containers, not infrastructure
AWS Summit Stockholm - Fargate: deploy containers, not infrastructureAWS Summit Stockholm - Fargate: deploy containers, not infrastructure
AWS Summit Stockholm - Fargate: deploy containers, not infrastructure
 

Recently uploaded

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

AWS re:Invent serverless recap day: What's new with SAM

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. What’s NewWith SAM? Ben Smith Senior Developer Advocate, AWS Serverless @benjamin_l_s
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. S A M
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. Serverless Application Model
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM comes in 2 parts
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM comes in 2 parts SAM templates SAM CLI Using shorthand syntax to express resources and event source mappings, it provides infrastructure as code (IaC) for serverless applications. Provides tooling for local development, debugging, build, packaging, and deployment for serverless applications
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. SAMTemplates • Can mix in other CloudFormation resources • i.e. Amazon S3, Amazon Kinesis, AWS Step Functions • Supports use of Parameters, Mappings, Outputs, • Supports Intrinsic Functions • ie: Ref, Sub, Join, Select, Split • YAML or JSON
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetProductsFunction: Type: AWS::Serverless::Function Properties: Handler: index.getProducts Runtime: nodejs10.x CodeUri: src/ Policies: - DynamoDBReadPolicy: TableName: !Ref ProductTable Events: GetResource: Type: Api Properties: Path: /products/{productId} Method: get ProductTable: Type: AWS::Serverless::SimpleTable In just 20 lines: • Lambda function • IAM role • API Gateway • DynamoDB table SAMTemplates
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetProductsFunction: Type: AWS::Serverless::Function Properties: Handler: index.getProducts Runtime: nodejs10.x CodeUri: src/ Policies: - DynamoDBReadPolicy: TableName: !Ref ProductTable Events: GetResource: Type: Api Properties: Path: /products/{productId} Method: get ProductTable: Type: AWS::Serverless::SimpleTable SAMTemplates AWS Cloud Amazon API Gateway Lambda function Table Role
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM Command Line Interface CLI tool for local development, debugging, testing, deploying, and monitoring of serverless applications
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI Minimized Deployment Commands This: sam package --s3-bucket my-regional-bucket -- output-template-file out.yaml sam deploy --template-file out.yaml --capabilities CAPABILITY_IAM --stack-name MyStackName > sam deploy Is now this:
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI S3 Bucket Management • SAM CLI now automatically creates a Bucket > sam deploy
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • A new Interactive deployment process > sam deploy –g (--guided)
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI The Guided Deployment • Deployment config saved in samconfig.toml.
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI Updated User Interface • More feedback and validation choices
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI Updated User Interface • Developers can confirm changeset before deploying
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI Updated User Interface • Console displays changes and outputs
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. • SAM CLI outputs example
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI - FAQ Backwards Compatibility ? • SAM package still exists
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI - FAQ Backwards Compatibility ? • Parameters can be passed in for CICD deployments sam package --s3-bucket aws-sam-cli-managed-default- samclisourcebucket-xic3fipuh9n9 --output-template-file out.yaml sam deploy --template-file out.yaml --capabilities CAPABILITY_IAM --stack-name sam-app --region us-west-2
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI - FAQ How many buckets are Created ? 1 bucket per Region for a root level account
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. SAM CLI - FAQ What if samconfig.toml is deleted ? • SAM treats the application as new. • Use the -g flag to reconfigure the application.
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. Summary • Streamlining the deployment process • Removing the need to manage an S3 bucket • Providing clear deployment feedback and data Latest version of SAM CLI makes serverless development easier for developers by:
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. Thank you Ben Smith Senior Developer Advocate, AWS Serverless @benjamin_l_s