Continuous Delivery using
CodePipeline, Lambda &
ElasticBeanstalk
THOMAS SHAW
AUGUST 2016
@thomasshaw
thomas@recruitmentdirectory.com.au
Thomas Shaw - August 2016 Slide 2
What am I talking about
• What is AWS CodePipeline?
• Where does CodePipeline fit in to the product mix?
• Code Pipeline Terminology
• Deploy Processes
• Demo – Basic pipeline (S3 > ElasticBeanstalk)
• Demo – Pipeline (Bitbucket > S3 > Lambda > Multi-region
ElasticBeanstalk)
• Tips, tricks & problems
• Feature requests
Thomas Shaw - August 2016 Slide 3
AWS CodePipeline
• Continuous delivery service for fast and reliable application
updates
• Model and visualise and control your software release process
• Builds, tests, and deploys your code every time there is a code
change
• Integrates with third-party tools and AWS products
• Configurable workflow
• Easy to integrate
• Improved quality
• Rapid delivery
• Building blocks
Thomas Shaw - August 2016 Slide 4
Why use it?
• Allows powerful modeling of your release processes
• Serial and parallel execution
• Easily add a new step to your process
• Pause for manual approvals
• Multiple deployment steps
Thomas Shaw - August 2016 Slide 5
AWS CodePipeline
Announced - November 2014
Public - July 2015
Available in 3 regions
• US East (N. Virginia)
• US West (Oregon)
• EU (Ireland)
NOT CURRENTLY AVAILABLE IN AUSTRALIA
$1 per active* pipeline per month
https://aws.amazon.com/codepipeline/
Thomas Shaw - August 2016 Slide 6
Release Process Phases
Thomas Shaw - August 2016 Slide 7
AWS Product Integrations
Thomas Shaw - August 2016 Slide 8
AWS Service Integrations
6 “Actions”
• Approval
• Source
• Build
• Test
• Deploy
• Invoke
Thomas Shaw - August 2016 Slide 9
3rd Party Integrations
Thomas Shaw - August 2016 Slide 10
AWS CodePipeline
Thomas Shaw - August 2016 Slide 11
CodePipeline Terminology
Pipeline
Transition
Pipeline name
Stage
Action
Thomas Shaw - August 2016 Slide 12
CodePipeline Terminology
Parallel Actions
Thomas Shaw - August 2016 Slide 13
CodePipeline Terminology
Sequential Actions
Thomas Shaw - August 2016 Slide 14
NEW Manual Approval – Aug16
You can add a manual approval
action where you want the pipeline to
stop running until someone
approves or rejects the revision.
• Pipeline will stop executing when it
has reached the action
• Pipeline execution resumes only
when the action has been approved
• Approval action managed with AWS
IAM permissions
• Pipeline can notify users via SNS –
email, SMS, webhooks etc
Thomas Shaw - August 2016 Slide 15
Why I tried CodePipeline
• 3 weeks of experimentation.
• Outgrew our existing solution using BitBucket Pipelines
• Cross region deployment all at once
• Need visualisation & GUI interface
• Add “gated” stages
• 5 min setup
• Increase developer productivity
• Lambda functions are very useful
Thomas Shaw - August 2016 Slide 16
Still in BETA?
Thomas Shaw - August 2016 Slide 17
Demos
• Build a basic pipeline
• S3 > ElasticBeanstalk
• Add “Approval” stage
• Deep dive into CodePipeline > Lambda JSON payload
• BitBucket > S3 > Lambda > ElasticBeanstalk (1 env)
• BitBucket > S3 > Approval stage > Lambda > ElasticBeanstalk
(4 env, 2 regions)
Thomas Shaw - August 2016 Slide 18
Failed Deploy
Thomas Shaw - August 2016 Slide 19
Lambda debug
Thomas Shaw - August 2016 Slide 20
Tips & Tricks
• S3 source bucket needs to be in the same region as
CodePipeline
• S3 bucket – turn on versioning
• Poll time ~30sec – 1min
• Input/Output artifact name truncation ~10 characters
• Lambda log files are great for debug
• Understand the CodePipeline > Lambda JSON payload
• BitBucket > S3 (using BitBucket Pipelines)
• Console delays
Thomas Shaw - August 2016 Slide 21
Feature Suggestions
• Native Bitbucket integration
• Ability to pass more environment variables through the
stage/actions
• Change Poll time
• Pipeline/Stage History
• Version control
• S3 as a Deploy location
• Cross region support
• Artifact extensions
• Mobile app
• Documentation
Thomas Shaw - August 2016 Slide 22
Questions?

