Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beginning_Serverless_Applications_With_AWS_SAM.pdf

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.
Avatar for harprit harprit
January 17, 2019

 Beginning_Serverless_Applications_With_AWS_SAM.pdf

Beginning Serverless Applications with AWS SAM

Avatar for harprit

harprit

January 17, 2019
Tweet

Other Decks in Technology

Transcript

  1. #03 AWS SAM – a framework for building and managing

    Serverless applications. AWS Serverless Application Model 08
  2. 011 AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties:

    CodeUri: target/helloworldsam-1.0.jar Handler: com.Helloworldsam.App::handleRequest Runtime: java8 Events: HelloWorld: Type: Api Properties: Path: /hello/{name} Method: get HelloWorldTable: Type: AWS::Serverless::SimpleTable Transform Cloudformation FaaS Lambda Event API Gateway Serverless Resource DynamoDB Table
  3. 013 Api SNS Schedule SQS Kinesis DynamoDB S3 CloudWatchEvent CloudWatchLogs

    IoTRule AlexaSkill Event Sources Type: Api Properties: Path: /photos Method: post Type: S3 Properties: Bucket: my-bucket Events: s3:ObjectCreated:*
  4. 014 SAM CLI Commands sam init sam validate sam build

    sam local generate-event sam local invoke sam local start-api sam local start-lambda sam logs sam package sam deploy sam publish
  5. 015 Local Testing and Debugging sam local AWS Ecosystem Services,

    SAR, Cloud9 Serverless Friendly Cloudformation one less thing to learn Safe Lambda Deployments CanaryXPercentYMinutes vs LinearXPercentEveryYMinutes Why SAM?
  6. 016 MyLambdaFunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs6.10 AutoPublishAlias:

    live DeploymentPreference: Type: LinearXPercentEveryYMinutes Traffic to new version will linearly increase in steps of X percentage every Y minutes. Ex: Linear10PercentEvery10Minutes will add 10 percentage of traffic every 10 minute to complete in 100 minutes. Type: CanaryXPercentYMinutes X percent of traffic will be routed to new version for Y minutes. After Y minutes, 100 percent of traffic will be sent to new version. Some people call this as Blue/Green deployment. Ex: Canary10Percent15Minutes will send 10 percent traffic to new version and 15 minutes later complete deployment by sending all traffic to new version. Type: AllAtOnce