aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 2.33 kB
JavaScript
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},errors_1=()=>{var tmp=require("../../core/lib/errors");return errors_1=()=>tmp,tmp},region_info_1=()=>{var tmp=require("../../region-info");return region_info_1=()=>tmp,tmp};class ElasticBeanstalkEnvironmentEndpointTarget{constructor(environmentEndpoint,props){this.environmentEndpoint=environmentEndpoint,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_route53_targets_IAliasRecordTargetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ElasticBeanstalkEnvironmentEndpointTarget),error}}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(errors_1()).ValidationError("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",record);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(errors_1()).ValidationError(`Elastic Beanstalk environment target is not supported for the "${region}" region.`,record);return{hostedZoneId,dnsName,evaluateTargetHealth:this.props?.evaluateTargetHealth}}}exports.ElasticBeanstalkEnvironmentEndpointTarget=ElasticBeanstalkEnvironmentEndpointTarget,_a=JSII_RTTI_SYMBOL_1,ElasticBeanstalkEnvironmentEndpointTarget[_a]={fqn:"aws-cdk-lib.aws_route53_targets.ElasticBeanstalkEnvironmentEndpointTarget",version:"2.185.0"};
;