UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 1.86 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ElasticBeanstalkEnvironmentEndpointTarget=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},region_info_1=()=>{var tmp=require("../../region-info");return region_info_1=()=>tmp,tmp};class ElasticBeanstalkEnvironmentEndpointTarget{constructor(environmentEndpoint){this.environmentEndpoint=environmentEndpoint}bind(_record,_zone){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_route53_IRecordSet(_record),jsiiDeprecationWarnings().aws_cdk_lib_aws_route53_IHostedZone(_zone)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}if(cdk().Token.isUnresolved(this.environmentEndpoint))throw new Error("Cannot use an EBS alias as `environmentEndpoint`. You must find your EBS environment endpoint via the AWS console. See the Elastic Beanstalk developer guide: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html");const dnsName=this.environmentEndpoint,subDomains=cdk().Fn.split(".",dnsName),regionSubdomainIndex=subDomains.length-3,region=cdk().Fn.select(regionSubdomainIndex,subDomains),{ebsEnvEndpointHostedZoneId:hostedZoneId}=region_info_1().RegionInfo.get(region);if(!hostedZoneId||!dnsName)throw new Error(`Elastic Beanstalk environment target is not supported for the "${region}" region.`);return{hostedZoneId,dnsName}}}exports.ElasticBeanstalkEnvironmentEndpointTarget=ElasticBeanstalkEnvironmentEndpointTarget,_a=JSII_RTTI_SYMBOL_1,ElasticBeanstalkEnvironmentEndpointTarget[_a]={fqn:"aws-cdk-lib.aws_route53_targets.ElasticBeanstalkEnvironmentEndpointTarget",version:"2.170.0"};