UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 2.41 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},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}this.hostedZoneId=props?.hostedZoneId}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(!this.hostedZoneId){let{region}=cdk().Stack.of(record);if(!cdk().Token.isUnresolved(this.environmentEndpoint)){const subDomains=cdk().Fn.split(".",this.environmentEndpoint),regionSubdomainIndex=subDomains.length-3;region=cdk().Fn.select(regionSubdomainIndex,subDomains)}this.hostedZoneId=region_info_1().RegionInfo.get(region).ebsEnvEndpointHostedZoneId}if(!this.hostedZoneId)throw new(errors_1()).ValidationError("Cannot find Beanstalk `hostedZoneId`. You must specify either `hostedZoneId` using `RegionInfo.get(yourRegion).ebsEnvEndpointHostedZoneId` or Stack region or find correct EBS environment endpoint via AWS console. See Elastic Beanstalk developer guide: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html",record);return{hostedZoneId:this.hostedZoneId,dnsName:this.environmentEndpoint,evaluateTargetHealth:this.props?.evaluateTargetHealth}}}exports.ElasticBeanstalkEnvironmentEndpointTarget=ElasticBeanstalkEnvironmentEndpointTarget,_a=JSII_RTTI_SYMBOL_1,ElasticBeanstalkEnvironmentEndpointTarget[_a]={fqn:"aws-cdk-lib.aws_route53_targets.ElasticBeanstalkEnvironmentEndpointTarget",version:"2.211.0"};