Skip to main content
MEDIUMECSOperational Excellence

ECS Deployment Circuit Breaker Disabled

ecs-deployment-circuit-breaker-disabled

What this rule checks

Detects ECS services (rolling-update controller) that do not enable the deployment circuit breaker, so a failed deployment is not stopped or rolled back automatically.

How to fix it

  1. 1Set DeploymentConfiguration.DeploymentCircuitBreaker.Enable to true
  2. 2Set DeploymentConfiguration.DeploymentCircuitBreaker.Rollback to true so failed deployments revert to the last healthy task set
FlaggedThe service uses the default rolling-update (ECS) controller but does not enable the deployment circuit breaker, so a deployment that never reaches a steady state is left running on failing tasks instead of being stopped and rolled back.
import { App, Stack } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as ecs from 'aws-cdk-lib/aws-ecs';

// FLAGGED: rolling-update service with no circuit breaker.
new ecs.CfnService(this, 'Service', {
  cluster: 'app-cluster',
  taskDefinition: 'app-task:1',
  desiredCount: 2,
});
FixedEnabling the deployment circuit breaker with Rollback: true means a failed rolling deployment is automatically stopped and reverted to the last healthy task set, instead of leaving the service degraded.
import { App, Stack } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as ecs from 'aws-cdk-lib/aws-ecs';

// FIXED: circuit breaker enabled with automatic rollback.
new ecs.CfnService(this, 'Service', {
  cluster: 'app-cluster',
  taskDefinition: 'app-task:1',
  desiredCount: 2,
  deploymentConfiguration: {
    deploymentCircuitBreaker: { enable: true, rollback: true },
  },
});

CDK Insights pinpoints the exact file and line in your CDK source for every finding, so you can jump straight to the fix.

Affected resource types

AWS::ECS::Service

AWS documentation

Read the AWS guidance

Intentional? Suppress this finding

Sometimes a flag is deliberate — a genuinely public endpoint, say. You can dismiss ecs-deployment-circuit-breaker-disabled and the reason is kept in the report, not silently hidden.

In .cdk-insights.json:

{
  "ignoreRules": [
    { "id": "ecs-deployment-circuit-breaker-disabled", "reason": "Why this is intentional" }
  ]
}

Or inline in your CDK code:

Validations.of(scope).acknowledge({
  id: 'cdk-insights::ecs-deployment-circuit-breaker-disabled',
  reason: 'Why this is intentional',
});

Use the rule ID ecs-deployment-circuit-breaker-disabled shown above — not the CDK-* ID from SARIF / GitHub code scanning. To dismiss every finding on one construct instead, use ignorePaths. Suppression docs →

Catch this in your stack

$ npx cdk-insights scan

CDK Insights runs this and 118+ other rules locally against your synthesised CDK app — free, no account, your code never leaves your machine.

More ECS rules