From 6a7b0448be17008f68e3e50599bdb7e7d0af0121 Mon Sep 17 00:00:00 2001 From: kazuho cryer-shinozuka Date: Tue, 23 Jan 2024 13:33:40 +0900 Subject: [PATCH] =?UTF-8?q?record-set.ts=20=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aayush thapa <84202325+aaythapa@users.noreply.github.com> --- packages/aws-cdk-lib/aws-route53/lib/record-set.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/aws-route53/lib/record-set.ts b/packages/aws-cdk-lib/aws-route53/lib/record-set.ts index b05d4a0ff28b7..8564aedae843a 100644 --- a/packages/aws-cdk-lib/aws-route53/lib/record-set.ts +++ b/packages/aws-cdk-lib/aws-route53/lib/record-set.ts @@ -298,10 +298,7 @@ export class RecordSet extends Resource implements IRecordSet { throw new Error('setIdentifier can only be specified for non-simple routing policies'); } - let nonSimpleRoutingPolicies = 0; - if (props.geoLocation) nonSimpleRoutingPolicies++; - if (props.region) nonSimpleRoutingPolicies++; - if (props.weight) nonSimpleRoutingPolicies++; + let nonSimpleRoutingPolicies = [props.geoLocation, props.region, props.weight].filter((variable) => variable !== undefined).length; if (nonSimpleRoutingPolicies > 1) { throw new Error('Only one of region, weight, or geoLocation can be defined'); }