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

Safe Lambda Deployments 2019-02-19

sullis
February 19, 2019

Safe Lambda Deployments 2019-02-19

PDX Serverless Architecture Meetup
February 19, 2019
Portland Oregon

#awscloud #awslambda #serverless #pdxtech

sullis

February 19, 2019
Tweet

More Decks by sullis

Other Decks in Technology

Transcript

  1. “Your deploys should be as boring, straightforward, and stress-free as

    possible” Zach Holman March 2016 https://zachholman.com/posts/deploying-software
  2. “You don't need release managers, you don't need special deploy

    days, you don't need all hands on deck for every single deploy.” Zach Holman March 2016 https://zachholman.com/posts/deploying-software
  3. “We love to deploy new code incrementally hundreds of times

    a day. And there's good reason for that: it's safer overall. Incremental deploys are easier to understand and fix than one gigantic deploy once a year.” https://zachholman.com/talk/move-fast-break-nothing/ Zach Holman October 2014
  4. “You go to production with the code you have, not

    the code you might want or wish to have at a later time.” Donald Rumsfeld December 2004 * fake quote
  5. HBC email types • order acknowledgement • order shipment partial

    • order shipment full • order cancel • ready for pickup in store
  6. Queue consumer Event queue Email Dashboard UI Email Sender Email

    Render External Email Provider Feature Flag service
  7. You can now shift incoming traffic between two AWS Lambda

    function versions based on pre-assigned weights. You can now also use AWS CodeDeploy to automatically manage the rollout of new function versions. This allows you to gradually shift traffic between two versions source: aws.amazon.com
  8. $ brew update $ brew tap aws/tap $ brew install

    aws/tap/aws-sam-cli $ brew install aws-cli
  9. aws cloudformation package \ --template-file my-template.yaml \ --s3-bucket mycorp-codedeploy \

    --s3-prefix my-lambda-func/jars \ --output-template-file package/2325bd1e.yaml
  10. aws cloudformation deploy \ --template-file package/2325bd1e.yaml \ --stack-name mylambda-func—xyz \

    --parameter-overrides Stage=xyz \ --region us-east-1 \ --capabilities CAPABILITY_IAM \ --notification-arns arn:aws:sns:us- east-1:123456789:myteam-cf-notifications
  11. aws cloudformation deploy \ --template-file package/2325bd1e.yaml \ --stack-name mylambda-func—xyz \

    --parameter-overrides Stage=xyz \ --parameter-overrides DeploymentPref=Canary10Percent5Minutes \ --region us-east-1 \ --capabilities CAPABILITY_IAM \ --notification-arns arn:aws:sns:us- east-1:123456789:myteam-cf-notifications
  12. additional validation logic in Pre Traffic hook implement Post Traffic

    hook utilize AWS Cloud9 IDE Future work at HBC