I'd Rather Have a Repeatable Deployment Pipeline Than a Perfect Engineer | PulseSoft
Skip to content

I'd Rather Have a Repeatable Deployment Pipeline Than a Perfect Engineer

PulseSoft Team · · 12 min read

Introduction

The best infrastructure engineer I've ever worked with made a critical mistake on a production deployment. Not because they were careless, because it was 11pm, they'd been troubleshooting a separate incident for four hours, there was pressure to get a fix out, and they skipped step seven of the fourteen-step runbook because they were sure they'd already done it in a previous run. They hadn't. Production went down for forty minutes.

Automated deployments aren't about replacing good engineers. They're about removing the conditions under which good engineers make bad decisions. The 11pm deployment. The deployment that follows an exhausting incident. The deployment that should be routine but involves a sequence of steps that needs to be executed in exactly the right order. Human consistency degrades under fatigue, under pressure, and under complexity. Automated deployments don't degrade. They execute the same sequence in the same order, with the same validation, every time.

This post makes the case for repeatability as the core value of deployment automation: not speed, not tooling sophistication, but the simple guarantee that the tenth deployment works the same way as the first.


The Consistency Gap That Manual Deployments Can't Close

Every manual deployment process has what I call a consistency gap: the delta between how the deployment is supposed to go and how it actually goes. The gap is zero the first time: the engineer who wrote the runbook follows it perfectly. It widens over time as the engineer develops shortcuts, as the runbook drifts from the actual deployment steps, as new engineers interpret steps differently, and as pressure compresses the careful attention that makes the runbook work.

The consistency gap is not a function of engineer quality. It's a function of human cognitive load under variable conditions. A ten-step deployment runbook executed by a senior engineer in the morning, with fresh context, with no concurrent incidents, has a different error rate than the same runbook executed by the same engineer at midnight after a six-hour debugging session. This isn't a failure of the engineer. It's a property of human performance under pressure.

The specific pattern I see most consistently: teams that have a deployment process that works reliably under normal conditions and catastrophically under abnormal ones. Normal conditions: business hours, planned deployment window, everyone available, no concurrent incidents. The runbook works. Abnormal conditions: emergency hotfix needed at 2am, the engineer who knows the system best is unavailable, the deployment needs to happen before a meeting in thirty minutes. The runbook fails: not completely, but enough to cause a partial failure that takes longer to diagnose than if the deployment hadn't happened at all.

The concrete failure mode: a logistics company I worked with had a five-service deployment process that required updating environment variables in three different places, ECS task definitions, Secrets Manager, and an application config file in S3. The order mattered: Secrets Manager first, then the config file, then the task definition update that triggered the rolling restart. Every deployment done by the engineer who designed the process went flawlessly. Every deployment done by someone else had an error rate above 30%, usually the S3 config update happening after the task definition restart, causing running tasks to start before the new configuration was available.

The fix wasn't better training. It wasn't a better runbook. It was a deployment pipeline that encoded the correct sequence once, in code, and executed it the same way every time regardless of who initiated it or when.


AWS Deep Dive: Building Repeatable Deployment Pipelines

ECS Deployments: Where Manual Process Introduces the Most Risk

ECS is the compute layer where deployment sequencing mistakes are most immediately painful. A rolling deployment that starts before a health check passes, a task definition update that doesn't include the updated environment variable, a deployment that reverts to an old task definition revision because the CI job cached the wrong artifact: each of these is a class of error that manual deployments produce and automated pipelines prevent.

The ECS deployment circuit breaker is the most underused feature in ECS that eliminates one entire category of deployment mistake. Without it, a bad deployment (a container that fails to start, a health check that never passes), will keep trying to deploy indefinitely, draining capacity from the healthy running tasks while the new tasks fail, until an engineer notices and manually stops the deployment. With circuit breaker enabled, ECS automatically rolls back to the previous task definition if the deployment fails:

resource "aws_ecs_service" "api" {
  name            = "${var.service_name}-${var.environment}"
  cluster         = var.cluster_arn
  task_definition = aws_ecs_task_definition.api.arn
  desired_count   = var.desired_count

  deployment_circuit_breaker {
    enable   = true
    rollback = true  # Automatically roll back to previous task definition on failure
  }

  deployment_controller {
    type = "ECS"
  }

  # Minimum 50% healthy tasks during deployment ensures capacity is maintained
  deployment_minimum_healthy_percent = 50
  deployment_maximum_percent         = 200
}

