Modern software companies use DevOps practices to build their applications. With the rise of DevOps has come the new methods of Continuous Integration, Continuous Delivery, (CI/CD). Continuous Integration (CI) is a fundamental process for the development of modern applications. With a continuous integration pipeline in place, it is possible for developers to always have the latest version of a system, with the guarantee that this version has been tested and is working as expected. On the other hand, Continuous Delivery (CD) makes it easier and faster to deliver releases to users and test environments. In many cases, Continuous Delivery allows companies to shift from a scenario of “One release every 3 months” to a “5 releases a day” scenario.
With Cloud becoming extremely popular and being adopted by many companies, it’s more important than ever to understand how can development teams maintain or more likely even improve their CI/CD Pipeline and DevOps Practices in general while operating in the cloud. Today I’m going to talk about how developing and a basic CI/CD Pipeline looks like in AWS and what are the main AWS Services that can help developers to be as efficient as possible.
AWS DevOps Tools
AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It makes it easy for teams to collaborate on code in a secure and highly scalable ecosystem. CodeCommit eliminates the need to operate your source control system or worry about scaling its infrastructure. If you noticed any similarities with GitHub you’re not wrong, CodeCommit is a direct competitor to GitHub with the advantage of being completely integrated with AWS Ecosystem, which naturally makes the integration with other AWS Services more fluid and simple.
AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, there’s no need to provision, manage, and scale build servers. CodeBuild scales continuously and processes multiple builds concurrently, so builds are never left waiting in a queue.
AWS CodeDeploy is a fully managed deployment service that automates software deployments to a variety of computing services such as Amazon EC2, AWS Fargate, AWS Lambda, and on-premises servers. AWS CodeDeploy makes it easier to rapidly release new features, helps avoid downtime during application deployment, and handles the complexity of updating applications.
AWS CodePipeline is a fully managed continuous delivery service that automates release pipelines for fast and reliable application and infrastructure updates. CodePipeline automates the build, test, and deploy phases of the release process every time there is a code change, based on whatever release model is defined. It’s also possible to integrate CodePipeline with 3rd Party Products such as GitHub. Ultimately, CodePipeline is the orchestrator of our CI/CD Pipeline in AWS.
Software Development Life Cycle
The diagram below illustrates how the AWS services mentioned above would be used together to build a basic CI/CD Pipeline.
The Development Life Cycle of a new feature is typically the below:
- Developer builds and troubleshoots a new feature locally while committing to a separate Git branch so the Master branch is not compromised. In this scenario, CodeCommit is our Source Control Service.
- When the feature is complete, the Developer submits a Pull Request, usually to the Team Lead or Senior Dev, to merge the new code with the code already in the Master branch.
- If the PR is approved, the Master branch is then updated which will trigger the next CI/CD steps.
- CodeCommit submits a new “Push” or “Merge” alert to CodePipeline.
- CodePipeline triggers a new build in CodeBuild.
- CodeBuild pulls the newest code version from the Source Code Repository and runs the necessary tests.
- If the build is successful, the artifact generated by CodeBuild is sent to CodeDeploy for deployment to designated environments. In the example above, Beta and Production.
Other Useful Tools
- AWS CloudWatch
Amazon CloudWatch allows developers, system architects, and administrators to monitor their AWS applications in the cloud, in near-real-time. CloudWatch is automatically configured to provide metrics on request counts, latency, and CPU usage. Users can also send their logs and custom metrics to CloudWatch for monitoring which is the most appealing feature as it can provide useful insights on how or CI/CD Pipelines.
- AWS Systems Manager Parameter Store
Parameter Store is a service that helps you arrange your data in a systematic hierarchical format for better reference. Data can be of any type like Passwords, Keys, URLs or Strings. SSM Parameter store is especially useful when sensitive values are required during a pipeline and it would be a security flaw to hard code these values. Any of the tools mentioned above can fetch values from the SSM Parameter store and bake them in the pipeline at runtime.
- AWS CodeArtifact
The newest addition to AWS DevOps Services is AWS CodeArtifact which was released in June 2020. CodeArtifact is a fully managed software artifact repository service that makes it easy for organizations of any size to securely store, publish, and share packages used in their software development process. This means that IT leaders can use AWS CodeArtifact to create centralized repositories for sharing software packages approved for use across their development teams.
To take full advantage of operating in the cloud its necessary to do more than just Lift-and-Shift your workloads, it’s necessary to learn how you can leverage the new services and possibilities that the Cloud can offer. As demonstrated AWS has many services that can modernise your application and bring your DevOps practices to a whole new level. Asystec can help you under
Lucas DaSlva | Asystec Systems Engineer