aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.49 kB
JavaScript
;var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.NonIpInstance=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),instance_1=require("./instance"),utils_1=require("./private/utils"),service_1=require("./service"),servicediscovery_generated_1=require("./servicediscovery.generated");class NonIpInstance extends instance_1.InstanceBase{constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_NonIpInstanceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,NonIpInstance),error}if((props.service.discoveryType||utils_1.defaultDiscoveryType(props.service.namespace))!==service_1.DiscoveryType.API)throw new Error("This type of instance can only be registered for HTTP namespaces.");if(props.customAttributes===void 0||Object.keys(props.customAttributes).length===0)throw new Error("You must specify at least one custom attribute for this instance type.");const resource=new servicediscovery_generated_1.CfnInstance(this,"Resource",{instanceId:props.instanceId||this.uniqueInstanceId(),serviceId:props.service.serviceId,instanceAttributes:{...props.customAttributes}});this.service=props.service,this.instanceId=resource.ref}}exports.NonIpInstance=NonIpInstance,_a=JSII_RTTI_SYMBOL_1,NonIpInstance[_a]={fqn:"aws-cdk-lib.aws_servicediscovery.NonIpInstance",version:"2.70.0"};