← ResourcesDEVOPS Β· CI/CD

Continuous Integration and Continuous Delivery (CI/CD)

The three layers of a working pipeline on AWS, from commit to production.

STRALYA12 min readJuly 2026

What is a CI/CD pipeline and why it matters for scale-ups A CI/CD pipeline is the complete automation of the code lifecycle, from the detection of a change through to its release to production. CI stands for continuous integration: every commit automatically triggers tests and validations to catch problems as early as possible. CD stands for continuous delivery or continuous deployment: once validated, the code can be delivered to staging or directly to production with no manual handling. For the scale-ups and mid-market companies that double their AWS infrastructure every six months, a well-structured CI/CD pipeline has become indispensable. Without one, every deployment becomes a day-long project requiring three or four manual reviews, emergency rollbacks at 3 a.m., and an accumulation of technical debt that paralyzes velocity. With a pipeline, you go from one deployment a week to several a day, without increasing the risk. Teams that maintain mature pipelines reduce the time between a commit and a production release by 70%, and manual-deployment incidents by 90%. It is the difference between a team that builds features and a team that spends its time stabilizing the infrastructure. ## The three layers of a working CI/CD pipeline on AWS A high-performing CI/CD pipeline rests on three distinct layers that must be built coherently. The first is the detection and integration layer: it watches your Git repositories (GitHub, GitLab, CodeCommit) and triggers the pipeline on every push or pull request. The second is the validation layer, made up of automated tests (unit, integration, performance) and security scans. The third is the deployment layer, which orchestrates the creation of artifacts (Docker images, binary packages), their placement in registries (ECR on AWS), and their deployment to your target environments (EC2, ECS, EKS, Lambda depending on your architecture). Each layer must be independent and reproducible. If a test fails at layer two, the deployment cannot move forward: that is exactly the point. On AWS, you can use AWS CodePipeline to orchestrate all of this, AWS CodeBuild for tests and builds, and AWS CodeDeploy for deployment automation. But some teams prefer GitLab CI or Jenkins because they want full control of their orchestration or because they already have existing expertise. The choice depends less on the tool than on your ability to keep each layer coherent: if your tests do not reflect what happens in production, or if your deployment can bypass the tests under pressure, your pipeline collapses. That is why Stralya always insists on documentation and governance: a fast pipeline that no one understands becomes a black box that people are afraid to touch. ## Automating tests continuously to prevent regressions Continuous automated tests are the beating heart of an effective CI/CD pipeline. They are deployed across several nested stages, each validating a different aspect of the code. Unit tests run in CodeBuild or in your CI runner must complete in a few seconds and cover at least 70% of the application code: they test each function in isolation without depending on a database or an external service. Integration tests, slower but more realistic, verify that several components interact correctly, often with a temporary database (PostgreSQL in Docker, DynamoDB local for AWS). Performance and load tests exercise the code under pressure to determine its breaking point before a real user reaches it. Finally, static security scans (SAST) like SonarQube or Checkmarx analyze the code without executing it to detect common vulnerabilities (SQL injections, hardcoded secrets, obsolete dependencies). A mature team configures these four levels in parallel rather than in series: while your unit tests run, the security scans and integration tests launch at the same time. This reduces the feedback loop from 15 minutes to 3 minutes, which completely changes the developer's psychology: they get a fast verdict and can fix issues immediately. For scale-ups that deploy several times a day, investing in this parallelization pays off enormously. A pipeline that takes 45 minutes to validate each commit becomes a bottleneck that slows down the entire team. ## Orchestrating automatic deployment to production Once all the tests pass, the code must be deployed automatically or semi-automatically to production. This is where many pipelines fail: they test correctly but fail to orchestrate the deployment reliably. On AWS, you have several paths. AWS CodeDeploy lets you coordinate deployments across fleets of EC2 instances: it handles rolling deployments (progressively replacing instances), blue-green deployments (switching from one set of instances to another), and automatic rollbacks if health checks detect problems. If you chose ECS or Fargate for your containers, the pipeline updates the task definition and lets ECS orchestrate the container replacement. If you use Kubernetes (EKS), you generally deploy a new version of your Helm chart or directly modify your YAML manifests, and the Kubernetes controller reconciles the desired state. The choice of deployment pattern is critical. Blue-green deployments allow an instant switch and an equally instant rollback if something breaks, but they require twice the resources. Rolling deployments consume fewer resources but briefly expose your infrastructure to a transient state. Canary deployments send the new code to 5% of traffic first, check the metrics, then progressively extend it: this is safer but more complex to orchestrate. For scale-ups just starting out, a blue-green deployment with a fast switch (a few seconds) and a semi-automatic rollback (one click to revert) creates a balance between safety and simplicity. Whatever your strategy, it must be written into your CI/CD pipeline, tested regularly, and documented so the team understands it when an emergency strikes. ## Infrastructure-as-code and reproducible environments for the pipeline An automated CI/CD pipeline only makes sense if the environments it deploys to are reproducible and versioned. That is the role of infrastructure-as-code (IaC). With Terraform, CloudFormation, or AWS CDK, you describe your test, staging, and production environments as code committed to Git. Each time your pipeline needs a temporary environment to run integration tests, it can use Terraform to create a complete stack (VPC, RDS, Lambda) in a few minutes, then tear it down once the tests are finished. This is both economical (you only pay while the tests run) and reliable (the test environment is bit-for-bit identical to production, since both are generated from the same definition). The pipeline itself runs in Docker containers (images built in CodeBuild or via your CI runner), which are also versioned: your Docker build never changes between two runs of the pipeline for the same commit. This means that if a test passes today, it will pass again in six months on the same commit, with no surprises. For scale-ups growing fast, this reproducibility is an enormous saving in debugging effort. Many teams discover too late that their pipeline tests on an outdated version of Node.js or PostgreSQL, different from production. This creates insidious bugs that only surface once in production. By codifying the infrastructure in the same repository as the application code, you force the team to think of these two elements together, and your pipeline becomes a single source of truth. ## Monitoring and alerting on the pipeline to maintain trust A CI/CD pipeline that fails silently is worse than a nonexistent pipeline. You must therefore instrument the pipeline itself to see in real time what its state is, when it fails, and why. This starts with dashboards visible to the whole team: every commit in Git is assigned a status (in progress, succeeded, failed) and the full logs must be accessible in one click. AWS CodePipeline offers native dashboards, but you can also send the statuses to Slack or PagerDuty so the team is alerted immediately if a pipeline fails on a critical branch. Next, you must log and explore the pipeline's hot spots. If 40% of runs fail on the integration test, it is a signal that the test is unstable (perhaps it uses a database that is not cleaned between runs) or that the code is genuinely changing a lot. If the pipeline latency has degraded from 10 to 30 minutes in a month, it is probably that the integration tests have grown heavier or that your Docker images have grown. These metrics must be visible: average pipeline duration, failure rate per stage, median time for a commit to reach production. Finally, you must have escalation procedures: if the pipeline fails on main or on a protected branch, who receives the alert, and how quickly? For scale-ups, a reasonable SLA is that a failing pipeline is diagnosed and fixed in under an hour, either manually or through an automatic rollback of the offending commit. That is just enough urgency for it not to be ignored, but enough time not to panic.

AWS TEARDOWN Β· FREE

Get the AWS Teardown: where your bill really goes.

The guide listing the 12 cost areas that leak the most at scale-ups, and how to plug them. Free, by email, no strings attached.