Looking at code
computer code illustration

Supercharge your dev environment with CI/CD

Recently, we explored the topic of Infrastructure as Code (IAC) as a transformative approach to managing your ever-expanding IT infrastructure. Check out the blog here.

Once IAC is up and running within your organization, a natural next step is to establish continuous integration and continuous delivery (CI/CD) pipelines.

Quick definition

At its core, continuous integration (CI) is a coding philosophy and set of practices that empower development teams to rapidly integrate small code changes into a version-controlled code repository such as GitHub or AWS CodeCommit.  CI also is intended to run in tandem with automated unit tests to find errors early in the coding process, before they become more difficult to debug.

Continuous delivery (CD) or continuous deployment picks up where continuous integration ends, automating the delivery of applications to select locations within your IT infrastructure, including development, testing and production environments.  Continuous delivery typically requires human interaction (think manual approval button) to deploy a change to production, while continuous deployment changes are automatically deployed without human intervention.  Both have their use cases.  With either option, the deployment can be executed with whatever deployment method is deemed best given the context, including methodologies like blue-green deployment, rolling updates, or all-at-once.

Benefits of CI/CD

By combining modern development philosophies and automation, CI/CD has the power to supercharge your dev environment, with a variety of key benefits:

  • Improved collaboration. Because most modern applications require code development across different platforms and tools, dev teams need a mechanism to integrate and validate changes. With continuous integration, dev teams commit code with consistent frequency, often daily. This makes handoff among developers easier, more predictable and more collaborative overall. In addition, shorter commit cycles reduce the likelihood of developers simultaneously editing code, eliminating the need to merge different versions when committing.
  • Higher quality. The technical goal of CI is to establish a consistent and automated way to build, package and test applications. Just as the name implies, continuous integration calls for frequent, smaller iterations and versioning, making it easier to identify errors or quality issues. Mandatory testing and quality control further ensure successful outcomes. CI/CD pipelines also provide a singular place for engineers to apply changes, which massively increases visibility and accountability across your dev team.
  • Improved productivity. Once testing is complete, continuous deployment jumps in to automatically deploy the configuration change and relevant infrastructure, all triggered without human intervention. As you can imagine, this saves a substantial amount of time compared to a manual approach.  For example, with services like AWS CodePipeline (a managed service for CI/CD), an engineer can make several modifications to a Terraform template and push it up to the repository at the source stage of the pipeline. This initiates CI testing, approval and application deployment all from a single command. If delivery is the chosen method, the code change hits the human approval stage and is deployed to production if approved.

Additional automation tools

Beyond CI/CD, Amazon Web Services (AWS) develops and maintains software development kits (SDK) for many popular programming languages. Specifically, boto3, the AWS SDK for Python, offers huge benefits for automation. Python can be used in conjunction with AWS’s function-as-a-service product, Lambda, to automate alerts and remediation for infrastructure issues. For example, Lambda can prevent the creation of non-tagged EC2 instances to enforce documentation of infrastructure and traceability. This can be triggered by a CloudWatch event. If tagging is not present, the instance is terminated before it finishes booting up.

Another powerful Lambda guardrail is the ability to automatically terminate EC2 resources provisioned during off hours. Using CloudWatch Events as a trigger for both the Lambda function and administrator notification via SNS, Lambda can prevent abuse of your EC2 resources if a security breach occurs.

The next evolution

As you can see, the benefits of CI/CD are quite substantial.  They represent the next evolution in IT methodology, helping build the agile, competitive advantage that you’ve promised to deliver.  If your organization is ready to enhance your cloud, Infrastructure as Code or CI/CD investments, ANM’s expert engineers would be happy to assist in any way we can. Please reach out to info@anm.com to schedule a demo.

Paul Dackiewicz
Dylan Begley, Consulting Engineer

Dylan provides design and implementation services for ANM’s datacenter customers, with a focus in Hybrid Cloud, DevOps, and Infrastructure as Code/Automation. He was formerly a datacenter engineer on ANM’s Managed Services team, assisting customers with a wide variety of IT challenges. In his spare time, he enjoys snowboarding and video games.