Skip to content

Commit 9437d4f

Browse files
authored
fix(ecs): adding a circuit breaker causes Service replacement (under feature flag) (#22467)
Fixes #16126 Copied from #16919 with review comments as it went stale and closed. Initial implementation #22328 reverted because it was not backward compatible. Introduces feature flag: * `@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker` Enable this feature flag to avoid setting the "ECS" deployment controller when adding a circuit breaker to an ECS Service, as this will trigger a full replacement which fails to deploy when using set service names. This does not change any behaviour as the default deployment controller when it is not defined is ECS. _cdk.json_ ```json { "context": { "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true } } ``` ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4bdb18e commit 9437d4f

18 files changed

+2723
-9
lines changed

packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.circuit-breaker-load-balanced-fargate-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Vpc } from '@aws-cdk/aws-ec2';
22
import { Cluster, ContainerImage } from '@aws-cdk/aws-ecs';
33
import { App, Stack } from '@aws-cdk/core';
4+
import * as cxapi from '@aws-cdk/cx-api';
45
import * as integ from '@aws-cdk/integ-tests';
56
import { ApplicationLoadBalancedFargateService } from '../../lib';
67

7-
const app = new App();
8+
const app = new App({ postCliContext: { [cxapi.ECS_DISABLE_EXPLICIT_DEPLOYMENT_CONTROLLER_FOR_CIRCUIT_BREAKER]: false } });
89
const stack = new Stack(app, 'aws-ecs-integ-circuit-breaker');
910
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 });
1011
const cluster = new Cluster(stack, 'Cluster', { vpc });
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "21.0.0",
3+
"files": {
4+
"4eec79ee498cc4b9ae0a8ad419511759b90d72d3a3cb5bd018e5e137f050cfae": {
5+
"source": {
6+
"path": "aws-ecs-integ-circuit-breaker-no-dc.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "4eec79ee498cc4b9ae0a8ad419511759b90d72d3a3cb5bd018e5e137f050cfae.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}

0 commit comments

Comments
 (0)