11.Developer Tools -CI/CD
Inedx
- Code commit
- Code pipeline
- Code Build
- alternatives to Code Build
- Code Deploy
- alternatives to Code Build from aws
- CodeCommit
AWS CodeCommit – AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories
- CodeCommit is integrated with Jenkins, CodeBuild and other CI tools
- Repositories are automatically encrypted at rest through AWS Key Management Service (AWS KMS) using customer-specific keys
AWS CodeCommit – Authentication
- You need to configure your Git client to communicate with CodeCommit repositories
- As part of this configuration, you provide IAM credentials that CodeCommit can use to authenticate you.
- IAM supports CodeCommit with three types of credentials:
- Git credentials, an IAM-generated user name and password pair you can use to communicate with CodeCommit repositories over HTTPS
- SSH keys, a locally generated public-private key pair that you can associate with your IAM user to communicate with CodeCommit repositories over SSH.
- AWS access keys, which you can use with the credential helper included with the AWS CLI to communicate with CodeCommit repositories over HTTPS
AWS CodePipeline
- CodePipeline automates the build, test, and deploy phases of your release process every time there is a code change, based on the release model you define.
- CodePipeline provides tooling integrations for many AWS and third-party software at each stage of the pipeline including
- Source stage– S3, CodeCommit, Github, ECR, Bitbucket Cloud (beta
- Build – CodeBuild, Jenkins
- Deploy stage – CloudFormation, CodeDeploy, ECS, Elastic Beanstalk, AWS Service Catalog ,S3
AWS CodeBuild
- AWS CodeBuild is a fully managed continuous integration (CI) service that compiles source code, runs tests, and produces software packages that are ready to deploy.
- With CodeBuild, you don’t need to provision, manage, and scale your own build servers
- Build instructions can be defined in the code (buildspec.yml).
- Output logs can be sent to Amazon S3 & AWS CloudWatch Logs
AWS CodeDeploy
- An AWS CodeDeploy application contains information about what to deploy and how to deploy it.
- Need to choose the compute platform:
- EC2/On-premises
- AWS Lambda.
- Amazon ECS.
- EC2/On-Premises:
- Amazon EC2 cloud instances, on-premises servers, or both
- Deployments that use the EC2/On-Premises compute platform manage the way in which traffic is directed to instances by using an in-place or blue/green deployment type
- AWS Lambda:
- Used to deploy applications that consist of an updated version of a Lambda function
- You can manage the way in which traffic is shifted to the updated Lambda function versions during a deployment by choosing a canary, linear, or all-at-once configuration
- Amazon ECS
- Used to deploy an Amazon ECS containerized application as a task set
- CodeDeploy performs a blue/green deployment by installing an updated version of the application as a new replacement task set
- CodeDeploy reroutes production traffic from the original application task set to the replacement task set
- The original task set is terminated after a successful deployment
- You can manage the way in which traffic is shifted to the updated task set during a deployment by choosing a canary, linear, or all-at-once configuration.
AWS CodeDeploy – Blue/Green traffic shifting
- AWS Lambda: Traffic is shifted from one version of a Lambda function to a new version of the same Lambda function
- Amazon ECS: Traffic is shifted from a task set in your Amazon ECS service to an updated ,replacement task set in the same Amazon ECS service
- EC2/On-Premises: Traffic is shifted from one set of instances in the original environment to a replacement set of instances
Note: All AWS Lambda and Amazon ECS deployments are blue/green. An EC2/On-
Premises deployment can be in-place or blue/green
For Amazon ECS and AWS Lambda there are three ways traffic can be shifted during a deployment:
- Canary: Traffic is shifted in two increments. You can choose from predefined canary options that specify the percentage of traffic shifted to your updated Amazon ECS task set / Lambda function in the first increment and the interval, in minutes, before the remaining traffic is shifted in the second increment
- Linear: Traffic is shifted in equal increments with an equal number of minutes between each increment. You can choose from predefined linear options that specify the percentage of traffic shifted in each increment and the number of minutes between each increment
- All-at-once: All traffic is shifted from the original Amazon ECS task set / Lambda function to the updated Amazon ECS task set / Lambda function all at once.