Skip to content

Commit

Permalink
add feedback from go-to-k
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Nov 30, 2023
1 parent 29e5887 commit 00dfae2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/aws-cdk-lib/aws-ecs/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as kms from '../../aws-kms';
import * as logs from '../../aws-logs';
import * as s3 from '../../aws-s3';
import * as cloudmap from '../../aws-servicediscovery';
import { Duration, IResource, Resource, Stack, Aspects, ArnFormat, IAspect } from '../../core';
import { Duration, IResource, Resource, Stack, Aspects, ArnFormat, IAspect, Token } from '../../core';

const CLUSTER_SYMBOL = Symbol.for('@aws-cdk/aws-ecs/lib/cluster.Cluster');

Expand Down Expand Up @@ -1192,6 +1192,8 @@ export interface AsgCapacityProviderProps extends AddAutoScalingGroupCapacityOpt
* The period of time, in seconds, after a newly launched Amazon EC2 instance
* can contribute to CloudWatch metrics for Auto Scaling group.
*
* Must be between 0 and 10000.
*
* @default 300
*/
readonly instanceWarmupPeriod?: number;
Expand Down Expand Up @@ -1253,7 +1255,7 @@ export class AsgCapacityProvider extends Construct {
}
}

if (props.instanceWarmupPeriod) {
if (props.instanceWarmupPeriod && !Token.isUnresolved(props.instanceWarmupPeriod)) {
if (props.instanceWarmupPeriod < 0 || props.instanceWarmupPeriod > 10000) {
throw new Error(`InstanceWarmupPeriod must be between 0 and 10000 inclusive, got: ${props.instanceWarmupPeriod}.`);
}
Expand Down

0 comments on commit 00dfae2

Please sign in to comment.