"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.PrivateDnsNamespace=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),namespace_1=require("./namespace"),service_1=require("./service"),servicediscovery_generated_1=require("./servicediscovery.generated"),core_1=require("../../core");class PrivateDnsNamespace extends core_1.Resource{static fromPrivateDnsNamespaceAttributes(scope,id,attrs){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_PrivateDnsNamespaceAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromPrivateDnsNamespaceAttributes),error}class Import extends core_1.Resource{constructor(){super(...arguments),this.namespaceName=attrs.namespaceName,this.namespaceId=attrs.namespaceId,this.namespaceArn=attrs.namespaceArn,this.type=namespace_1.NamespaceType.DNS_PRIVATE}}return new Import(scope,id)}constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_PrivateDnsNamespaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,PrivateDnsNamespace),error}if(props.vpc===void 0)throw new Error("VPC must be specified for PrivateDNSNamespaces");const ns=new servicediscovery_generated_1.CfnPrivateDnsNamespace(this,"Resource",{name:props.name,description:props.description,vpc:props.vpc.vpcId});this.namespaceName=props.name,this.namespaceId=ns.attrId,this.namespaceArn=ns.attrArn,this.namespaceHostedZoneId=ns.attrHostedZoneId,this.type=namespace_1.NamespaceType.DNS_PRIVATE}get privateDnsNamespaceArn(){return this.namespaceArn}get privateDnsNamespaceName(){return this.namespaceName}get privateDnsNamespaceId(){return this.namespaceId}createService(id,props){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_DnsServiceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.createService),error}return new service_1.Service(this,id,{namespace:this,...props})}}exports.PrivateDnsNamespace=PrivateDnsNamespace,_a=JSII_RTTI_SYMBOL_1,PrivateDnsNamespace[_a]={fqn:"aws-cdk-lib.aws_servicediscovery.PrivateDnsNamespace",version:"2.96.1"};
