Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

2020.02.15 DelEx - CI/CD in AWS Cloud

115 views

Published on

About CI/CD tools in AWS Cloud:
CodePipeline / CodeBuild / CodeDeploy

Published in: Technology
  • Be the first to comment

  • Be the first to like this

2020.02.15 DelEx - CI/CD in AWS Cloud

  1. 1. Peter Salnikov / AWS Architect & DevOps Expert / www.salnikov.cc CI/CD in AWS Cloud
  2. 2. CodePipeline + CodeBuild + CodeDeploy
  3. 3. Sample Serverless Application API Gateway Lambda DynamoDB Repo per Lambda NodeJS Sources Single repo for all CF Templates
  4. 4. Pipeline = Source + Build + Deploy CodePipeline: - Watch for CodeCommit Git Repos - Combine CodeBuild + CodeDeploy CodeBuild: - Prepare JSON with input parameters for CloudFormation - Validate, Test and Pack Lambda Package CodeDeploy: - Update CloudFormation Stack using Input parameters and Lambda package
  5. 5. CodePipeline = Stages + Actions action actionSTAG E action action action Stage Stage Stage Stage
  6. 6. Pipeline Lambda CF Templates Lambda NodeJs Sources Combine Sources and store on S3 Prepare CF Input Params Build Lambda Package Deploy/Update Lambda CF Stack Notify to Slack
  7. 7. Pipeline Source Stage Lambda CF Templates Lambda NodeJs Sources Combine Sources and store on S3 Prepare CF Input Params Build Lambda Package Deploy/Update Lambda CF Stack Notify to Slack
  8. 8. Pipeline Validate Stage Lambda CF Templates Lambda NodeJs Sources Combine Sources and store on S3 Prepare CF Input Params Build Lambda Package Deploy/Update Lambda CF Stack Notify to Slack
  9. 9. Pipeline Build Stage Lambda CF Templates Lambda NodeJs Sources Combine Sources and store on S3 Prepare CF Input Params Build Lambda Package Deploy/Update Lambda CF Stack Notify to Slack
  10. 10. Pipeline Deploy Stage Lambda CF Templates Lambda NodeJs Sources Combine Sources and store on S3 Prepare CF Input Params Build Lambda Package Deploy/Update Lambda CF Stack Notify to Slack
  11. 11. CodePipeline Stage Actions
  12. 12. CodePipeline Stages Source Build Test Deploy Approval Invoke ➔ AWS S3 ➔ AWS CodeCommit ➔ GitHub ➔ AWS ECR ➔ AWS CodeStar Connections ➔ AWS CodeBuild ➔ CloudBees ➔ Jenkins ➔ TeamCity ➔ AWS CodeBuild ➔ AWS DeviceFarm ➔ Blaze Meter ➔ Ghost Insepctor ➔ Micro Focus StormRunner Loader ➔ Nouvola ➔ Runscope ➔ AWS S3 ➔ AWS CloudFormati on ➔ AWS CodeDeploy ➔ AWS ECS ➔ AWS Beanstalk ➔ AWS OpsWorks ➔ AWS Service Catalog ➔ Alexa Skill Kit ➔ Xebia Labs ➔ AWS SNS ➔ AWS Lambda
  13. 13. CodePipeline Triggering AWS Lambda AWS CloudWatch Event Manual WebHooks AWS CodeCommit/GitHub Polling AWS CodePipeline
  14. 14. CodePipeline Source Stage 1 CodePipeline: 2 Type: AWS::CodePipeline::Pipeline 3 Properties: 4 Stages: 5 - Name: Source 6 Actions: 7 - Name: LambdaCodeSource 8 RunOrder: 1 9 InputArtifacts: [] 10 ActionTypeId: 11 Version: '1' 12 Owner: AWS 13 Category: Source 14 Provider: CodeCommit 15 Configuration: 16 RepositoryName: lambda.name 17 BranchName: master
  15. 15. CodeBuild
  16. 16. CodeBuild Spec 1 version: 0.2 2 phases: 3 install: 4 runtime-versions: 5 nodejs: 12 6 commands: 7 yum install -y jq 8 build: 9 commands: 10 - npm install 11 - npm pack 12 - zip -r $LAMBDA_NAME.zip ./build/* 13 artifacts: 14 type: zip 15 files: 16 - ./*.zip 17 cache: 18 paths: 19 - './node_modules'
  17. 17. CodeDeploy AWS Lambda AWS ECSEC2/OnPrem
  18. 18. CodePipeline Source Stage 1 CodePipeline: 2 Type: AWS::CodePipeline::Pipeline 3 Properties: 4 Stages: 5 - Name: UpdateLambdaStack 6 RunOrder: 2 7 ActionTypeId: 8 Owner: AWS 9 Category: Deploy 10 Provider: CloudFormation 11 Version: '1' 12 InputArtifacts: 13 - Name: LambdaCloudFormation 14 Configuration: 15 ActionMode: REPLACE_ON_FAILURE 16 RoleArn: !Ref arn 17 StackName: !Sub stack_name 18 TemplateConfiguration: LambdaCloudFormation::lambda.json 19 TemplatePath: LambdaCloudFormation::lambda.yaml
  19. 19. Pricing CodePipeline: $1.00 pipeline / month CodeBuild: Compute instance type Memory vCP U Linux price per build minute Windows price per build minute general1.medium 7 GB 4 $0.01 $0.018 general1.large 15 GB 8 $0.02 $0.036 arm1.large 16 GiB 8 $0.015 N/A general1.small 3 GB 2 $0.005 N/A general1.2xlarge 144 GiB 72 $0.20 N/A gpu1.large 244 GiB 32 $0.65 N/A CodeDeploy: To EC2/Lambda - free To OnPrem - $0.02 per OnPrem Instance Update
  20. 20. THANK YOU Does anyone have any questions? peter@salnikov.cc t.me/PeterSalnikov fb.me/peter.salnikov www.salnikov.cc

×