COMMUNITY DAY DevOps on AWS, Getting Started CodeDeploy AWS Native Continuous Delivery Tools CodeBuild CodePipeline DevOps and Continuous Delivery • Automated deployments • Repeatable and safer • Smaller change sizes • D eploy more frequently • Faster feedback loops • Learn and react quicker • Deliver more value Benefits of CodeDeploy • Automate your deployments • Fully managed serverless service • Free within AWS • $0.02 per on - premises instance update • Centralize control • Versatile Application The core component CodeDeploy Components Deployment Group A target for your deployment Deployment Roll out an app revision Compute platform EC 2 /On - premises, AWS Lambda, Amazon ECS A unique name An identifier that is unique inside its AWS account A CodeDeploy Application ECS An ECS cluster + An ECS service + A load balancer + Target Group 1 + Target Group 2 Lambda Lambda function name EC2/On - premises Autoscaling groups EC2 instance tags On - premises hosts Deployment Groups De p l o y m e n t group Targets for the deployment A CodeDeploy Deployment Deployment c o n f i g u r a t i o n Such as “ One At A Time ” Revision An application version De p l o y m e n t type “ In Place ” or “ B l u e - G r ee n ” ECS AppSpec file Task Definition version Container name Container port Lambda AppSpec file Function name Function alias Version info EC2/On - premises GitHub commit ID or Zip file in S3 Revisions version: 0.0 os: linux files: - source : /src destination : /var/www/html hooks: BeforeInstall : - location : scripts/before_install.sh timeout: 300 runas: root AppSpec File: appspec.yml EC2 or on - premises instance Installing the CodeDeploy Agent codedeploy - agent EC 2 User Data #!/bin/bash - xe yum install - y ruby cd /opt curl - O https:// aws - codedeploy - us - east - 1.s3.amazonaws.com/latest/install chmod +x ./install ./ install auto Install CodeDeploy - Red Hat CodeDeploy EL B EC 2 Connecting All CodeDeploy Pieces I A M GitHub or S 3 Revisions a g e n t I A M • Software licensing • CI software upgrades • Underlying host management • Agent configurations • Hand crafted build projects • Queued builds Traditional CI Continuous Integration • DevOps and agile processes • Helps prevent merge conflicts • Triggers off code commits • Static code analysis • Compiles code • Runs tests • Packages and publishes artifacts • Catch and fix problems quicker Continuous Integration Systems Managed services Master/agent Open Source and free T e a m c i t y B a m b o o J e n k i n s G i t L ab T r a v i s CircleCI Alternatives to CodeBuild Benefits of CodeBuild • Fully managed build service • Elastic scaling • Pay only for build time used • CLI and API driven • Define builds as code • Tightly knit AWS integrations • Extensible Sends n o ti f ic a t i o n s Runs tests Static code analysis Compiles code Runs builds How Is CodeBuild Used in a CI/CD pipeline? 1 2 3 4 6 Publishes A rtifacts 5 Build project The definition of your project Build or Build run An execution of your Build project CodeBuild Components