AWS CodePipeline
Overview
AWS CodePipeline is a service provided by AWS which helps with your application's release cycle - from the build phase to the testing phase and finally to deployment. Let's take a look at the key concepts and features of AWS CodeDeploy.
What is AWS CodePipeline?
AWS CodePipeline is a continuous integration and continuous deployment service offered by Amazon. It allows you to build, test and deploy your application with custom workflows that you can define for each of your environments (like Staging or Production).
Before we dive deeper into what AWS CodePipeline is, let's try to understand what these two terms mean - continuous integration and continuous deployment.
Continuous Integration is a software development pattern where developers regularly merge code changes into a central repository, after which automated tests are run. Continuous integration's main goal is to release software updates faster and fix bugs quicker. CI consists of building/packaging software and may involve other services like code coverage analysis tools.
Continuous Deployment builds on top of the principles of CI and is the process where code that is regularly merged is immediately tested and deployed for customers of the application to use. CD consists of deploying the code to an execution environment (, for example, a group of AWS EC2 Instances) and may involve other steps like database schema updates.
Continuous Delivery vs Continuous Deployment: The source code is automatically built and tested, and then placed in a repository. This process is called continuous delivery when you need explicit manual approval to move to the deployment stage. When there is no manual approval required and the deployment stage is automatically started, this is called continuous deployment.
AWS CodePipeline is an end-to-end automated CICD system offered by Amazon. It enables you to automate the CICD process and easily track the progress of your deployment pipelines - increasing developer productivity and reducing the time required to release your software to customers.
Let's now explore the concepts and benefits of using AWS CodePipeline.
Concepts of AWS CodePipeline
The main concepts of AWS CodePipeline are:
- Pipeline: A pipeline is the workflow definition that describes your application's continuous integration and continuous deployment. You can use stages and actions to define the workflows.
- Stage: A stage is one major component in your pipeline. Stages are run in isolated environments and limit the number of parallel changes in that environment. Each stage is made up of several serial or parallel actions.
- Action: An action is an operation performed on your application code. This can range from building your application, running integration tests, or deploying to a runtime environment. There is six valid action types - Source, Build, Approval, Deploy, Test, and Invoke.
- Source can be used to pull source code from Amazon S3, AWS CodeCommit, or using Github via a CodeStarSourceConnection.
- Build, Deploy and Test can use AWS or custom on-prem environments to perform CICD actions.
- Approval can be used as an intermediate step whenever approval is required.
- Invoke can be used to invoke other AWS Services like AWS Lambda or AWS StepFunctions.
- Transition: A transition marks the point where a pipeline execution moves from one state in the pipeline to the next stage. Transitions can be disabled or enabled between stages.
- Artifact: Your application's source code and any other binary files (like dependencies, definition files, etc.) that are required to run your application are called artifacts. These include everything required for your pipeline to function. In a pipeline, artifacts can be the set of files worked on by an action and these are referred to as input artifacts. The final output of a completed action is referred to as output artifacts.
Features of AWS CodePipeline
Here are the features of AWS CodePipeline:
Automation of Release Process
- AWS CodePipline, along with other AWS services such as AWS CodeCommit and AWS CodeBuild, can be used to set up a complete end-to-end software release pipeline.
- AWS CodePipeline can be configured to use any operating system, any number of instances, and a custom deployment strategy.
Integration with AWS Services
- AWS CodePipeline is tightly integrated with multiple AWS Services.
- You can natively use AWS CodePipeline with Amazon S3 or Amazon ECR as source code repositories.
- Using AWS CloudFormation or AWS CodeDeploy you can automatically deploy your application in your infrastructure.
- AWS CodePipeline can also invoke AWS Lambda functions or send messages to AWS SNS topics as part of the pipeline.
Compatibility with Third Party Vendors
- AWS CodePipeline is also integrated with many third-party vendors, and hence you are not locked into using only AWS services.
- AWS CodePipeline can connect to Jenkins or TeamCity for specific stages.
- There are also a host of integrations available in the AWS Marketplace for code analysis and automated testing.
Pipeline Overview and History
- AWS CodePipeline enables you to keep track of your pipeline's progress and history on a single page.
- You can view the real-time status, check alert details, retry failed actions and so much more in the AWS CodePipeline dashboard.
- You also have access to the history of pipeline executions, including start time, stop time, run duration, and execution IDs.
Companies That Use AWS CodePipeline
Many companies worldwide use AWS CodePipeline in their CICD workflows. Here are some examples:
- Lululemon Athletica: This is a Canadian apparel company that sells clothing at more than 350 locations throughout the world, and uses AWS CodePipeline to streamline its development processes and support its continuous integration.
- 3M Health Information Systems: This is one of the world's largest providers of software for the healthcare industry. It uses CodePipline to manage its continuous integration and continuous delivery deployment workflows.
- side: Is a carpooling and bike pooling app for commuters in some of India's largest cities. It leverages CodePipeline to deploy its application faster and facilitate its twice-daily schedule for software releases.
Benefits Of Using AWS CodePipeline
With so many features, there are a lot of benefits of using AWS CodePipeline:
- AWS CodePipeline enables you to easily build end-to-end continuous integration and continuous deployment (CICD) pipelines using AWS native services - external dependencies can be avoided.
- AWS CodePiple already has integrations with many AWS services like AWS ECR, AWS S3, AWS CloudFormation, etc.
- AWS CodePipeline does offer compatibility with other third-party vendors if required, like Jenkins and TeamCity.
- AWS CodePipeline allows you to easily track the progress and history of your deployment pipelines.
Pricing
For AWS CodePipeline, you pay for only what you use. There are no upfront fees or commitments.
As part of the AWS Free Tier, you can get one free active pipeline each month. Otherwise, you will be charged $1 per active pipeline per month. An active pipeline is a pipeline that has existed for more than 30 days and also where one code change has been made during that month. Pipelines are free for the first 30 days after creation.
You can still incur additional charges for storing and accessing artifacts in S3 and utilizing services from AWS and third-party vendors that are connected to your pipeline.
Conclusion
- AWS CodePipeline is an automated continuous integration/continuous delivery (CICD) service.
- AWS CodePipeline pipelines are defined using stages and actions. Actions provide the logic for building, testing, and deploying your application.
- Artifacts are the files that consist of source code and other dependencies that your application requires.
- AWS CodePipeline's main feature is the ability to create an end-to-end software release workflow, track pipeline execution progress, and view execution history.
- AWS CodePipeline can be easily integrated with other AWS services and even third-party vendors (like Jenkins or TeamCity).
- Many companies use AWS CodePipeline in their CICD workflows - like Lululemon Athletica, 3M Health Information Systems, and sRide.
- AWS CodePipeline charges you only for pipelines that are greater than 30 days old and have had at least one execution on them. There is no upfront cost.