diff --git a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts index 56e491f1f98cb..6704ab8d79ca9 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -364,6 +364,10 @@ export abstract class BaseService extends Resource deploymentConfiguration: { maximumPercent: props.maxHealthyPercent || 200, minimumHealthyPercent: props.minHealthyPercent === undefined ? 50 : props.minHealthyPercent, + deploymentCircuitBreaker: props.circuitBreaker ? { + enable: true, + rollback: props.circuitBreaker.rollback ?? false, + } : undefined, }, propagateTags: props.propagateTags === PropagatedTagSource.NONE ? undefined : props.propagateTags, enableEcsManagedTags: props.enableECSManagedTags === undefined ? false : props.enableECSManagedTags, @@ -376,16 +380,6 @@ export abstract class BaseService extends Resource ...additionalProps, }); - if (props.circuitBreaker) { - const deploymentConfiguration = { - DeploymentCircuitBreaker: { - Enable: true, - Rollback: props.circuitBreaker.rollback ?? false, - }, - }; - // TODO: fix this when this property is available in CfnService - this.resource.addPropertyOverride('DeploymentConfiguration', deploymentConfiguration); - }; if (props.deploymentController?.type === DeploymentControllerType.EXTERNAL) { Annotations.of(this).addWarning('taskDefinition and launchType are blanked out when using external deployment controller.'); }