Skip to content

Commit 3d30cdb

Browse files
authored
chore(release): 2.51.1 (#22983)
See CHANGELOG ---- ### All Submissions: * [ ] 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 * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] 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*
2 parents a87259f + 8f4767d commit 3d30cdb

File tree

5 files changed

+67
-11
lines changed

5 files changed

+67
-11
lines changed

CHANGELOG.v2.alpha.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.51.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.51.0-alpha.0...v2.51.1-alpha.0) (2022-11-18)
6+
57
## [2.51.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.50.0-alpha.0...v2.51.0-alpha.0) (2022-11-18)
68

79

@@ -28,7 +30,7 @@ All notable changes to this project will be documented in this file. See [standa
2830

2931
* **synthetics:** aws synthetics runtime version syn-nodejs-puppeteer-3.8 ([#22707](https://github.com/aws/aws-cdk/issues/22707)) ([228c865](https://github.com/aws/aws-cdk/commit/228c86532118b143e365b2268d06ee3a36fcf3a7))
3032

31-
## [2.49.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.49.0-alpha.0...v2.49.1-alpha.0) (2022-10-31)
33+
## [2.49.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.49.0-alpha.0...v2.49.1-alpha.0) (2022-10-31)
3234

3335
## [2.49.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.48.0-alpha.0...v2.49.0-alpha.0) (2022-10-27)
3436

CHANGELOG.v2.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.51.1](https://github.com/aws/aws-cdk/compare/v2.51.0...v2.51.1) (2022-11-18)
6+
7+
8+
### Bug Fixes
9+
10+
* ECS service replacement regression ([#22978](https://github.com/aws/aws-cdk/issues/22978)) ([680e048](https://github.com/aws/aws-cdk/commit/680e048abc0c1e778b64c4e29fefcff0704f4d30)), closes [#22467](https://github.com/aws/aws-cdk/issues/22467)
11+
512
## [2.51.0](https://github.com/aws/aws-cdk/compare/v2.50.0...v2.51.0) (2022-11-18)
613

714

packages/@aws-cdk/aws-ecs/lib/base/base-service.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,16 @@ export abstract class BaseService extends Resource
532532
const disableCircuitBreakerEcsDeploymentControllerFeatureFlag =
533533
FeatureFlags.of(this).isEnabled(cxapi.ECS_DISABLE_EXPLICIT_DEPLOYMENT_CONTROLLER_FOR_CIRCUIT_BREAKER);
534534

535-
return disableCircuitBreakerEcsDeploymentControllerFeatureFlag ? undefined : {
536-
type: DeploymentControllerType.ECS,
537-
};
535+
if (!disableCircuitBreakerEcsDeploymentControllerFeatureFlag && props.circuitBreaker) {
536+
// This is undesirable behavior (the controller is implicitly ECS anyway when left
537+
// undefined, so specifying it is not necessary but DOES trigger a CFN replacement)
538+
// but we leave it in for backwards compat.
539+
return {
540+
type: DeploymentControllerType.ECS,
541+
};
542+
}
543+
544+
return undefined;
538545
}
539546

540547
private executeCommandLogConfiguration() {

packages/@aws-cdk/aws-ecs/test/base-service.test.ts

+45-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
import { Template, Match } from '@aws-cdk/assertions';
2+
import * as ec2 from '@aws-cdk/aws-ec2';
13
import * as cdk from '@aws-cdk/core';
4+
import { App, Stack } from '@aws-cdk/core';
25
import * as ecs from '../lib';
36

4-
let stack: cdk.Stack;
7+
describe('When import an ECS Service', () => {
8+
let stack: cdk.Stack;
59

6-
beforeEach(() => {
7-
stack = new cdk.Stack();
8-
});
10+
beforeEach(() => {
11+
stack = new cdk.Stack();
12+
});
913

10-
describe('When import an ECS Service', () => {
1114
test('with serviceArnWithCluster', () => {
1215
// GIVEN
1316
const clusterName = 'cluster-name';
@@ -42,3 +45,40 @@ describe('When import an ECS Service', () => {
4245
}).toThrowError(/is not using the ARN cluster format/);
4346
});
4447
});
48+
49+
test.each([
50+
/* breaker, flag => controller in template */
51+
/* Flag off => value present if circuitbreaker */
52+
[false, false, false],
53+
[true, false, true],
54+
/* Flag on => value never present */
55+
[false, true, false],
56+
[true, true, false],
57+
])('circuitbreaker is %p /\\ flag is %p => DeploymentController in output: %p', (circuitBreaker, flagValue, controllerInTemplate) => {
58+
// GIVEN
59+
const app = new App({
60+
context: {
61+
'@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker': flagValue,
62+
},
63+
});
64+
const stack = new Stack(app, 'Stack');
65+
const vpc = new ec2.Vpc(stack, 'Vpc');
66+
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
67+
const taskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDef');
68+
taskDefinition.addContainer('web', {
69+
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
70+
});
71+
72+
// WHEN
73+
new ecs.FargateService(stack, 'FargateService', {
74+
cluster,
75+
taskDefinition,
76+
circuitBreaker: circuitBreaker ? { } : undefined,
77+
});
78+
79+
// THEN
80+
const template = Template.fromStack(stack);
81+
template.hasResourceProperties('AWS::ECS::Service', {
82+
DeploymentController: controllerInTemplate ? { Type: 'ECS' } : Match.absent(),
83+
});
84+
});

version.v2.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.51.0",
3-
"alphaVersion": "2.51.0-alpha.0"
2+
"version": "2.51.1",
3+
"alphaVersion": "2.51.1-alpha.0"
44
}

0 commit comments

Comments
 (0)