CodeDeploy Deployment Group Auditor
Quick start — 4-line decision tree
Evaluate in order; first match wins.
- No auto-rollback? (
autoRollbackConfiguration.enabled: false OR
DEPLOYMENT_FAILURE missing from triggers) → NO_ROLLBACK
- No alarms? (
alarmConfiguration.enabled: false OR alarms empty)
→ NO_ALARMS
- Risky config? (
AllAtATime, zero minimum-healthy-hosts, blue/green
0-minute termination, WITHOUT_TRAFFIC_CONTROL) → CONFIG_GAP
- All clear? → OK
Mindset
CodeDeploy is the safety gate between a new revision and production
traffic. The verdict reflects the first safety gate that fails,
evaluated in priority order — rollback before alarms before config —
because a deployment without automatic rollback is a manual recovery
exercise regardless of alarm coverage. Rationale: rollback + alarms
partially mitigate a risky config, but nothing mitigates a missing
rollback. The full thresholds, edge cases, and operator-only gotchas
are in the Reference at the end.
Quick reference — verdict thresholds
| Condition |
Verdict |
Step |
autoRollbackConfiguration absent or enabled: false |
NO_ROLLBACK |
Step 1 |
enabled: true but triggers missing DEPLOYMENT_FAILURE |
NO_ROLLBACK |
Step 1 |
alarmConfiguration absent or enabled: false |
NO_ALARMS |
Step 2 |
enabled: true but alarms list empty |
NO_ALARMS |
Step 2 |
deploymentConfigName: CodeDeployDefault.AllAtATime |
CONFIG_GAP |
Step 3 |
Custom config minimumHealthyHosts value 0 (HOST_COUNT) or 0% (FLEX_COUNT) |
CONFIG_GAP |
Step 3 |
CodeDeployDefault.LambdaAllAtOnce |
CONFIG_GAP |
Step 3 |
Blue/green with terminationWaitTimeInMinutes: 0 |
CONFIG_GAP |
Step 4 |
deploymentStyle.deploymentOption: WITHOUT_TRAFFIC_CONTROL (blue/green) |
CONFIG_GAP |
Step 4 |
| All dimensions pass |
OK |
Step 5 |
Evaluation is ordered: the first matching gate produces the verdict.
NO_ROLLBACK is evaluated before NO_ALARMS because a deployment without
rollback is dangerous regardless of alarm coverage.
Pre-flight: deployment group metadata gate
Before classification, verify the deployment group JSON is from the correct
API response shape (get-deployment-group or batch-get-deployment-groups).
Misidentified inputs produce false positives.
| Attribute |
Effect on audit |
computePlatform |
Server (EC2), Lambda, or ECS. Determines valid deployment configs. Lambda uses LambdaCanary* / LambdaLinear*; Server uses OneAtATime / HalfAtATime / AllAtATime; ECS uses blue/green with traffic control. |
deploymentStyle.deploymentType |
IN_PLACE or BLUE_GREEN. Blue/green provisions a replacement fleet — termination config is audited (Step 4). In-place does not. |
deploymentStyle.deploymentOption |
WITH_TRAFFIC_CONTROL or WITHOUT_TRAFFIC_CONTROL. Only meaningful for blue/green. WITHOUT_TRAFFIC_CONTROL bypasses gradual traffic shifting. |
autoRollbackConfiguration |
The authoritative rollback control. Has enabled (boolean) and triggers (list of DEPLOYMENT_FAILURE, DEPLOYMENT_STOP_ON_ALARM, DEPLOYMENT_STOP_ON_REQUEST). |
alarmConfiguration |
Has enabled, ignorePollAlarmFailure, and alarms (list of alarm-name objects). |
targetRevision |
The app revision tracked by the deployment group. If absent, no known-good rollback target is pinned — note as WARNING. |
Live-account pre-flight checks (IAM read/update permissions, service-role trust per compute platform, config snapshot): Diagnostic commands.
If the deployment group JSON is malformed (invalid JSON, missing
deploymentGroupName), output:
DEPLOYMENT_GROUP: <name or "unknown">
VERDICT: ERROR
REASON: Deployment group document is not valid JSON or is missing required fields — cannot classify.
REMEDIATION: Retrieve the canonical config with `aws deploy get-deployment-group --application-name <app> --deployment-group-name <dg> --output json` and re-audit.
Process — Classification logic (apply in order, first match wins)
Step 0: Expert knowledge — operator-only behaviors that change classification
All seven operator-only behaviors (partial triggers, ignorePollAlarmFailure, AllAtATime+rollback, 0-minute termination, single-instance OneAtATime, legacy rollbackEnabled, WITHOUT_TRAFFIC_CONTROL): Advanced patterns.
Step 1: Auto-rollback evaluation (highest priority — first gate)
Check autoRollbackConfiguration:
Absent or enabled: false → NO_ROLLBACK. The deployment has no
automatic recovery path. A failed deployment leaves instances in a broken
state until an operator manually triggers rollback or redeploys.
enabled: true but triggers missing DEPLOYMENT_FAILURE →
NO_ROLLBACK. Without the DEPLOYMENT_FAILURE trigger, rollback only
fires on the specified triggers (alarm breach, manual stop request).
Application-level failures that do not trigger an alarm will not auto-rollback.
enabled: true with DEPLOYMENT_FAILURE in triggers → Pass this gate.
The ideal trigger set includes all three: DEPLOYMENT_FAILURE,
DEPLOYMENT_STOP_ON_ALARM, DEPLOYMENT_STOP_ON_REQUEST. If
DEPLOYMENT_STOP_ON_REQUEST is missing, note as a WARNING finding
(operators cannot trigger automated rollback mid-deployment) but do not
fail the gate — DEPLOYMENT_FAILURE is the minimum.
Step 2: Alarm configuration evaluation (second gate)
Check alarmConfiguration:
Absent or enabled: false → NO_ALARMS. Deployments proceed without
CloudWatch alarm monitoring. Application-level failures (error rate spikes,
latency regressions, custom health-check breaches) are invisible to
CodeDeploy — only instance-level health checks remain.
enabled: true but alarms list is empty → NO_ALARMS. Alarm
monitoring is nominally enabled but no alarms are configured — the safety
net has no threads.
enabled: true with populated alarms → Pass this gate. Also check
ignorePollAlarmFailure: if true, append a WARNING finding (alarm polling
failures are silently ignored — the safety net may disappear during
infrastructure events) but do not change the verdict.
Step 3: Deployment config evaluation (third gate)
Check deploymentConfigName:
CodeDeployDefault.AllAtATime → CONFIG_GAP. Deploys to every
instance simultaneously. Even with rollback, all instances are at risk
during the deployment window. Use OneAtATime or HalfAtATime.
CodeDeployDefault.LambdaAllAtOnce (Lambda compute platform) →
CONFIG_GAP. Shifts 100% of traffic to the new function version
immediately with no canary observation window.
Custom config with minimumHealthyHosts.type: HOST_COUNT and
value: 0 → CONFIG_GAP. Zero healthy hosts required — the deployment
proceeds even if every instance is unhealthy.
Custom config with minimumHealthyHosts.type: FLEX_COUNT and
value: 0 → CONFIG_GAP. Zero percent of hosts must remain healthy —
functionally identical to AllAtATime.
CodeDeployDefault.OneAtATime or CodeDeployDefault.HalfAtATime →
Pass this gate. These configs maintain healthy instances throughout.
Lambda canary/linear configs → Pass, but note configs with very short
bake times (e.g., LambdaCanary10Percent0Minutes) provide no observation
window — flag as WARNING if the time component is 0.
Step 4: Blue/green termination evaluation (fourth gate — BLUE_GREEN only)
If deploymentStyle.deploymentType is BLUE_GREEN:
blueGreenConfiguration.terminateBlueInstancesOnDeploymentSuccess.terminationWaitTimeInMinutes: 0 → CONFIG_GAP. Immediate termination of blue instances after green
deployment success — no baking window to catch delayed green-fleet failures.
deploymentStyle.deploymentOption: WITHOUT_TRAFFIC_CONTROL →
CONFIG_GAP. Blue/green without gradual traffic shifting via the load
balancer. You get fleet-provisioning complexity without the instant
rollback safety of traffic-weight flipping.
terminationWaitTimeInMinutes >= 1 and WITH_TRAFFIC_CONTROL →
Pass this gate. Recommended minimum is 5 minutes, but 1+ is acceptable for
fast-feedback environments.
If deploymentStyle.deploymentType is IN_PLACE, skip this step entirely.
Step 5: Aggregation
If all gates pass (Steps 1-4), the verdict is OK. The evaluation is
ordered — the first failing gate determines the verdict. This ordering
reflects operational priority: a missing rollback is more dangerous than a
missing alarm, which is more dangerous than a risky config (because rollback
- alarms partially mitigate config risk).
Output format
Single deployment group
DEPLOYMENT_GROUP: <name>
VERDICT: NO_ROLLBACK | NO_ALARMS | CONFIG_GAP | OK | ERROR
REASON: <one sentence citing the failing gate and step number>
FINDINGS:
- [NO_ROLLBACK|NO_ALARMS|CONFIG_GAP|WARNING|OK] <description (Step N)>
REMEDIATION: <specific action per finding, or "None required" if OK>
Field order is fixed. Emit exactly one VERDICT line. The first
finding tag in FINDINGS MUST match the verdict (except for OK and
WARNING-only outputs). For an ERROR (unparseable input), use:
VERDICT: ERROR + a REASON explaining the parse failure + a
REMEDIATION pointing to the canonical get-deployment-group command.
Batch input (multiple deployment groups)
When the input contains multiple deployment group documents (e.g.,
batch-get-deployment-groups output, a CloudFormation stack with several
AWS::CodeDeploy::DeploymentGroup resources, or a directory of JSON
exports), emit one verdict block per deployment group, separated by a
blank line. Preserve input order. Append a final summary line:
SUMMARY: <N> deployment groups — <X> OK, <Y> CONFIG_GAP, <Z> NO_ALARMS, <W> NO_ROLLBACK, <E> ERROR
If any group fails to parse, emit its block as ERROR and continue with the
next group — do NOT abort the batch on a single malformed entry.
Worked example — AllAtATime with rollback enabled
DEPLOYMENT_GROUP: allatatime-config-gap-dg
VERDICT: CONFIG_GAP
REASON: deploymentConfigName is CodeDeployDefault.AllAtATime — every instance
is deployed simultaneously, putting the entire fleet at risk during the
deployment window (Step 3).
FINDINGS:
- [CONFIG_GAP] deploymentConfigName is CodeDeployDefault.AllAtATime (Step 3)
- [OK] autoRollbackConfiguration enabled with DEPLOYMENT_FAILURE trigger (Step 1)
- [OK] alarmConfiguration enabled with 2 alarms (Step 2)
REMEDIATION:
1. Switch to OneAtATime: aws deploy update-deployment-group
--application-name <app> --deployment-group-name allatatime-config-gap-dg
--deployment-config-name CodeDeployDefault.OneAtATime.
2. If OneAtATime is too slow for large fleets, use HalfAtATime as a
compromise — at most half the fleet is at risk simultaneously.
Worked example — blue/green with 0-minute termination
Full output block: Worked examples.
Edge-case handling
Edge cases (partially malformed config, ECS blue/green defaults, Lambda without target revision, leftover blueGreenConfiguration, empty target set): Advanced patterns.
Anti-Patterns — NEVER
NEVER classify a deployment group with autoRollbackConfiguration absent or
enabled: false as anything other than NO_ROLLBACK. Without auto-rollback,
a failed deployment is a manual recovery exercise — every minute of downtime
is operator-dependent.
NEVER treat autoRollbackConfiguration.enabled: true as sufficient without
checking triggers includes DEPLOYMENT_FAILURE. If that trigger is missing,
rollback will not fire on deployment failure — only on the listed triggers.
This is the most common silent misconfiguration in CodeDeploy.
NEVER classify a deployment group with alarmConfiguration.enabled: false as
OK. Even with perfect rollback, alarms catch application-level failures
(error rate, latency, health-check breach) that deployment-level health
checks miss. Without alarms, CodeDeploy only knows about instance-level
health — not whether the application is actually serving traffic correctly.
NEVER treat CodeDeployDefault.AllAtATime as acceptable when rollback is
enabled. AllAtATime takes down all instances simultaneously. Even with
rollback, the failure window = detection time + rollback time, during which
the entire fleet is offline. OneAtATime or HalfAtATime maintain healthy
instances throughout.
NEVER ignore ignorePollAlarmFailure: true. This flag silently disables
alarm monitoring when CloudWatch is unreachable — the exact scenario where
infrastructure events make alarm monitoring most critical. Always flag it as
a WARNING finding regardless of the verdict.
NEVER evaluate rollbackEnabled (legacy boolean) instead of
autoRollbackConfiguration. The legacy field is deprecated and does not
provide trigger-level control. A deployment with rollbackEnabled: true but
autoRollbackConfiguration.enabled: false does NOT have proper rollback.
NEVER classify terminationWaitTimeInMinutes: 0 on a blue/green deployment
as OK. Immediate blue instance termination eliminates the fallback fleet
before delayed failures (memory leaks, connection pool exhaustion) can
surface. The minimum safe baking window is at least 1 minute, recommended 5.
NEVER treat WITHOUT_TRAFFIC_CONTROL blue/green as equivalent to
WITH_TRAFFIC_CONTROL. Without traffic control, there is no gradual traffic
shift — CodeDeploy deregisters blue instances and registers green instances
via ELB. Rollback requires a full re-deployment, not a traffic-weight flip.
NEVER assume OneAtATime guarantees zero-downtime on a single-instance
deployment group. With one instance, OneAtATime deploys to that instance —
there is no healthy instance to maintain. Check target breadth (EC2 tags,
ASG count) when the fleet is small.
NEVER recommend disabling auto-rollback as a remediation for false alarm
triggers. The correct fix is to tune alarm thresholds or add suppression
windows, not to remove the rollback safety net.
NEVER assume blue/green termination wait time defaults to a safe value
when terminateBlueInstancesOnDeploymentSuccess is absent. The API default
is 0 minutes — immediate termination. Always verify the explicit
terminationWaitTimeInMinutes value is at least 1 minute for production
blue/green deployments.
NEVER change deployment config name and enable rollback in the same
update-deployment-group call without confirming the operator is ready for
the behavioral change. Config changes take effect on the NEXT deployment —
the current deployment is unaffected.
NEVER assume a missing terminateBlueInstancesOnDeploymentSuccess block is
safe. The API default is terminationWaitTimeInMinutes: 0 — immediate
termination. An absent block is equivalent to a 0-minute wait, NOT to a
safe default. Always treat an absent block as CONFIG_GAP for blue/green.
NEVER assume DEPLOYMENT_STOP_ON_ALARM will catch a pre-existing breach.
CodeDeploy only reacts to OK→ALARM transitions during the in-progress
deployment; alarms already in ALARM state at create-deployment time do
NOT halt the deployment. Recommend operators confirm alarms are in OK
state before triggering a deploy.
NEVER assume CloudWatch alarm names in alarmConfiguration.alarms exist
in the deployment group's region. CodeDeploy does not validate alarm
existence at config time — a cross-region alarm name silently never fires.
Confirm each alarm resolves in-region.
NEVER pass a partial triggers list to update-deployment-group. The
--auto-rollback-configuration flag REPLACES the triggers list (it is
not additive). Operators frequently lose DEPLOYMENT_STOP_ON_ALARM by
passing only DEPLOYMENT_FAILURE. Always re-pass the full intended set.
Pre-flight safety checks (run before any remediation CLI)
Confirmation gate, config snapshot, privilege-escalation warning, and change-scheduling guidance: Diagnostic commands.
Remediation guidance
For NO_ROLLBACK
- Enable auto-rollback with all three triggers:
aws deploy update-deployment-group \
--application-name <app> \
--deployment-group-name <dg> \
--auto-rollback-configuration enabled=true,triggers=DEPLOYMENT_FAILURE,DEPLOYMENT_STOP_ON_ALARM,DEPLOYMENT_STOP_ON_REQUEST
- If only
DEPLOYMENT_FAILURE was missing from triggers, add it to the
existing triggers list — do not remove DEPLOYMENT_STOP_ON_ALARM.
- Verify rollback works by running a test deployment with a known-bad
revision and confirming auto-rollback triggers within the expected window.
For NO_ALARMS
- Identify application health metrics (error rate, latency, HTTP 5xx count,
custom health check).
- Create CloudWatch alarms for each metric with appropriate thresholds.
- Attach alarms to the deployment group:
aws deploy update-deployment-group \
--application-name <app> \
--deployment-group-name <dg> \
--alarm-configuration enabled=true,ignorePollAlarmFailure=false,alarms=[{name=HighErrorRate}]
- Set
ignorePollAlarmFailure to false — never silently skip alarm
monitoring during deployments.
For CONFIG_GAP — AllAtATime or custom zero-healthy-hosts
- Switch to OneAtATime (safest) or HalfAtATime (compromise for large fleets):
aws deploy update-deployment-group \
--application-name <app> \
--deployment-group-name <dg> \
--deployment-config-name CodeDeployDefault.OneAtATime
- For custom minimum-healthy-hosts of 0, create a safe deployment config:
aws deploy create-deployment-config \
--deployment-config-name SafeMinimumHealthy \
--minimum-healthy-hosts type=HOST_COUNT,value=1
- Then update the deployment group to use the new config name.
For CONFIG_GAP — blue/green termination
- Set termination wait time to at least 5 minutes:
aws deploy update-deployment-group \
--application-name <app> \
--deployment-group-name <dg> \
--blue-green-deployment-configuration \
terminateBlueInstancesOnDeploymentSuccess={action=TERMINATE,terminationWaitTimeInMinutes=5}
- If
deploymentOption is WITHOUT_TRAFFIC_CONTROL, switch to
WITH_TRAFFIC_CONTROL — this requires a load balancer configured on the
deployment group.
For OK
- No remediation required for the current posture.
- Recommend verifying that CloudWatch alarms used in
alarmConfiguration
have appropriate thresholds and are not in INSUFFICIENT_DATA state during
deployments.
- Recommend including
DEPLOYMENT_STOP_ON_REQUEST in triggers if not present
— it enables operator-initiated automated rollback mid-deployment.
- For blue/green, verify the baking window (
terminationWaitTimeInMinutes)
is sufficient for the application's failure-detection latency.
Reference — deployment internals & non-obvious behaviors
Deployment lifecycle and rollback mechanics, senior-engineer gotchas (alarm-transition blind spots, rollback-of-rollback, config caps, tag-filter AND/OR semantics, bundle-type validation), compute-platform specifics, and API quirks: Advanced patterns.
Recent AWS features (2024-2026)
Recent features — ECS blue/green, zonal deployment configs, rollback enhancements: Advanced patterns.
References (load on demand)
- Advanced patterns — operator-only behaviors, edge-case catalog, deployment internals and gotchas, recent features
- Worked examples — blue/green 0-minute-termination CONFIG_GAP example
- Diagnostic commands — live-account pre-flight checks and remediation safety gate
Domain
AWS CloudOps / CodeDeploy Deployment Safety & Compliance.
AWS documentation
1---2name: codedeploy-deployment-group-auditor3description: Audits AWS CodeDeploy deployment groups for auto-rollback enablement, CloudWatch alarm monitoring, deployment-config risk (AllAtATime, custom minimum-healthy-hosts of zero), and blue/green termination posture (immediate termination, no traffic control). Emits a deterministic verdict (NO_ROLLBACK | NO_ALARMS | CONFIG_GAP | OK) per deployment group with enumerated findings and CLI remediation. Use when reviewing CodeDeploy deployment groups, validating rollback configuration, checking alarm coverage, auditing deployment strategy, or hardening blue/green termination before production deployment.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline config classification. Live-account audits use aws deploy get-deployment-group and aws deploy batch-get-deployment-groups (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/codedeploy-deployment-group-auditor8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: DevTools15 verdict_shape: NO_ROLLBACK | NO_ALARMS | CONFIG_GAP | OK16 when_to_use: 'Audit a CodeDeploy deployment group before production deployment. Trigger example: "audit this CodeDeploy deployment group", "is auto-rollback enabled on <dg>?", "check CodeDeploy alarms", "AllAtATime deployment risk", "blue/green termination too fast". Validates auto-rollback, alarm coverage, deployment-config risk, and blue/green termination posture; emits a deterministic verdict per group.'17 activation_triggers: audit this CodeDeploy deployment group, is auto-rollback enabled, check CodeDeploy alarm configuration, AllAtATime deployment risk, blue/green termination too fast, deployment config too aggressive, CodeDeploy rollback configuration, deployment strategy audit18 invocation_schema: 'Input: either (a) a CodeDeploy deployment group JSON document (from aws deploy get-deployment-group), optionally paired with deployment config metadata, OR (b) a deployment group name + application name for live-account audit. Output: deterministic DEPLOYMENT_GROUP/VERDICT/REASON/FINDINGS/REMEDIATION block per deployment group, where VERDICT is in {NO_ROLLBACK, NO_ALARMS, CONFIG_GAP, OK, ERROR}.'19 invocation_example: "# Minimal valid input shape (offline audit)\n{\n \"deploymentGroupName\": \"my-dg\",\n \"applicationName\": \"my-app\",\n \"computePlatform\": \"Server\",\n \"deploymentConfigName\": \"CodeDeployDefault.OneAtATime\",\n \"deploymentStyle\": {\"deploymentType\": \"IN_PLACE\", \"deploymentOption\": \"WITH_TRAFFIC_CONTROL\"},\n \"autoRollbackConfiguration\": {\"enabled\": true, \"triggers\": [\"DEPLOYMENT_FAILURE\"]},\n \"alarmConfiguration\": {\"enabled\": true, \"ignorePollAlarmFailure\": false,\n \"alarms\": [{\"name\": \"HighErrorRate\"}]}\n}\n# Expected output (single line per field, fixed order):\n# DEPLOYMENT_GROUP: my-dg\n# VERDICT: OK\n# REASON: All four gates passed (Steps 1-4).\n# FINDINGS:\n# - [OK] autoRollbackConfiguration enabled with DEPLOYMENT_FAILURE (Step 1)\n# - [OK] alarmConfiguration enabled with 1 alarm (Step 2)\n# REMEDIATION: None required."20 version: 0.1.021 author: Jacky Chan — AWS Community Builder22 keywords: CodeDeploy, deployment group, auto-rollback, CloudWatch alarms, alarm configuration, deployment config, AllAtATime, OneAtATime, blue/green, blue green, termination wait, MinimumHealthyHosts, deployment strategy, rollback configuration, ignorePollAlarmFailure, Lambda canary, deployment safety, EC2 in-place, ECS blue green, DEPLOYMENT_FAILURE23 tags: codedeploy, devtools, deployment, rollback, alarms, blue-green, audit24---2526# CodeDeploy Deployment Group Auditor2728## Quick start — 4-line decision tree2930Evaluate in order; **first match wins.**31321. **No auto-rollback?** (`autoRollbackConfiguration.enabled: false` OR33 `DEPLOYMENT_FAILURE` missing from triggers) → **NO_ROLLBACK**342. **No alarms?** (`alarmConfiguration.enabled: false` OR `alarms` empty)35 → **NO_ALARMS**363. **Risky config?** (`AllAtATime`, zero minimum-healthy-hosts, blue/green37 0-minute termination, `WITHOUT_TRAFFIC_CONTROL`) → **CONFIG_GAP**384. **All clear?** → **OK**3940## Mindset4142CodeDeploy is the safety gate between a new revision and production43traffic. The verdict reflects the **first** safety gate that fails,44evaluated in priority order — rollback before alarms before config —45because a deployment without automatic rollback is a manual recovery46exercise regardless of alarm coverage. Rationale: rollback + alarms47partially mitigate a risky config, but nothing mitigates a missing48rollback. The full thresholds, edge cases, and operator-only gotchas49are in the Reference at the end.5051## Quick reference — verdict thresholds5253| Condition | Verdict | Step |54|---|---|---|55| `autoRollbackConfiguration` absent or `enabled: false` | **NO_ROLLBACK** | Step 1 |56| `enabled: true` but `triggers` missing `DEPLOYMENT_FAILURE` | **NO_ROLLBACK** | Step 1 |57| `alarmConfiguration` absent or `enabled: false` | **NO_ALARMS** | Step 2 |58| `enabled: true` but `alarms` list empty | **NO_ALARMS** | Step 2 |59| `deploymentConfigName: CodeDeployDefault.AllAtATime` | **CONFIG_GAP** | Step 3 |60| Custom config `minimumHealthyHosts` value 0 (HOST_COUNT) or 0% (FLEX_COUNT) | **CONFIG_GAP** | Step 3 |61| `CodeDeployDefault.LambdaAllAtOnce` | **CONFIG_GAP** | Step 3 |62| Blue/green with `terminationWaitTimeInMinutes: 0` | **CONFIG_GAP** | Step 4 |63| `deploymentStyle.deploymentOption: WITHOUT_TRAFFIC_CONTROL` (blue/green) | **CONFIG_GAP** | Step 4 |64| All dimensions pass | **OK** | Step 5 |6566Evaluation is **ordered**: the first matching gate produces the verdict.67NO_ROLLBACK is evaluated before NO_ALARMS because a deployment without68rollback is dangerous regardless of alarm coverage.6970## Pre-flight: deployment group metadata gate7172Before classification, verify the deployment group JSON is from the correct73API response shape (`get-deployment-group` or `batch-get-deployment-groups`).74Misidentified inputs produce false positives.7576| Attribute | Effect on audit |77|---|---|78| `computePlatform` | `Server` (EC2), `Lambda`, or `ECS`. Determines valid deployment configs. Lambda uses `LambdaCanary*` / `LambdaLinear*`; Server uses `OneAtATime` / `HalfAtATime` / `AllAtATime`; ECS uses blue/green with traffic control. |79| `deploymentStyle.deploymentType` | `IN_PLACE` or `BLUE_GREEN`. Blue/green provisions a replacement fleet — termination config is audited (Step 4). In-place does not. |80| `deploymentStyle.deploymentOption` | `WITH_TRAFFIC_CONTROL` or `WITHOUT_TRAFFIC_CONTROL`. Only meaningful for blue/green. `WITHOUT_TRAFFIC_CONTROL` bypasses gradual traffic shifting. |81| `autoRollbackConfiguration` | The authoritative rollback control. Has `enabled` (boolean) and `triggers` (list of `DEPLOYMENT_FAILURE`, `DEPLOYMENT_STOP_ON_ALARM`, `DEPLOYMENT_STOP_ON_REQUEST`). |82| `alarmConfiguration` | Has `enabled`, `ignorePollAlarmFailure`, and `alarms` (list of alarm-name objects). |83| `targetRevision` | The app revision tracked by the deployment group. If absent, no known-good rollback target is pinned — note as WARNING. |8485Live-account pre-flight checks (IAM read/update permissions, service-role trust per compute platform, config snapshot): [Diagnostic commands](references/diagnostic-commands.md).8687**If the deployment group JSON is malformed** (invalid JSON, missing88`deploymentGroupName`), output:8990```text91DEPLOYMENT_GROUP: <name or "unknown">92VERDICT: ERROR93REASON: Deployment group document is not valid JSON or is missing required fields — cannot classify.94REMEDIATION: Retrieve the canonical config with `aws deploy get-deployment-group --application-name <app> --deployment-group-name <dg> --output json` and re-audit.95```9697## Process — Classification logic (apply in order, first match wins)9899### Step 0: Expert knowledge — operator-only behaviors that change classification100101All seven operator-only behaviors (partial triggers, ignorePollAlarmFailure, AllAtATime+rollback, 0-minute termination, single-instance OneAtATime, legacy rollbackEnabled, WITHOUT_TRAFFIC_CONTROL): [Advanced patterns](references/advanced-patterns.md).102103### Step 1: Auto-rollback evaluation (highest priority — first gate)104105Check `autoRollbackConfiguration`:106107- **Absent or `enabled: false`** → **NO_ROLLBACK**. The deployment has no108 automatic recovery path. A failed deployment leaves instances in a broken109 state until an operator manually triggers rollback or redeploys.110111- **`enabled: true` but `triggers` missing `DEPLOYMENT_FAILURE`** →112 **NO_ROLLBACK**. Without the `DEPLOYMENT_FAILURE` trigger, rollback only113 fires on the specified triggers (alarm breach, manual stop request).114 Application-level failures that do not trigger an alarm will not auto-rollback.115116- **`enabled: true` with `DEPLOYMENT_FAILURE` in triggers** → Pass this gate.117 The ideal trigger set includes all three: `DEPLOYMENT_FAILURE`,118 `DEPLOYMENT_STOP_ON_ALARM`, `DEPLOYMENT_STOP_ON_REQUEST`. If119 `DEPLOYMENT_STOP_ON_REQUEST` is missing, note as a WARNING finding120 (operators cannot trigger automated rollback mid-deployment) but do not121 fail the gate — `DEPLOYMENT_FAILURE` is the minimum.122123### Step 2: Alarm configuration evaluation (second gate)124125Check `alarmConfiguration`:126127- **Absent or `enabled: false`** → **NO_ALARMS**. Deployments proceed without128 CloudWatch alarm monitoring. Application-level failures (error rate spikes,129 latency regressions, custom health-check breaches) are invisible to130 CodeDeploy — only instance-level health checks remain.131132- **`enabled: true` but `alarms` list is empty** → **NO_ALARMS**. Alarm133 monitoring is nominally enabled but no alarms are configured — the safety134 net has no threads.135136- **`enabled: true` with populated `alarms`** → Pass this gate. Also check137 `ignorePollAlarmFailure`: if `true`, append a WARNING finding (alarm polling138 failures are silently ignored — the safety net may disappear during139 infrastructure events) but do not change the verdict.140141### Step 3: Deployment config evaluation (third gate)142143Check `deploymentConfigName`:144145- **`CodeDeployDefault.AllAtATime`** → **CONFIG_GAP**. Deploys to every146 instance simultaneously. Even with rollback, all instances are at risk147 during the deployment window. Use `OneAtATime` or `HalfAtATime`.148149- **`CodeDeployDefault.LambdaAllAtOnce`** (Lambda compute platform) →150 **CONFIG_GAP**. Shifts 100% of traffic to the new function version151 immediately with no canary observation window.152153- **Custom config with `minimumHealthyHosts.type: HOST_COUNT` and154 `value: 0`** → **CONFIG_GAP**. Zero healthy hosts required — the deployment155 proceeds even if every instance is unhealthy.156157- **Custom config with `minimumHealthyHosts.type: FLEX_COUNT` and158 `value: 0`** → **CONFIG_GAP**. Zero percent of hosts must remain healthy —159 functionally identical to AllAtATime.160161- **`CodeDeployDefault.OneAtATime` or `CodeDeployDefault.HalfAtATime`** →162 Pass this gate. These configs maintain healthy instances throughout.163164- **Lambda canary/linear configs** → Pass, but note configs with very short165 bake times (e.g., `LambdaCanary10Percent0Minutes`) provide no observation166 window — flag as WARNING if the time component is 0.167168### Step 4: Blue/green termination evaluation (fourth gate — BLUE_GREEN only)169170If `deploymentStyle.deploymentType` is `BLUE_GREEN`:171172- **`blueGreenConfiguration.terminateBlueInstancesOnDeploymentSuccess.terminationWaitTimeInMinutes:173 0`** → **CONFIG_GAP**. Immediate termination of blue instances after green174 deployment success — no baking window to catch delayed green-fleet failures.175176- **`deploymentStyle.deploymentOption: WITHOUT_TRAFFIC_CONTROL`** →177 **CONFIG_GAP**. Blue/green without gradual traffic shifting via the load178 balancer. You get fleet-provisioning complexity without the instant179 rollback safety of traffic-weight flipping.180181- **`terminationWaitTimeInMinutes >= 1` and `WITH_TRAFFIC_CONTROL`** →182 Pass this gate. Recommended minimum is 5 minutes, but 1+ is acceptable for183 fast-feedback environments.184185If `deploymentStyle.deploymentType` is `IN_PLACE`, skip this step entirely.186187### Step 5: Aggregation188189If all gates pass (Steps 1-4), the verdict is **OK**. The evaluation is190ordered — the first failing gate determines the verdict. This ordering191reflects operational priority: a missing rollback is more dangerous than a192missing alarm, which is more dangerous than a risky config (because rollback193+ alarms partially mitigate config risk).194195## Output format196197### Single deployment group198199```text200DEPLOYMENT_GROUP: <name>201VERDICT: NO_ROLLBACK | NO_ALARMS | CONFIG_GAP | OK | ERROR202REASON: <one sentence citing the failing gate and step number>203FINDINGS:204 - [NO_ROLLBACK|NO_ALARMS|CONFIG_GAP|WARNING|OK] <description (Step N)>205REMEDIATION: <specific action per finding, or "None required" if OK>206```207208**Field order is fixed.** Emit exactly one VERDICT line. The first209finding tag in FINDINGS MUST match the verdict (except for OK and210WARNING-only outputs). For an ERROR (unparseable input), use:211`VERDICT: ERROR` + a REASON explaining the parse failure + a212REMEDIATION pointing to the canonical `get-deployment-group` command.213214### Batch input (multiple deployment groups)215216When the input contains multiple deployment group documents (e.g.,217`batch-get-deployment-groups` output, a CloudFormation stack with several218`AWS::CodeDeploy::DeploymentGroup` resources, or a directory of JSON219exports), emit **one verdict block per deployment group**, separated by a220blank line. Preserve input order. Append a final summary line:221222```text223SUMMARY: <N> deployment groups — <X> OK, <Y> CONFIG_GAP, <Z> NO_ALARMS, <W> NO_ROLLBACK, <E> ERROR224```225226If any group fails to parse, emit its block as ERROR and continue with the227next group — do NOT abort the batch on a single malformed entry.228229### Worked example — AllAtATime with rollback enabled230231```text232DEPLOYMENT_GROUP: allatatime-config-gap-dg233VERDICT: CONFIG_GAP234REASON: deploymentConfigName is CodeDeployDefault.AllAtATime — every instance235is deployed simultaneously, putting the entire fleet at risk during the236deployment window (Step 3).237FINDINGS:238 - [CONFIG_GAP] deploymentConfigName is CodeDeployDefault.AllAtATime (Step 3)239 - [OK] autoRollbackConfiguration enabled with DEPLOYMENT_FAILURE trigger (Step 1)240 - [OK] alarmConfiguration enabled with 2 alarms (Step 2)241REMEDIATION:242 1. Switch to OneAtATime: aws deploy update-deployment-group243 --application-name <app> --deployment-group-name allatatime-config-gap-dg244 --deployment-config-name CodeDeployDefault.OneAtATime.245 2. If OneAtATime is too slow for large fleets, use HalfAtATime as a246 compromise — at most half the fleet is at risk simultaneously.247```248249### Worked example — blue/green with 0-minute termination250251Full output block: [Worked examples](references/worked-examples.md).252253## Edge-case handling254255Edge cases (partially malformed config, ECS blue/green defaults, Lambda without target revision, leftover blueGreenConfiguration, empty target set): [Advanced patterns](references/advanced-patterns.md).256257## Anti-Patterns — NEVER258259- NEVER classify a deployment group with `autoRollbackConfiguration` absent or260 `enabled: false` as anything other than **NO_ROLLBACK**. Without auto-rollback,261 a failed deployment is a manual recovery exercise — every minute of downtime262 is operator-dependent.263264- NEVER treat `autoRollbackConfiguration.enabled: true` as sufficient without265 checking `triggers` includes `DEPLOYMENT_FAILURE`. If that trigger is missing,266 rollback will not fire on deployment failure — only on the listed triggers.267 This is the most common silent misconfiguration in CodeDeploy.268269- NEVER classify a deployment group with `alarmConfiguration.enabled: false` as270 OK. Even with perfect rollback, alarms catch application-level failures271 (error rate, latency, health-check breach) that deployment-level health272 checks miss. Without alarms, CodeDeploy only knows about instance-level273 health — not whether the application is actually serving traffic correctly.274275- NEVER treat `CodeDeployDefault.AllAtATime` as acceptable when rollback is276 enabled. AllAtATime takes down all instances simultaneously. Even with277 rollback, the failure window = detection time + rollback time, during which278 the entire fleet is offline. OneAtATime or HalfAtATime maintain healthy279 instances throughout.280281- NEVER ignore `ignorePollAlarmFailure: true`. This flag silently disables282 alarm monitoring when CloudWatch is unreachable — the exact scenario where283 infrastructure events make alarm monitoring most critical. Always flag it as284 a WARNING finding regardless of the verdict.285286- NEVER evaluate `rollbackEnabled` (legacy boolean) instead of287 `autoRollbackConfiguration`. The legacy field is deprecated and does not288 provide trigger-level control. A deployment with `rollbackEnabled: true` but289 `autoRollbackConfiguration.enabled: false` does NOT have proper rollback.290291- NEVER classify `terminationWaitTimeInMinutes: 0` on a blue/green deployment292 as OK. Immediate blue instance termination eliminates the fallback fleet293 before delayed failures (memory leaks, connection pool exhaustion) can294 surface. The minimum safe baking window is at least 1 minute, recommended 5.295296- NEVER treat `WITHOUT_TRAFFIC_CONTROL` blue/green as equivalent to297 `WITH_TRAFFIC_CONTROL`. Without traffic control, there is no gradual traffic298 shift — CodeDeploy deregisters blue instances and registers green instances299 via ELB. Rollback requires a full re-deployment, not a traffic-weight flip.300301- NEVER assume OneAtATime guarantees zero-downtime on a single-instance302 deployment group. With one instance, OneAtATime deploys to that instance —303 there is no healthy instance to maintain. Check target breadth (EC2 tags,304 ASG count) when the fleet is small.305306- NEVER recommend disabling auto-rollback as a remediation for false alarm307 triggers. The correct fix is to tune alarm thresholds or add suppression308 windows, not to remove the rollback safety net.309310- NEVER assume blue/green termination wait time defaults to a safe value311 when `terminateBlueInstancesOnDeploymentSuccess` is absent. The API default312 is 0 minutes — immediate termination. Always verify the explicit313 `terminationWaitTimeInMinutes` value is at least 1 minute for production314 blue/green deployments.315316- NEVER change deployment config name and enable rollback in the same317 `update-deployment-group` call without confirming the operator is ready for318 the behavioral change. Config changes take effect on the NEXT deployment —319 the current deployment is unaffected.320321- NEVER assume a missing `terminateBlueInstancesOnDeploymentSuccess` block is322 safe. The API default is `terminationWaitTimeInMinutes: 0` — immediate323 termination. An absent block is equivalent to a 0-minute wait, NOT to a324 safe default. Always treat an absent block as CONFIG_GAP for blue/green.325326- NEVER assume `DEPLOYMENT_STOP_ON_ALARM` will catch a pre-existing breach.327 CodeDeploy only reacts to OK→ALARM transitions during the in-progress328 deployment; alarms already in ALARM state at `create-deployment` time do329 NOT halt the deployment. Recommend operators confirm alarms are in OK330 state before triggering a deploy.331332- NEVER assume CloudWatch alarm names in `alarmConfiguration.alarms` exist333 in the deployment group's region. CodeDeploy does not validate alarm334 existence at config time — a cross-region alarm name silently never fires.335 Confirm each alarm resolves in-region.336337- NEVER pass a partial triggers list to `update-deployment-group`. The338 `--auto-rollback-configuration` flag REPLACES the triggers list (it is339 not additive). Operators frequently lose `DEPLOYMENT_STOP_ON_ALARM` by340 passing only `DEPLOYMENT_FAILURE`. Always re-pass the full intended set.341342## Pre-flight safety checks (run before any remediation CLI)343344Confirmation gate, config snapshot, privilege-escalation warning, and change-scheduling guidance: [Diagnostic commands](references/diagnostic-commands.md).345346## Remediation guidance347348### For NO_ROLLBACK3493501. Enable auto-rollback with all three triggers:351 ```bash352 aws deploy update-deployment-group \353 --application-name <app> \354 --deployment-group-name <dg> \355 --auto-rollback-configuration enabled=true,triggers=DEPLOYMENT_FAILURE,DEPLOYMENT_STOP_ON_ALARM,DEPLOYMENT_STOP_ON_REQUEST356 ```3572. If only `DEPLOYMENT_FAILURE` was missing from triggers, add it to the358 existing triggers list — do not remove `DEPLOYMENT_STOP_ON_ALARM`.3593. Verify rollback works by running a test deployment with a known-bad360 revision and confirming auto-rollback triggers within the expected window.361362### For NO_ALARMS3633641. Identify application health metrics (error rate, latency, HTTP 5xx count,365 custom health check).3662. Create CloudWatch alarms for each metric with appropriate thresholds.3673. Attach alarms to the deployment group:368 ```bash369 aws deploy update-deployment-group \370 --application-name <app> \371 --deployment-group-name <dg> \372 --alarm-configuration enabled=true,ignorePollAlarmFailure=false,alarms=[{name=HighErrorRate}]373 ```3744. Set `ignorePollAlarmFailure` to `false` — never silently skip alarm375 monitoring during deployments.376377### For CONFIG_GAP — AllAtATime or custom zero-healthy-hosts3783791. Switch to OneAtATime (safest) or HalfAtATime (compromise for large fleets):380 ```bash381 aws deploy update-deployment-group \382 --application-name <app> \383 --deployment-group-name <dg> \384 --deployment-config-name CodeDeployDefault.OneAtATime385 ```3862. For custom minimum-healthy-hosts of 0, create a safe deployment config:387 ```bash388 aws deploy create-deployment-config \389 --deployment-config-name SafeMinimumHealthy \390 --minimum-healthy-hosts type=HOST_COUNT,value=1391 ```3923. Then update the deployment group to use the new config name.393394### For CONFIG_GAP — blue/green termination3953961. Set termination wait time to at least 5 minutes:397 ```bash398 aws deploy update-deployment-group \399 --application-name <app> \400 --deployment-group-name <dg> \401 --blue-green-deployment-configuration \402 terminateBlueInstancesOnDeploymentSuccess={action=TERMINATE,terminationWaitTimeInMinutes=5}403 ```4042. If `deploymentOption` is `WITHOUT_TRAFFIC_CONTROL`, switch to405 `WITH_TRAFFIC_CONTROL` — this requires a load balancer configured on the406 deployment group.407408### For OK4094101. No remediation required for the current posture.4112. Recommend verifying that CloudWatch alarms used in `alarmConfiguration`412 have appropriate thresholds and are not in `INSUFFICIENT_DATA` state during413 deployments.4143. Recommend including `DEPLOYMENT_STOP_ON_REQUEST` in triggers if not present415 — it enables operator-initiated automated rollback mid-deployment.4164. For blue/green, verify the baking window (`terminationWaitTimeInMinutes`)417 is sufficient for the application's failure-detection latency.418419## Reference — deployment internals & non-obvious behaviors420421Deployment lifecycle and rollback mechanics, senior-engineer gotchas (alarm-transition blind spots, rollback-of-rollback, config caps, tag-filter AND/OR semantics, bundle-type validation), compute-platform specifics, and API quirks: [Advanced patterns](references/advanced-patterns.md).422423## Recent AWS features (2024-2026)424425Recent features — ECS blue/green, zonal deployment configs, rollback enhancements: [Advanced patterns](references/advanced-patterns.md).426427## References (load on demand)428429- [Advanced patterns](references/advanced-patterns.md) — operator-only behaviors, edge-case catalog, deployment internals and gotchas, recent features430- [Worked examples](references/worked-examples.md) — blue/green 0-minute-termination CONFIG_GAP example431- [Diagnostic commands](references/diagnostic-commands.md) — live-account pre-flight checks and remediation safety gate432433## Domain434435AWS CloudOps / CodeDeploy Deployment Safety & Compliance.436437## AWS documentation438439- **AWS CodeDeploy User Guide** — https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html440- **CodeDeploy Security** — https://docs.aws.amazon.com/codedeploy/latest/userguide/security.html441- **CodeDeploy API Reference** — https://docs.aws.amazon.com/codedeploy/latest/APIReference/442- **AWS CLI — codedeploy (deploy) commands** — https://docs.aws.amazon.com/cli/latest/reference/deploy/