Skip to content
guidePhase: ReleasePlatformGuide 8 of 16

Roles: devops sre · developer

Guide: CI/CD & Release ​

Decision: How changes flow from merge to AWS production safely.

Related: cicd-observability.md · static-analysis-linting.md · identity-access-secrets.md · SOP-006


Static analysis in the pipeline ​

Linters, SAST, SCA, and secret scans should run in CI before deploy stages. Tool choices and gate thresholds: Linters & static analysis.


CI orchestrator ​

OptionProsCons
AWS CodePipeline + CodeBuildNative IAM; unified with AWS deployYAML UX; cross-repo patterns harder
GitHub ActionsExcellent PR UX; huge action ecosystemHybrid IAM to AWS needs OIDC setup
GitLab CISingle platform if already on GitLabLess common in AWS-only shops
JenkinsFlexibleOperate Jenkins; drift

Recommended for AWS-primary: CodePipeline or Actions + OIDC — pick one org standard. IAM and deploy-role design: Identity, access & secrets.


Deploy strategies ​

StrategyProsCons
RollingSimpleSlow rollback; blast radius
Blue/greenFast rollbackDouble capacity cost during switch
Canary (% traffic)Early signalRequires metric gates + automation
Feature flags (AppConfig/LaunchDarkly)Decouple deploy from releaseFlag debt if not cleaned

Recommended: Canary + feature flags for T1; blue/green acceptable; avoid naked rolling for T1.


Ephemeral PR environments ​

OptionProsCons
Full stack per PR (CDK)Realistic E2ECost; slow provisioning
Shared staging + branch namespaceCheaperCross-PR interference
LocalStack / mocks onlyFastMisses integration gaps

Pitfall: Ephemeral envs with prod-like data → compliance violation. Use synthetic fixtures only.


Pitfalls ​

PitfallWhy it hurtsMitigation
Deploy without metric gateBad release reaches 100% trafficAuto-rollback on error/latency
Staging ≠ prod parity"Worked in staging" incidentsSame container, scaled-down infra
Manual prod deploy onlyHuman error; slow recoveryAutomate with approval gate for T1
Skipping container scanCVEs in prodECR/Trivy block Critical
Long-running PR envsAWS bill shockAuto-destroy on PR close / TTL
CI and CD in one jobCan't retry deploy without retestSeparate stages with artifacts
No deploy correlation in metricsCan't blame releaseTag metrics/traces with version
Feature flag as permanent ifUnreachable code pathsFlag cleanup in Definition of Done

Actions or CodePipeline → build + test stages → deploy staging → synthetics → canary prod with metric rollback → AppConfig for release toggles.


Reference template only — no production code. Adapt in your own project.