Why a self-mutating CDK pipeline

Why a self-mutating CDK pipeline

Traditional CI/CD pipelines live outside the code they deploy. You change the pipeline in a console, someone forgets, someone else makes a conflicting change. Drift happens.

A CDK pipeline is just more CDK code. It deploys itself.

The flow

  1. You run cdk deploy DigitalCloudBlissPipeline once, by hand.
  2. From then on, pushing to main:
    • triggers the pipeline via a CodeStar Connection,
    • runs the synth step (install, build Angular, cdk synth),
    • runs a SelfMutate step that applies any changes to the pipeline definition itself,
    • deploys the BlogStage (S3 + CloudFront) with the new build.

Change the pipeline (add a stage, a test, a new region) by editing infra/lib/pipeline-stack.ts and pushing. The next run picks up the change.

What you don't get

No secrets sprinkled across pipeline UIs. No "works on my machine" infra. No forgotten manual steps. Just code, in one place.

← Back to posts