Skip to content

Commit

Permalink
fix(ecs): Allow scheduling DAEMON services even if no EC2 capacity at…
Browse files Browse the repository at this point in the history
…tached to cluster (#25306)

It can be useful to allow DAEMON services to be scheduled to a cluster
even if there is no EC2 capacity attached to it yet, under the
assumption that capacity will be attached to the cluster later. We no
longer fail validation if this happens.
  • Loading branch information
otterley committed Apr 27, 2023
1 parent f44946b commit 0422c11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Ec2Service extends BaseService implements IEc2Service {
*/
private validateEc2Service(): string[] {
const ret = new Array<string>();
if (!this.cluster.hasEc2Capacity) {
if (!this.daemon && !this.cluster.hasEc2Capacity) {
ret.push('Cluster for this service needs Ec2 capacity. Call addXxxCapacity() on the cluster.');
}
return ret;
Expand Down

0 comments on commit 0422c11

Please sign in to comment.