Skip to content

Commit 5250486

Browse files
author
Abdul Kader Maliyakkal
committed
Set deploymentController to ECS deployment type if circuitBreaker is defined
1 parent e2da141 commit 5250486

File tree

7 files changed

+23
-27
lines changed

7 files changed

+23
-27
lines changed

packages/@aws-cdk/aws-ecs-patterns/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ const service = new ApplicationLoadBalancedFargateService(stack, 'Service', {
410410
taskImageOptions: {
411411
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
412412
},
413-
deploymentController: {
414-
type: ecs.DeploymentControllerType.ECS,
415-
},
416413
circuitBreaker: { rollback: true },
417414
});
418415
```

packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,6 @@ export = {
11121112
taskImageOptions: {
11131113
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
11141114
},
1115-
deploymentController: {
1116-
type: ecs.DeploymentControllerType.ECS,
1117-
},
11181115
circuitBreaker: { rollback: true },
11191116
});
11201117

@@ -1126,6 +1123,9 @@ export = {
11261123
Rollback: true,
11271124
},
11281125
},
1126+
DeploymentController: {
1127+
Type: 'ECS',
1128+
},
11291129
}));
11301130

11311131
test.done();
@@ -1145,9 +1145,6 @@ export = {
11451145
taskImageOptions: {
11461146
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
11471147
},
1148-
deploymentController: {
1149-
type: ecs.DeploymentControllerType.ECS,
1150-
},
11511148
circuitBreaker: { rollback: true },
11521149
});
11531150

@@ -1159,6 +1156,9 @@ export = {
11591156
Rollback: true,
11601157
},
11611158
},
1159+
DeploymentController: {
1160+
Type: 'ECS',
1161+
},
11621162
}));
11631163

11641164
test.done();

packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ export = {
209209
maxHealthyPercent: 150,
210210
serviceName: 'ecs-test-service',
211211
family: 'ecs-task-family',
212-
deploymentController: {
213-
type: ecs.DeploymentControllerType.CODE_DEPLOY,
214-
},
215212
circuitBreaker: { rollback: true },
216213
});
217214

@@ -229,7 +226,7 @@ export = {
229226
LaunchType: 'EC2',
230227
ServiceName: 'ecs-test-service',
231228
DeploymentController: {
232-
Type: 'CODE_DEPLOY',
229+
Type: 'ECS',
233230
},
234231
}));
235232

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,6 @@ export = {
436436
taskImageOptions: {
437437
image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'),
438438
},
439-
deploymentController: {
440-
type: ecs.DeploymentControllerType.ECS,
441-
},
442439
circuitBreaker: { rollback: true },
443440
});
444441
// THEN
@@ -449,6 +446,9 @@ export = {
449446
Rollback: true,
450447
},
451448
},
449+
DeploymentController: {
450+
Type: 'ECS',
451+
},
452452
}));
453453
test.done();
454454
},
@@ -462,9 +462,6 @@ export = {
462462
taskImageOptions: {
463463
image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'),
464464
},
465-
deploymentController: {
466-
type: ecs.DeploymentControllerType.ECS,
467-
},
468465
circuitBreaker: { rollback: true },
469466
});
470467
// THEN
@@ -475,6 +472,9 @@ export = {
475472
Rollback: true,
476473
},
477474
},
475+
DeploymentController: {
476+
Type: 'ECS',
477+
},
478478
}));
479479
test.done();
480480
},

packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ export = {
344344
serviceName: 'fargate-test-service',
345345
family: 'fargate-task-family',
346346
platformVersion: ecs.FargatePlatformVersion.VERSION1_4,
347-
deploymentController: {
348-
type: ecs.DeploymentControllerType.CODE_DEPLOY,
349-
},
350347
circuitBreaker: { rollback: true },
351348
});
352349

@@ -365,7 +362,7 @@ export = {
365362
ServiceName: 'fargate-test-service',
366363
PlatformVersion: ecs.FargatePlatformVersion.VERSION1_4,
367364
DeploymentController: {
368-
Type: 'CODE_DEPLOY',
365+
Type: 'ECS',
369366
},
370367
}));
371368

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ export abstract class BaseService extends Resource
387387
},
388388
propagateTags: props.propagateTags === PropagatedTagSource.NONE ? undefined : props.propagateTags,
389389
enableEcsManagedTags: props.enableECSManagedTags ?? false,
390-
deploymentController: props.deploymentController,
390+
deploymentController: props.circuitBreaker ? {
391+
type: DeploymentControllerType.ECS,
392+
} : props.deploymentController,
391393
launchType: launchType,
392394
capacityProviderStrategy: props.capacityProviderStrategies,
393395
healthCheckGracePeriodSeconds: this.evaluateHealthGracePeriod(props.healthCheckGracePeriod),
@@ -937,4 +939,4 @@ function determineContainerNameAndPort(options: DetermineContainerNameAndPortOpt
937939
}
938940

939941
return {};
940-
}
942+
}

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ nodeunitShim({
294294
maxHealthyPercent: 150,
295295
minHealthyPercent: 55,
296296
deploymentController: {
297-
type: ecs.DeploymentControllerType.CODE_DEPLOY,
297+
type: ecs.DeploymentControllerType.ECS,
298298
},
299299
circuitBreaker: { rollback: true },
300300
securityGroup: new ec2.SecurityGroup(stack, 'SecurityGroup1', {
@@ -326,7 +326,7 @@ nodeunitShim({
326326
},
327327
},
328328
DeploymentController: {
329-
Type: ecs.DeploymentControllerType.CODE_DEPLOY,
329+
Type: ecs.DeploymentControllerType.ECS,
330330
},
331331
DesiredCount: 2,
332332
HealthCheckGracePeriodSeconds: 60,
@@ -1978,6 +1978,9 @@ nodeunitShim({
19781978
Rollback: true,
19791979
},
19801980
},
1981+
DeploymentController: {
1982+
Type: ecs.DeploymentControllerType.ECS,
1983+
},
19811984
}));
19821985

19831986
test.done();

0 commit comments

Comments
 (0)