The non-obvious behavior of rollback = true: it rolls back to the last successful task definition, not to the previously deployed one. If a service has had three consecutive failed deployments, ECS's circuit breaker will roll back to the last task definition that successfully completed a deployment, which may be several versions behind the current one. In a manual process, an engineer would typically know which version is stable. An automated pipeline with circuit breaker enabled knows this automatically from deployment history.

The deployment flow for a repeatable ECS pipeline using GitHub Actions and OIDC authentication:

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production # Requires approval in GitHub Environments settings
    permissions:
      id-token: write
      contents: read
    steps:
      - uses: actions/checkout@v4

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::${{ vars.PROD_ACCOUNT_ID }}:role/GitHubActionsDeployRole
          aws-region: us-east-1

      - name: Build and Push Container Image
        id: build
        run: |
          IMAGE_TAG="${{ github.sha }}"
          ECR_REPO="${{ vars.ECR_REPO_URI }}"

          aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_REPO
          docker build -t $ECR_REPO:$IMAGE_TAG .
          docker push $ECR_REPO:$IMAGE_TAG
          echo "image=$ECR_REPO:$IMAGE_TAG" >> $GITHUB_OUTPUT

      - name: Render Task Definition
        id: task-def
        uses: aws-actions/amazon-ecs-render-task-definition@v1
        with:
          task-definition: task-definition.json
          container-name: api
          image: ${{ steps.build.outputs.image }}

      - name: Deploy to ECS
        uses: aws-actions/amazon-ecs-deploy-task-definition@v1
        with:
          task-definition: ${{ steps.task-def.outputs.task-definition }}
          service: ${{ vars.ECS_SERVICE_NAME }}
          cluster: ${{ vars.ECS_CLUSTER_NAME }}
          wait-for-service-stability: true # Block until deployment completes or fails

The wait-for-service-stability: true parameter is what makes this pipeline blocking rather than fire-and-forget. Without it, the GitHub Actions job completes as soon as ECS accepts the deployment request, before the new tasks are running and healthy. The deployment could be failing in ECS while the pipeline reports success. With it, the pipeline blocks until ECS confirms the deployment is stable, and fails the pipeline job if the circuit breaker triggers a rollback.

Rendering diagram…

Secrets and Configuration: The Pre-Flight That Manual Deployments Skip

The most common source of deployment failures I've seen is configuration that doesn't match what the code expects. An environment variable that's defined in the task definition but missing from Secrets Manager. A config value updated in one environment but not propagated to another. A feature flag that was enabled in staging but is still disabled in production.

Manual deployments rely on engineers to verify configuration before deploying. Automated pipelines can run this verification as a pre-flight check that blocks deployment if configuration is incomplete:

#!/bin/bash
# pre-deploy-config-check.sh

set -e

REQUIRED_SECRETS=(
  "/payments-api/prod/stripe-key"
  "/payments-api/prod/db-password"
  "/payments-api/prod/jwt-secret"
)

echo "Verifying required secrets exist in Secrets Manager..."

for secret in "${REQUIRED_SECRETS[@]}"; do
  aws secretsmanager describe-secret \
    --secret-id "$secret" \
    --query 'Name' \
    --output text > /dev/null 2>&1

  if [ $? -ne 0 ]; then
    echo "ERROR: Required secret not found: $secret"
    echo "Deployment blocked, resolve missing configuration before retrying"
    exit 1
  fi

  echo "✓ Found: $secret"
done

echo "All required secrets verified. Proceeding with deployment."

This pre-flight runs before the container build, before the task definition update, before anything that would consume time or compute. If a required secret is missing, the deployment fails immediately with a clear error message: not forty-five minutes later when the new tasks start and can't read the configuration they need.

The non-obvious AWS behavior that makes pre-flight checks particularly valuable: ECS task failures due to missing Secrets Manager values don't always produce clear error messages in the CloudWatch logs. If the IAM role attached to the ECS task doesn't have permission to read a specific secret, the task fails during startup with a CannotPullContainerError or a generic secrets resolution failure: not a message that says "secret X doesn't exist" or "permission denied for secret Y." Catching the missing secret before deployment starts produces a cleaner error message than letting ECS produce a cryptic startup failure.

AWS CodePipeline vs. GitHub Actions: Choosing the Right Automation Layer

