Lesson 14 — Modern Practices

DevOps and CI/CD in the Cloud

DevOps combines development and operations practices to deliver software faster and more reliably, with CI/CD pipelines automating the build, test, and deployment process in cloud environments.

Continuous Integration and Continuous Deployment

Continuous Integration (CI) automatically builds and tests code every time a developer pushes a change, catching integration problems early. Continuous Deployment (CD) extends this by automatically deploying code that passes all checks straight to production (or a staging environment), dramatically reducing the manual effort and delay involved in releasing software.

Infrastructure as Code

Infrastructure as Code (IaC) tools (like Terraform or AWS CloudFormation) let you define cloud infrastructure — servers, networks, databases — in version-controlled configuration files rather than manually clicking through a provider's console, making infrastructure changes repeatable, reviewable, and consistent across environments.

Terraform — A simple infrastructure definition (illustrative)
resource "aws_instance" "web_server" {
  ami           = "ami-0abcdef1234567890"
  instance_type = "t2.micro"

  tags = {
    Name = "WebServer"
  }
}

Common Mistakes

  • Manually configuring cloud infrastructure through a console instead of using Infrastructure as Code, making environments inconsistent and hard to reproduce.
  • Deploying straight to production without an automated test suite running first in the CI pipeline, defeating much of CI/CD's safety benefit.
  • Treating CI/CD pipeline configuration as an afterthought rather than something that's version-controlled and reviewed like application code itself.
  • Not having a rollback strategy in place for when an automated deployment introduces a problem in production.

Professional Tip

Store your Infrastructure as Code alongside your application code in the same version control system. This lets infrastructure changes go through the same review, history tracking, and rollback process as any other code change.

Your Turn

Sketch out (in plain steps) what a simple CI/CD pipeline would look like for a small web application: what happens automatically each time a developer pushes new code?

Mini Quiz

What does Infrastructure as Code (IaC) allow you to do?