@gradientedge/cdk-utils 4.6.5 → 4.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -515,23 +515,22 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
515
515
  * @protected
516
516
  */
517
517
  createApiBasePathMapping() {
518
- const apiRootPaths = this.props.apiRootPaths;
519
- if (apiRootPaths && apiRootPaths.length > 0) {
520
- apiRootPaths.forEach((apiRootPath) => {
521
- this.apiDestinedBasePathMappings.push(new apig.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
522
- basePath: this.props.api.resource,
523
- domainName: this.apiDestinedRestApi.domain,
524
- restApi: this.apiDestinedRestApi.api,
525
- stage: this.apiDestinedRestApi.api.deploymentStage,
526
- }));
527
- });
528
- }
518
+ if (this.props.api.useExisting)
519
+ return;
520
+ new apig.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
521
+ basePath: '',
522
+ domainName: this.apiDestinedRestApi.domain,
523
+ restApi: this.apiDestinedRestApi.api,
524
+ stage: this.apiDestinedRestApi.api.deploymentStage,
525
+ });
529
526
  }
530
527
  /**
531
528
  * @summary Method to create route53 records for Api API
532
529
  * @protected
533
530
  */
534
531
  createApiRouteAssets() {
532
+ if (this.props.api.useExisting)
533
+ return;
535
534
  this.route53Manager.createApiGatewayARecord(`${this.id}-custom-domain-a-record`, this, this.props.apiSubDomain, this.apiDestinedRestApi.domain, this.apiDestinedRestApi.hostedZone);
536
535
  }
537
536
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "4.6.5",
3
+ "version": "4.6.6",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -591,19 +591,13 @@ export class ApiToEventBridgeTarget extends CommonConstruct {
591
591
  * @protected
592
592
  */
593
593
  protected createApiBasePathMapping() {
594
- const apiRootPaths = this.props.apiRootPaths
595
- if (apiRootPaths && apiRootPaths.length > 0) {
596
- apiRootPaths.forEach((apiRootPath: string) => {
597
- this.apiDestinedBasePathMappings.push(
598
- new apig.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
599
- basePath: this.props.api.resource,
600
- domainName: this.apiDestinedRestApi.domain,
601
- restApi: this.apiDestinedRestApi.api,
602
- stage: this.apiDestinedRestApi.api.deploymentStage,
603
- })
604
- )
605
- })
606
- }
594
+ if (this.props.api.useExisting) return
595
+ new apig.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
596
+ basePath: '',
597
+ domainName: this.apiDestinedRestApi.domain,
598
+ restApi: this.apiDestinedRestApi.api,
599
+ stage: this.apiDestinedRestApi.api.deploymentStage,
600
+ })
607
601
  }
608
602
 
609
603
  /**
@@ -611,6 +605,7 @@ export class ApiToEventBridgeTarget extends CommonConstruct {
611
605
  * @protected
612
606
  */
613
607
  protected createApiRouteAssets() {
608
+ if (this.props.api.useExisting) return
614
609
  this.route53Manager.createApiGatewayARecord(
615
610
  `${this.id}-custom-domain-a-record`,
616
611
  this,