The two primary automated deployment pipeline patterns for AWS workloads are native AWS (CodePipeline + CodeBuild + CodeDeploy) and external CI/CD with OIDC authentication (GitHub Actions, GitLab CI, CircleCI). Each has specific tradeoffs that matter for repeatability.

AWS CodePipeline strengths:

  • Native integration with ECR, ECS, S3, Lambda: no cross-account permission complexity for single-account deployments
  • Event-driven triggers from CodeCommit, ECR image pushes, and S3 object changes
  • IAM-native access model without OIDC federation setup
  • CloudTrail integration for full audit trail of pipeline executions

AWS CodePipeline weaknesses:

  • Pipeline definition lives in AWS, not in the repository: the deployment process is not version-controlled alongside the code unless you manage the pipeline itself with CloudFormation or Terraform
  • Approval gates are manual clicks in the console: no comment-based approval workflows, no integration with PR review history
  • Debugging failed stages requires navigating the CodePipeline console; log access in CodeBuild is less ergonomic than GitHub Actions step logs

GitHub Actions strengths:

  • Pipeline definition lives in the repository: every deployment process change is a pull request that can be reviewed
  • OIDC authentication eliminates stored credentials entirely
  • Strong ecosystem of community actions for AWS deployment tasks
  • Approval gates via GitHub Environments integrate with existing PR and review workflows

GitHub Actions weaknesses:

  • OIDC configuration adds initial setup complexity (OIDC provider in IAM, trust policy on each role)
  • External network dependency, GitHub Actions runners require outbound internet access from the runner to GitHub's infrastructure, which may conflict with strict egress policies in regulated environments
  • Execution logs and artifacts live in GitHub, not in AWS, audit trail requires correlating GitHub Actions logs with CloudTrail events

For most teams, GitHub Actions wins on developer experience and pipeline-as-code maintainability. For teams in regulated environments with strict egress controls or with a heavy investment in CodeCommit and native AWS tooling, CodePipeline keeps the entire pipeline within the AWS trust boundary.


Enjoying this so far?

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.

Tradeoffs & Decision Framework

Automated deployments are not universally superior to manual deployments on every dimension. The tradeoffs are real, and the right answer depends on deployment frequency and team maturity.

When manual deployments are still acceptable:

  • One or two deployments per month on a single service with a small, experienced team: the overhead of building and maintaining an automated pipeline exceeds the error rate reduction
  • Highly complex deployments with significant judgment calls that a pipeline can't make, database schema migrations that require human verification of the migration plan before applying, for example
  • Greenfield projects where the deployment process is still being figured out, automating an unstable process locks in the instability

When automated deployments are non-negotiable:

  • More than one deployment per week on any service: the compounding error rate of manual deployments at that frequency is significant
  • Teams where multiple engineers are making deployments, manual processes are most consistent when one engineer does all deployments; the more engineers involved, the wider the consistency gap
  • Production environments with uptime SLAs: a deployment that requires a senior engineer to be present is a deployment that can't happen when the senior engineer is unavailable
  • Any deployment process with more than five steps, step count correlates directly with error rate in manual processes

The maturity curve: The investment in automated deployments pays back differently at different stages. At two engineers and one service, a manual runbook is often sufficient. At ten engineers and eight services, manual deployment processes have usually accumulated enough inconsistency to justify the automation investment. At fifty engineers and thirty services, manual deployment processes are operationally impossible to maintain at the quality level production requires.

The signal that it's time to automate: when the deployment process requires the person who built it to be present, or when deployment frequency is limited by the availability of engineers who understand the process rather than by technical constraints.


Lessons From the Field

1. The moment a deployment requires a specific engineer to be present, it's a single point of failure. At a B2B SaaS company, the lead backend engineer was the only person who knew how to deploy the payments service. The process involved four manual steps in a specific order, and only they had memorized the correct sequence and the error conditions to watch for. When they went on vacation, the team couldn't ship payment-related features for two weeks. Automating the deployment pipeline was scheduled for the sprint after they returned. The automation took three days to build. The two-week deployment freeze cost more in delayed revenue than three months of engineering time.

2. Automated pipelines surface configuration drift between environments that manual deployments hide. Built an automated ECS deployment pipeline for a logistics client that deployed the same artifact through dev → staging → production. Within a week of enabling it, the pipeline surfaced a Secrets Manager secret that existed in dev and staging but had never been created in production. Manual deployments had worked in production because the previous version of the application didn't need that secret. The new version did. The pipeline's pre-flight check caught it before deployment. A manual deployment would have caught it as a production incident.

