Skip to content

Commit e47491e

Browse files
committed
fix(aws-ecs): update desired count to be optional
1 parent 5b5f3b9 commit e47491e

21 files changed

+8
-54
lines changed

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.expected.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@
256256
"MaximumPercent": 200,
257257
"MinimumHealthyPercent": 50
258258
},
259-
"DesiredCount": 1,
260259
"EnableECSManagedTags": false,
261260
"LaunchType": "FARGATE",
262261
"NetworkConfiguration": {
@@ -1044,4 +1043,4 @@
10441043
}
10451044
}
10461045
}
1047-
}
1046+
}

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-separate-source.lit.expected.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,6 @@
18541854
"MaximumPercent": 200,
18551855
"MinimumHealthyPercent": 50
18561856
},
1857-
"DesiredCount": 1,
18581857
"EnableECSManagedTags": false,
18591858
"LaunchType": "FARGATE",
18601859
"NetworkConfiguration": {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ export interface BaseServiceOptions {
105105
/**
106106
* The desired number of instantiations of the task definition to keep running on the service.
107107
*
108-
* @default 1
108+
* @default - When creating the service, default is 1; when updating the service, default uses
109+
* the current task number.
109110
*/
110111
readonly desiredCount?: number;
111112

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ export class Ec2Service extends BaseService implements IEc2Service {
186186

187187
super(scope, id, {
188188
...props,
189-
// If daemon, desiredCount must be undefined and that's what we want. Otherwise, default to 1.
190-
desiredCount: props.daemon || props.desiredCount !== undefined ? props.desiredCount : 1,
189+
desiredCount: props.desiredCount,
191190
maxHealthyPercent: props.daemon && props.maxHealthyPercent === undefined ? 100 : props.maxHealthyPercent,
192191
minHealthyPercent: props.daemon && props.minHealthyPercent === undefined ? 0 : props.minHealthyPercent,
193192
launchType: LaunchType.EC2,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class FargateService extends BaseService implements IFargateService {
152152

153153
super(scope, id, {
154154
...props,
155-
desiredCount: props.desiredCount !== undefined ? props.desiredCount : 1,
155+
desiredCount: props.desiredCount,
156156
launchType: LaunchType.FARGATE,
157157
propagateTags: propagateTagsFromSource,
158158
enableECSManagedTags: props.enableECSManagedTags,

packages/@aws-cdk/aws-ecs/test/ec2/integ.app-mesh-proxy-config.expected.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@
867867
},
868868
{
869869
"Essential": true,
870-
"Image": "envoyproxy/envoy",
870+
"Image": "envoyproxy/envoy:v1.16.2",
871871
"Memory": 256,
872872
"Name": "envoy"
873873
}
@@ -923,7 +923,6 @@
923923
"MaximumPercent": 200,
924924
"MinimumHealthyPercent": 50
925925
},
926-
"DesiredCount": 1,
927926
"EnableECSManagedTags": false,
928927
"LaunchType": "EC2",
929928
"NetworkConfiguration": {

packages/@aws-cdk/aws-ecs/test/ec2/integ.app-mesh-proxy-config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ taskDefinition.addContainer('web', {
3636
});
3737

3838
taskDefinition.addContainer('envoy', {
39-
image: ecs.ContainerImage.fromRegistry('envoyproxy/envoy'),
39+
// envoyproxy/envoy:latest tag gone from docker hub: https://github.com/envoyproxy/envoy/issues/6344
40+
image: ecs.ContainerImage.fromRegistry('envoyproxy/envoy:v1.16.2'),
4041
memoryLimitMiB: 256,
4142
});
4243

packages/@aws-cdk/aws-ecs/test/ec2/integ.clb-host-nw.expected.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,6 @@
918918
"MaximumPercent": 200,
919919
"MinimumHealthyPercent": 50
920920
},
921-
"DesiredCount": 1,
922921
"EnableECSManagedTags": false,
923922
"HealthCheckGracePeriodSeconds": 60,
924923
"LaunchType": "EC2",

packages/@aws-cdk/aws-ecs/test/ec2/integ.environment-file.expected.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@
12851285
"MaximumPercent": 200,
12861286
"MinimumHealthyPercent": 50
12871287
},
1288-
"DesiredCount": 1,
12891288
"EnableECSManagedTags": false,
12901289
"LaunchType": "EC2",
12911290
"NetworkConfiguration": {

packages/@aws-cdk/aws-ecs/test/ec2/integ.firelens-s3-config.expected.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,6 @@
11331133
"MaximumPercent": 200,
11341134
"MinimumHealthyPercent": 50
11351135
},
1136-
"DesiredCount": 1,
11371136
"EnableECSManagedTags": false,
11381137
"LaunchType": "EC2",
11391138
"NetworkConfiguration": {

0 commit comments

Comments
 (0)