Skip to content

Commit

Permalink
fix: duration renders incorrectly in multi alb service base
Browse files Browse the repository at this point in the history
  • Loading branch information
markanderstam authored Oct 24, 2023
1 parent 7121c7e commit fae21ec
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export interface ApplicationLoadBalancerProps {
readonly domainZone?: IHostedZone;

/**
* The load balancer idle timeout, in seconds
* The load balancer idle timeout, in seconds. Can be between 1 and 4000 seconds.
*
* @default - CloudFormation sets idle timeout to 60 seconds
*/
Expand Down Expand Up @@ -585,7 +585,8 @@ export abstract class ApplicationMultipleTargetGroupsServiceBase extends Constru
private validateLbProps(props: ApplicationLoadBalancerProps[]) {
for (let prop of props) {
if (prop.idleTimeout) {
if (prop.idleTimeout > Duration.seconds(4000) || prop.idleTimeout < Duration.seconds(1)) {
const idleTimeout = props.idleTimeout.toSeconds();
if (idleTimeout > Duration.seconds(4000).toSeconds() || idleTimeout < Duration.seconds(1).toSeconds()) {
throw new Error('Load balancer idle timeout must be between 1 and 4000 seconds.');
}
}
Expand Down

0 comments on commit fae21ec

Please sign in to comment.