3. The pipeline's deployment history is your audit trail, use it. At a fintech client, a security auditor asked for a log of every production deployment in the past twelve months: who initiated it, when it ran, what artifact was deployed, and whether it succeeded or failed. Teams with manual deployment processes answered this request with a combination of Slack messages, email threads, and incomplete runbook logs that took a week to compile. Teams with automated pipelines answered it in twenty minutes, GitHub Actions deployment logs, correlated with CloudTrail events and ECR image tag history, produced a complete deployment audit trail automatically.

4. A pipeline that requires a human to approve every step is not automated, it's a manual process with extra steps. Reviewed a CodePipeline setup at a media company that had seven stages, five of which required manual approval via the console. Engineers were clicking through five approval gates per deployment. The pipeline added thirty minutes of coordination overhead to every deployment without reducing the error rate, because the error-prone manual steps were the five approval gates, not the automated steps between them. Approval gates are appropriate at environment promotion boundaries (dev → staging, staging → production). They are not appropriate at every step of the deployment.

5. Test the pipeline failure path as carefully as the success path. Built a deployment pipeline for a healthtech client and spent two days testing successful deployments. On the first production deployment with a real bug, the ECS circuit breaker triggered and the pipeline reported failure, but the Slack notification said "Deployment succeeded" because the notification step ran before the stability check completed. The pipeline had a race condition in the notification logic. Broke production deployments on purpose in staging to validate that failure notifications were correct, that the circuit breaker rollback worked as expected, and that the Slack message accurately reflected the deployment outcome. Ship the failure path as a first-class feature of the pipeline, not an afterthought.


Final Thoughts

The argument for automated deployments is sometimes framed as "reducing reliance on heroes": the senior engineers who know the deployment process and can be counted on to execute it correctly. That framing is right but incomplete. The goal isn't to reduce reliance on good engineers. It's to make good engineers more effective by removing the class of work where human consistency degrades: the repetitive, sequential, error-sensitive execution of deployment steps under time pressure.

A senior engineer who isn't executing a fourteen-step deployment runbook at midnight is a senior engineer who's doing the work that actually requires senior judgment: designing the architecture, reviewing the changes, making the call on whether to deploy or hold. Automation handles the execution. Humans handle the decisions.

The teams that make this shift most successfully are the ones that treat the deployment pipeline itself as a software product, with tests, with versioning, with failure paths as first-class concerns. A pipeline that's tested, documented, and maintained with the same rigor as the application it deploys is a pipeline that can be trusted at 2am.


Key Takeaways

  • Human deployment consistency degrades under fatigue, pressure, and complexity. Automated deployments don't. The argument for automation isn't that engineers are unreliable, it's that humans are consistently inconsistent under the conditions where deployments most often go wrong.
  • ECS deployment circuit breaker with rollback = true eliminates one entire class of manual intervention. When enabled, a failed deployment automatically reverts to the last successful task definition without requiring an engineer to detect the failure and manually roll back. Configure it on every ECS service.
  • wait-for-service-stability: true in the ECS deploy action blocks the pipeline until deployment succeeds or rolls back. Without it, the pipeline reports success as soon as ECS accepts the deployment request, before tasks are running and healthy. The pipeline would mark a failed deployment as successful.
  • Pre-flight configuration checks catch missing secrets before ECS produces cryptic startup failures. A Secrets Manager secret that doesn't exist causes a generic CannotPullContainerError in ECS. A pre-flight check that verifies required secrets before deployment starts produces a specific, actionable error message.
  • Approval gates belong at environment promotion boundaries, not at every pipeline stage. A pipeline with five manual approval steps is a manual process with extra coordination overhead. Automate within environments; require approval only when promoting between environments.
  • The deployment pipeline's execution history is your audit trail. A year of automated deployment logs (who initiated, what artifact, when, success or failure), satisfies security and compliance audit requests in minutes. Reconstructing the same history from manual processes takes days.
  • Test the pipeline's failure path as a first-class deliverable. Race conditions in failure notification, circuit breaker behavior, rollback sequencing: these only surface when a real deployment fails. Break deployments deliberately in staging to validate failure handling before production needs it.

Get insights like this in your inbox

Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.

No spam. Unsubscribe anytime.