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
- 1Set DeploymentConfiguration.DeploymentCircuitBreaker.Enable to true
- 2Set DeploymentConfiguration.DeploymentCircuitBreaker.Rollback to true so failed deployments revert to the last healthy task set
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,
});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::ServiceIntentional? 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 scanCDK Insights runs this and 118+ other rules locally against your synthesised CDK app — free, no account, your code never leaves your machine.