Continuous Delivery using AWS CodePipeline, AWS Lambda & AWS ElasticBeanstalk

  • 1.
    Continuous Delivery using CodePipeline,Lambda & ElasticBeanstalk THOMAS SHAW AUGUST 2016 @thomasshaw thomas@recruitmentdirectory.com.au
  • 2.
    Thomas Shaw -August 2016 Slide 2 What am I talking about • What is AWS CodePipeline? • Where does CodePipeline fit in to the product mix? • Code Pipeline Terminology • Deploy Processes • Demo – Basic pipeline (S3 > ElasticBeanstalk) • Demo – Pipeline (Bitbucket > S3 > Lambda > Multi-region ElasticBeanstalk) • Tips, tricks & problems • Feature requests
  • 3.
    Thomas Shaw -August 2016 Slide 3 AWS CodePipeline • Continuous delivery service for fast and reliable application updates • Model and visualise and control your software release process • Builds, tests, and deploys your code every time there is a code change • Integrates with third-party tools and AWS products • Configurable workflow • Easy to integrate • Improved quality • Rapid delivery • Building blocks
  • 4.
    Thomas Shaw -August 2016 Slide 4 Why use it? • Allows powerful modeling of your release processes • Serial and parallel execution • Easily add a new step to your process • Pause for manual approvals • Multiple deployment steps
  • 5.
    Thomas Shaw -August 2016 Slide 5 AWS CodePipeline Announced - November 2014 Public - July 2015 Available in 3 regions • US East (N. Virginia) • US West (Oregon) • EU (Ireland) NOT CURRENTLY AVAILABLE IN AUSTRALIA $1 per active* pipeline per month https://aws.amazon.com/codepipeline/
  • 6.
    Thomas Shaw -August 2016 Slide 6 Release Process Phases
  • 7.
    Thomas Shaw -August 2016 Slide 7 AWS Product Integrations
  • 8.
    Thomas Shaw -August 2016 Slide 8 AWS Service Integrations 6 “Actions” • Approval • Source • Build • Test • Deploy • Invoke
  • 9.
    Thomas Shaw -August 2016 Slide 9 3rd Party Integrations
  • 10.
    Thomas Shaw -August 2016 Slide 10 AWS CodePipeline
  • 11.
    Thomas Shaw -August 2016 Slide 11 CodePipeline Terminology Pipeline Transition Pipeline name Stage Action
  • 12.
    Thomas Shaw -August 2016 Slide 12 CodePipeline Terminology Parallel Actions
  • 13.
    Thomas Shaw -August 2016 Slide 13 CodePipeline Terminology Sequential Actions
  • 14.
    Thomas Shaw -August 2016 Slide 14 NEW Manual Approval – Aug16 You can add a manual approval action where you want the pipeline to stop running until someone approves or rejects the revision. • Pipeline will stop executing when it has reached the action • Pipeline execution resumes only when the action has been approved • Approval action managed with AWS IAM permissions • Pipeline can notify users via SNS – email, SMS, webhooks etc
  • 15.
    Thomas Shaw -August 2016 Slide 15 Why I tried CodePipeline • 3 weeks of experimentation. • Outgrew our existing solution using BitBucket Pipelines • Cross region deployment all at once • Need visualisation & GUI interface • Add “gated” stages • 5 min setup • Increase developer productivity • Lambda functions are very useful
  • 16.
    Thomas Shaw -August 2016 Slide 16 Still in BETA?
  • 17.
    Thomas Shaw -August 2016 Slide 17 Demos • Build a basic pipeline • S3 > ElasticBeanstalk • Add “Approval” stage • Deep dive into CodePipeline > Lambda JSON payload • BitBucket > S3 > Lambda > ElasticBeanstalk (1 env) • BitBucket > S3 > Approval stage > Lambda > ElasticBeanstalk (4 env, 2 regions)
  • 18.
    Thomas Shaw -August 2016 Slide 18 Failed Deploy
  • 19.
    Thomas Shaw -August 2016 Slide 19 Lambda debug
  • 20.
    Thomas Shaw -August 2016 Slide 20 Tips & Tricks • S3 source bucket needs to be in the same region as CodePipeline • S3 bucket – turn on versioning • Poll time ~30sec – 1min • Input/Output artifact name truncation ~10 characters • Lambda log files are great for debug • Understand the CodePipeline > Lambda JSON payload • BitBucket > S3 (using BitBucket Pipelines) • Console delays
  • 21.
    Thomas Shaw -August 2016 Slide 21 Feature Suggestions • Native Bitbucket integration • Ability to pass more environment variables through the stage/actions • Change Poll time • Pipeline/Stage History • Version control • S3 as a Deploy location • Cross region support • Artifact extensions • Mobile app • Documentation
  • 22.
    Thomas Shaw -August 2016 Slide 22 Questions?