Slide 1

Slide 1 text

I N D I A | M A Y 2 6 , 2 0 2 2

Slide 2

Slide 2 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Serverless Apps with SAM Accelerate and SAM Pipelines Jones Zachariah Noel N D 1 D E V 1 0 4 Serverless Architect AWS Community Builder

Slide 3

Slide 3 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. We Will Be Looking Into ● Understanding SAM CLI ● Exploring SAM Accelerate ● SAM Accelerate CLI commands ● Need for CI/CD Pipelines for Serverless apps ● Building SAM Pipelines

Slide 4

Slide 4 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Understanding SAM CLI • The AWS Serverless Application Model (SAM) is an open-source framework. • Develop - Local test - Deploy with CLI commands • Provides templates for common use-cases. • Leverages AWS CloudFormation for deployment. • Provisioning Infrastructure as Code (IaC).

Slide 5

Slide 5 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM CLI Supported Runtimes • NodeJS 10.x, 12.x, 14.x • Python 3.9, 3.8, 3.7, 3.6 • Java 8, 11 • DotNet 6, 5.0 • DotNet core 2.1, 3.1 • Go 1.x • Ruby 2.7 • TypeScript

Slide 6

Slide 6 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerate

Slide 7

Slide 7 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Exploring SAM Accelerate • Speeds up local development and synchronization to the cloud. • Helps with testing the application on the cloud. • Enables seamless logging and tracing for the SAM application.

Slide 8

Slide 8 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Exploring SAM Accelerate • Uses AWS CLI based operations for fast deployments of AWS Lambda functions, AWS API Gateway and AWS Step Functions. • Is advised to be used only on the development AWS environment. • Is available with AWS SAM CLI version 1.34.1 or greater and this is in public preview.

Slide 9

Slide 9 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Accelerate CLI Commands Ø sam sync Synchronizing local code base along with configurations to the cloud stack. The sync command will build, package and deploy the changes to your AWS environment. Ø sam logs Logging multiple resources such as AWS Lambda functions, API Gateway, Step Functions. Ø sam trace Fetches AWS X-Ray traces in your AWS Account in the AWS Region into a local log stream.

Slide 10

Slide 10 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Serverless Riddler Riddler wants to move to a Serverless app which retrieves his riddles. But he thinks its a lot of time to deploy over AWS CloudFormation update stack! Image from dcmovies.wikia.com

Slide 11

Slide 11 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. DEMO GitHub : https://github.com/zachjonesnoel/sam-accelerate-aws-summit-india-2022

Slide 12

Slide 12 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Pipelines

Slide 13

Slide 13 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Need for CI/CD Pipelines for Serverless Apps ● Ensures best practices of develop - build - deliver ● Enhances code reliability ● Better transparency and accountability in different staging environments. ● Ease of maintenance ● Promotes Infrastructure as Code (IaC)

Slide 14

Slide 14 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building SAM Pipelines Deployment pipelines for automated cloud deployment to different staging environments. AWS SAM Pipelines facilitates templates for CI/CD pipeline providers - ● GitHub Actions ● AWS CodePipeline ● GitLab CI/CD ● Jenkins

Slide 15

Slide 15 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Pipelines CLI Commands • SAM pipeline bootstrap – Use this walkthrough to setup a CI/CD pipeline. • SAM pipeline init - This command generates your CI/CD pipeline configuration file with the details of different stages and IAM permissions. • SAM build - This command will build your workstation with the SAM template and the built artifacts would be available in the .aws- sam/build directory. • SAM deploy - Using AWS CloudFormation, it will deploy the “built artifacts” to the designated AWS Account.

Slide 16

Slide 16 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. How SAM Pipeline Works Commit code to Git repository Prod account CI/CD providers IAM credentials Prod pipeline execution role Prod CloudFormation execution role Prod artifact bucket Based on approval or automated test Staging account Staging pipeline execution role Staging CloudFormation execution role Staging artifact bucket

Slide 17

Slide 17 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Serverless Riddler CI/CD Pipeline Riddler is happy with the way how developers can use `sam sync` to develop and test faster. Time to go live? Well, Riddler would want a CI/CD pipeline implemented before going live! Image from dcmovies.wikia.com

Slide 18

Slide 18 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. DEMO GitHub : https://github.com/zachjonesnoel/sam-pipelines-aws-summit-india-2022

Slide 19

Slide 19 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Key Takeaways ● Understanding the ways of enabling developer friendly approach to develop Serverless apps on AWS SAM. ● Following the best practices to ensure smooth and fast deployment. ● Implementing the DevOps practices with Serverless apps to ensure CI/CD pipelines and smarter, faster, better delivery.

Slide 20

Slide 20 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Resources ● Getting Started with AWS SAM https://docs.aws.amazon.com/serverless-application- model/latest/developerguide/serverless-getting-started.html ● SAM Accelerate : https://docs.aws.amazon.com/serverless-application- model/latest/developerguide/accelerate.html ● SAM deployment : https://docs.aws.amazon.com/serverless-application- model/latest/developerguide/serverless-deploying.html ● Demo Source Code on GitHub : https://github.com/zachjonesnoel/sam-accelerate-aws-summit-india-2022

Slide 21

Slide 21 text

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deepen your skills with digital learning on demand Access 500+ free digital courses and Learning Plans Earn an industry-recognized credential AWS Skill Builder AWS Certifications Explore resources with a variety of skill levels and 16+ languages to meet your learning needs Join the AWS Certified community and get exclusive benefits Receive Foundational, Associate, Professional, and Specialty certifications Train now Access new exam guides © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Learn in-demand AWS Cloud Skills

Slide 22

Slide 22 text

Thank you! © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jones Zachariah Noel N Twitter: @zachjonesnoel Github: zachjonesnoel Website: www.zachjonesnoel.com

Slide 23

Slide 23 text

Please complete the session survey © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.