cdktn-cli 0.24.0-pre.85 → 0.24.0-pre.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/bin/cdktn.js
CHANGED
|
@@ -66,11 +66,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
66
66
|
${i.join(`
|
|
67
67
|
`)}`);let o={...r.context,...r.targetVersions?{[lZ.TARGET_VERSIONS_CONTEXT_KEY]:r.targetVersions}:{}};return Object.keys(o).length>0&&(EWe.env[HWe]=JSON.stringify(o)),r};ae.parseConfig=YWe;function TWe(e=LO.join(process.cwd(),kO)){let t;return FO.existsSync(e)&&(t=FO.readFileSync(e).toString()),(0,ae.parseConfig)(t)}ae.readConfigSync=TWe;function FWe(e){return Pp(e.terraformModules)||Pp(e.terraformProviders)}ae.shouldCheckCodeMakerOutput=FWe;function XWe(e){XO.logger.debug(`Start timer for ${e}...`);let t=Date.now();return function(){let i=Date.now()-t;XO.logger.debug(`${e} took ${i}ms`)}}ae.logTimespan=XWe});var xO=g((gFe,UO)=>{"use strict";UO.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var JO=g((fFe,OO)=>{"use strict";var LWe=xO();OO.exports=e=>typeof e=="string"?e.replace(LWe(),""):e});var $s=g(ue=>{"use strict";var kWe=ue&&ue.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),KWe=ue&&ue.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),tm=ue&&ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&kWe(t,e,n);return KWe(t,e),t},UWe=ue&&ue.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ue,"__esModule",{value:!0});ue.hasNoColorFlagOrEnv=ue.ensureAllSettledBeforeThrowing=ue.downloadFile=ue.HttpError=ue.downcaseFirst=ue.readCDKTFManifest=ue.readCDKTFVersion=ue.exec=ue.mkdtemp=ue.withTempDir=ue.shell=void 0;var xWe=N9(),Yn=tm(Fn()),MO=T9(),DO=tm(require("os")),Zd=tm(require("path")),$p=Ho(),OWe=require("cdktn"),JWe=tm(Qp()),vd=UWe(JO());function MWe(e,t,n){e.stderr=t,e.stdout=n;let r=[t,n].filter(Boolean).join(`
|
|
68
68
|
`);if(r){let i=e.message;e.toString=()=>`Error: ${i}
|
|
69
|
-
${r}`}}async function DWe(e,t=[],n={}){return(0,ue.exec)(e,t,n,r=>{let i=n.noColor?(0,vd.default)(r.toLocaleString()):r.toLocaleString();console.log(i)},()=>{})}ue.shell=DWe;async function qWe(e,t){let n=process.cwd(),r=await Yn.mkdtemp(Zd.join(DO.tmpdir(),"cdktf.")),i=Zd.join(r,e);await Yn.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(n),await Yn.remove(r)}}ue.withTempDir=qWe;async function PWe(e){let t=await Yn.mkdtemp(Zd.join(DO.tmpdir(),"cdktf."));try{await e(t)}finally{await Yn.remove(t)}}ue.mkdtemp=PWe;var zWe=async(e,t,n,r,i,o=!0)=>{typeof n.noColor!="boolean"&&qO()&&(n.noColor=!0);let{signal:s,...a}=n;return new Promise((c,u)=>{var l,d,f,I;let m=(0,xWe.spawn)(e,t,a),C=new Array,y=new Array;r!==void 0?(l=m.stdout)===null||l===void 0||l.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerDebug)(_),C.push(_),r(_)}):(d=m.stdout)===null||d===void 0||d.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerDebug)(_),C.push(_)}),i!==void 0?(f=m.stderr)===null||f===void 0||f.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerError)(_),o&&i(_),y.push(_)}):(I=m.stderr)===null||I===void 0||I.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerError)(_),o&&process.stderr.write(_),y.push(_)}),m.once("error",B=>u(B)),m.once("close",B=>{if(B!==0){let _=new Error(`${e} ${t.join(" ")} exited with code ${B}`);return MWe(_,y.join(""),C.join("")),u(_)}return c(C.join(""))})})};ue.exec=zWe;async function jWe(e){let t=Zd.join(e,"cdk.tf.json");if(Yn.existsSync(t)){let n=Yn.readFileSync(t,"utf8");return JSON.parse(n)["//"].metadata.version}return""}ue.readCDKTFVersion=jWe;async function QWe(){let{output:e}=JWe.readConfigSync(),t=await Yn.readFile(Zd.join(e,OWe.Manifest.fileName));return JSON.parse(t.toString())}ue.readCDKTFManifest=QWe;function $We(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}ue.downcaseFirst=$We;var em=class extends Error{constructor(t,n){super(t),this.statusCode=n,Object.setPrototypeOf(this,new.target.prototype)}};ue.HttpError=em;async function e2e(e,t){let n=e.startsWith("http://")?MO.http:MO.https,r=Yn.createWriteStream(t);return new Promise((i,o)=>{let s=n.get(e,a=>{if(a.statusCode!==200){o(new em(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(r)});r.on("finish",()=>i()),s.on("error",a=>{Yn.unlink(t,()=>o(a))}),r.on("error",a=>{Yn.unlink(t,()=>o(a))}),s.end()})}ue.downloadFile=e2e;async function t2e(e,t){try{await e}catch(n){throw await Promise.allSettled(t),n}}ue.ensureAllSettledBeforeThrowing=t2e;function qO(){return n2e("no-color")||process.env.FORCE_COLOR==="0"}ue.hasNoColorFlagOrEnv=qO;function n2e(e){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=process.argv.indexOf(t+e),r=process.argv.indexOf("--");return n!==-1&&(r===-1||n<r)}});var Ho=g(pt=>{"use strict";var r2e=pt&&pt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i2e=pt&&pt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),gZ=pt&&pt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&r2e(t,e,n);return i2e(t,e),t};Object.defineProperty(pt,"__esModule",{value:!0});pt.logFileName=pt.processLoggerError=pt.processLoggerDebug=pt.logger=void 0;var dZ=K1(),PO=gZ(Fn()),o2e=gZ(require("path")),ea=gZ(HI()),s2e=$s(),kr=(0,dZ.getLogger)(),fZ={trace(e,...t){kr.trace(e,...t),ea.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){kr.debug(e,...t),ea.addBreadcrumb({message:e,level:"debug"})},info(e,...t){kr.info(e,...t),ea.addBreadcrumb({message:e,level:"info"})},warn(e,...t){kr.warn(e,...t),ea.addBreadcrumb({message:e,level:"warning"})},error(e,...t){kr.error(e,...t),ea.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){kr.fatal(e,...t),ea.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){kr.level=e},useDefaultLevel(){kr.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};pt.logger=fZ;kr.level=process.env.CDKTF_LOG_LEVEL||"INFO";var zO="cdktf.log";pt.logFileName=zO;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&PO.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&PO.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,dZ.configure)({appenders:{cdktf:{type:"file",filename:o2e.join(process.env.CDKTF_LOG_FILE_DIRECTORY,zO)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,s2e.hasNoColorFlagOrEnv)()?"basic":"colored";(0,dZ.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var a2e=e=>{fZ.debug(e.toString())};pt.processLoggerDebug=a2e;var c2e=e=>{fZ.error(e.toString())};pt.processLoggerError=c2e});var jO=g((mFe,u2e)=>{u2e.exports={name:"@cdktn/commons",version:"0.24.0-pre.
|
|
69
|
+
${r}`}}async function DWe(e,t=[],n={}){return(0,ue.exec)(e,t,n,r=>{let i=n.noColor?(0,vd.default)(r.toLocaleString()):r.toLocaleString();console.log(i)},()=>{})}ue.shell=DWe;async function qWe(e,t){let n=process.cwd(),r=await Yn.mkdtemp(Zd.join(DO.tmpdir(),"cdktf.")),i=Zd.join(r,e);await Yn.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(n),await Yn.remove(r)}}ue.withTempDir=qWe;async function PWe(e){let t=await Yn.mkdtemp(Zd.join(DO.tmpdir(),"cdktf."));try{await e(t)}finally{await Yn.remove(t)}}ue.mkdtemp=PWe;var zWe=async(e,t,n,r,i,o=!0)=>{typeof n.noColor!="boolean"&&qO()&&(n.noColor=!0);let{signal:s,...a}=n;return new Promise((c,u)=>{var l,d,f,I;let m=(0,xWe.spawn)(e,t,a),C=new Array,y=new Array;r!==void 0?(l=m.stdout)===null||l===void 0||l.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerDebug)(_),C.push(_),r(_)}):(d=m.stdout)===null||d===void 0||d.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerDebug)(_),C.push(_)}),i!==void 0?(f=m.stderr)===null||f===void 0||f.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerError)(_),o&&i(_),y.push(_)}):(I=m.stderr)===null||I===void 0||I.on("data",B=>{let _=n.noColor?(0,vd.default)(B.toLocaleString()):B.toLocaleString();(0,$p.processLoggerError)(_),o&&process.stderr.write(_),y.push(_)}),m.once("error",B=>u(B)),m.once("close",B=>{if(B!==0){let _=new Error(`${e} ${t.join(" ")} exited with code ${B}`);return MWe(_,y.join(""),C.join("")),u(_)}return c(C.join(""))})})};ue.exec=zWe;async function jWe(e){let t=Zd.join(e,"cdk.tf.json");if(Yn.existsSync(t)){let n=Yn.readFileSync(t,"utf8");return JSON.parse(n)["//"].metadata.version}return""}ue.readCDKTFVersion=jWe;async function QWe(){let{output:e}=JWe.readConfigSync(),t=await Yn.readFile(Zd.join(e,OWe.Manifest.fileName));return JSON.parse(t.toString())}ue.readCDKTFManifest=QWe;function $We(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}ue.downcaseFirst=$We;var em=class extends Error{constructor(t,n){super(t),this.statusCode=n,Object.setPrototypeOf(this,new.target.prototype)}};ue.HttpError=em;async function e2e(e,t){let n=e.startsWith("http://")?MO.http:MO.https,r=Yn.createWriteStream(t);return new Promise((i,o)=>{let s=n.get(e,a=>{if(a.statusCode!==200){o(new em(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(r)});r.on("finish",()=>i()),s.on("error",a=>{Yn.unlink(t,()=>o(a))}),r.on("error",a=>{Yn.unlink(t,()=>o(a))}),s.end()})}ue.downloadFile=e2e;async function t2e(e,t){try{await e}catch(n){throw await Promise.allSettled(t),n}}ue.ensureAllSettledBeforeThrowing=t2e;function qO(){return n2e("no-color")||process.env.FORCE_COLOR==="0"}ue.hasNoColorFlagOrEnv=qO;function n2e(e){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=process.argv.indexOf(t+e),r=process.argv.indexOf("--");return n!==-1&&(r===-1||n<r)}});var Ho=g(pt=>{"use strict";var r2e=pt&&pt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i2e=pt&&pt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),gZ=pt&&pt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&r2e(t,e,n);return i2e(t,e),t};Object.defineProperty(pt,"__esModule",{value:!0});pt.logFileName=pt.processLoggerError=pt.processLoggerDebug=pt.logger=void 0;var dZ=K1(),PO=gZ(Fn()),o2e=gZ(require("path")),ea=gZ(HI()),s2e=$s(),kr=(0,dZ.getLogger)(),fZ={trace(e,...t){kr.trace(e,...t),ea.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){kr.debug(e,...t),ea.addBreadcrumb({message:e,level:"debug"})},info(e,...t){kr.info(e,...t),ea.addBreadcrumb({message:e,level:"info"})},warn(e,...t){kr.warn(e,...t),ea.addBreadcrumb({message:e,level:"warning"})},error(e,...t){kr.error(e,...t),ea.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){kr.fatal(e,...t),ea.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){kr.level=e},useDefaultLevel(){kr.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};pt.logger=fZ;kr.level=process.env.CDKTF_LOG_LEVEL||"INFO";var zO="cdktf.log";pt.logFileName=zO;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&PO.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&PO.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,dZ.configure)({appenders:{cdktf:{type:"file",filename:o2e.join(process.env.CDKTF_LOG_FILE_DIRECTORY,zO)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,s2e.hasNoColorFlagOrEnv)()?"basic":"colored";(0,dZ.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var a2e=e=>{fZ.debug(e.toString())};pt.processLoggerDebug=a2e;var c2e=e=>{fZ.error(e.toString())};pt.processLoggerError=c2e});var jO=g((mFe,u2e)=>{u2e.exports={name:"@cdktn/commons",version:"0.24.0-pre.87",publishConfig:{access:"public"},description:"CDK Terrain Common utilities",scripts:{build:"tsc",watch:"tsc -w","watch-preserve-output":"tsc -w --preserveWatchOutput","test:update":"jest -u",package:"./package.sh","dist-clean":"rm -rf dist","package:js":"./package.sh"},main:"build/index.js",types:"build/index.d.ts",nx:{tags:["unit-test"]},repository:{type:"git",url:"git://github.com/open-constructs/cdk-terrain.git",directory:"packages/@cdktn/commons"},author:{name:"OpenConstructs",url:"https://github.com/open-constructs"},keywords:["cdk","cdktf","cdktn","terraform"],license:"MPL-2.0",dependencies:{"@sentry/node":"7.120.4",cdktn:"workspace:*","ci-info":"4.4.0",codemaker:"1.128.0","cross-spawn":"7.0.6","follow-redirects":"1.15.11","fs-extra":"11.3.6",log4js:"6.9.1",semver:"7.7.4","strip-ansi":"6.0.1",validator:"13.15.35"},devDependencies:{"@types/cross-spawn":"6.0.6","@types/follow-redirects":"1.14.4","@types/fs-extra":"11.0.4","@types/semver":"7.7.1","@types/validator":"13.15.10","tsc-files":"1.1.4",typescript:"^5.0.0"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var Sd=g(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.DISPLAY_VERSION=void 0;nm.DISPLAY_VERSION=`${l2e()}`;function l2e(){return jO().version.replace(/\+[0-9a-f]+$/,"")}});var pZ=g(et=>{"use strict";var d2e=et&&et.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),g2e=et&&et.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),om=et&&et.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&d2e(t,e,n);return g2e(t,e),t},f2e=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(et,"__esModule",{value:!0});et.ReportRequest=et.getUserId=et.getProjectId=et.sendTelemetry=void 0;var I2e=om(require("https")),p2e=require("url"),eJ=require("node:crypto"),im=om(require("os")),QO=f2e(GY()),IZ=Ho(),Rd=om(require("path")),rm=om(Fn()),m2e=Sd(),h2e="https://checkpoint-api.hashicorp.com/v1/",C2e=[200,201],$O=8192;function b2e(){var e;return process.env.CDKTF_HOME?Rd.resolve(process.env.CDKTF_HOME):Rd.join(((e=im.userInfo().homedir)!==null&&e!==void 0?e:im.homedir()).trim()||"/",".cdktf")}async function y2e(e,t){return new Promise((n,r)=>{let i=I2e.request((0,p2e.format)(e),{headers:{Accept:"application/json","Content-Length":t.length,"User-Agent":"OpenConstructs/cdktn-cli"},method:"POST"},o=>{if(o.statusCode){let a=o.statusCode;if(!C2e.includes(a))return r(new Error(o.statusMessage))}let s=new Array;o.on("data",a=>s.push(a)),o.on("error",a=>r(a)),o.on("end",()=>n())});i.setTimeout(1e3,()=>r(new Error("request timeout"))),i.write(t),i.end(),i.on("error",o=>r(o))})}async function A2e(e,t){let n={command:e,product:"cdktn",version:`${m2e.DISPLAY_VERSION}`,dateTime:new Date,language:t.language,payload:t};try{await iJ(n)}catch(r){IZ.logger.error(`Could not send telemetry data: ${r}`)}}et.sendTelemetry=A2e;function tJ(e,t,n=!1,r){let i=(0,eJ.randomUUID)(),o;try{o=JSON.parse(rm.readFileSync(e,"utf-8"))}catch{if(n){let a={};r&&(a["//"]=r.replace(/\n/g," ")),a[t]=i,rm.ensureDirSync(Rd.dirname(e)),rm.writeFileSync(e,JSON.stringify(a,null,2))}return i}return o[t]?o[t]:(rm.writeFileSync(e,JSON.stringify({...o,[t]:i},null,2)),i)}function nJ(e=process.cwd()){return tJ(Rd.resolve(e,"cdktf.json"),"projectId")}et.getProjectId=nJ;function rJ(){return tJ(Rd.resolve(b2e(),"config.json"),"userId",!0,`This signature is a randomly generated UUID used to anonymously differentiate users in telemetry data order to inform product direction.
|
|
70
70
|
This signature is random, it is not based on any personally identifiable information.
|
|
71
71
|
To create a new signature, you can simply delete this file at any time.
|
|
72
72
|
See https://cdktn.io/docs/telemetry for more
|
|
73
|
-
information on how to disable it.`)}et.getUserId=rJ;async function iJ(e){if(process.env.CHECKPOINT_DISABLE)return;e.runID||(e.runID=(0,eJ.randomUUID)()),e.dateTime||(e.dateTime=new Date),e.arch||(e.arch=im.arch()),e.os||(e.os=im.platform());let t=QO.default.isCI?QO.default.name||"unknown":!1;!e.userId&&!t&&(e.userId=rJ()),t&&(e.ci=t),e.projectId=e.projectId||nJ();let n=JSON.stringify(e);if(n.length>$O){IZ.logger.warn(`Skipped sending telemetry as the request body size was ${n.length} bytes. The limit is ${$O} bytes`);return}try{await y2e(`${h2e}telemetry/${e.product}`,n)}catch(r){(0,IZ.processLoggerError)(r.message)}}et.ReportRequest=iJ});var oJ=g(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.ConstructsMakerProviderTarget=_i.ConstructsMakerModuleTarget=_i.ConstructsMakerTarget=void 0;var gr=Qp(),Wd=class{constructor(t,n){this.constraint=t,this.targetLanguage=n,this.constraint instanceof gr.TerraformModuleConstraint?this.fileName=`${this.typesPath(this.constraint.fileName)}.ts`:this.fileName=`${this.typesPath(this.constraint.name)}.ts`}static from(t,n){return t instanceof gr.TerraformModuleConstraint?new sm(t,n):new am(t,n)}get version(){return this.constraint.version}get source(){return this.constraint.source}get name(){return this.constraint.name}get fqn(){return this.constraint.fqn}get namespace(){return this.constraint.namespace}get moduleKey(){return this.fqn.replace(/\//gi,"_")}};_i.ConstructsMakerTarget=Wd;var sm=class extends Wd{get isModule(){return!0}get isProvider(){return!1}get srcMakName(){switch(this.targetLanguage){case gr.Language.GO:return this.name.replace(/-/gi,"_");case gr.Language.JAVA:case gr.Language.CSHARP:case gr.Language.PYTHON:return this.simplifiedFqn;default:return this.simplifiedName}}get trackingPayload(){return{name:this.name,fullName:this.fqn,version:this.version,type:"module"}}typesPath(t){return`modules/${t}`}get simplifiedName(){var t,n;return(n=(t=this.namespace)===null||t===void 0?void 0:t.replace(/\//gi,".").replace(/-/gi,"_"))!==null&&n!==void 0?n:this.name}get simplifiedFqn(){return this.fqn.replace(/\//gi,".").replace(/-/gi,"_")}};_i.ConstructsMakerModuleTarget=sm;var am=class extends Wd{get isModule(){return!1}get isProvider(){return!0}get srcMakName(){switch(this.targetLanguage){case gr.Language.JAVA:return this.isNullProvider?"nullprovider":this.simplifiedName;case gr.Language.CSHARP:return this.isNullProvider?"Providers.Null":this.simplifiedName;case gr.Language.PYTHON:return this.simplifiedName;case gr.Language.GO:return this.name.replace(/-/gi,"_");default:return this.constraint.fqn}}get trackingPayload(){return{name:this.name,fullName:this.source,version:this.version,type:"provider"}}typesPath(t){return`providers/${t}/index`}get isNullProvider(){return this.constraint.name==="null"}get simplifiedName(){return this.name.replace(/\//gi,".").replace(/-/gi,"_")}};_i.ConstructsMakerProviderTarget=am});var hZ=g(yn=>{"use strict";var G2e=yn&&yn.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),B2e=yn&&yn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),v2e=yn&&yn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&G2e(t,e,n);return B2e(t,e),t};Object.defineProperty(yn,"__esModule",{value:!0});yn.Errors=yn.IsErrorType=void 0;var Z2e=pZ(),S2e=Sd(),R2e=v2e(HI());async function W2e(e,t){let n={command:e,product:"cdktn",version:`${S2e.DISPLAY_VERSION}`,dateTime:new Date,payload:t};await(0,Z2e.ReportRequest)(n)}function N2e(e,t){return e&&e.__type===t}yn.IsErrorType=N2e;function mZ(e,t){return(n,r=new Error,i)=>{W2e(t,{...i,message:n,type:e});let o=new Error(`${e} Error: ${n}`);return Object.entries(i||{}).forEach(([s,a])=>{o[s]=a}),o.__type=e,o.stack=r.stack,o}}var cm="unknown";yn.Errors={Internal:mZ("Internal",cm),Usage:mZ("Usage",cm),External:mZ("External",cm),setScope(e){cm=e,R2e.configureScope(t=>t.setTransactionName(e))}}});var CZ=g(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.terraformVersion=Kr.parseTerraformCliVersion=Kr.terraformBinaryName=void 0;var _2e=hZ(),E2e=$s();Kr.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";var V2e=require("cdktn/lib/validations");Object.defineProperty(Kr,"parseTerraformCliVersion",{enumerable:!0,get:function(){return V2e.parseTerraformCliVersion}});Kr.terraformVersion=(0,E2e.exec)(Kr.terraformBinaryName,["version","-json"],{}).then(e=>JSON.parse(e).terraform_version).catch(e=>_2e.Errors.Usage(`Unknown: Error loading terraform version ${e}`,e))});var bZ=g(Ot=>{"use strict";var sJ=Ot&&Ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.getGradlePackageVersionFromBuild=Ot.getGradlePackageVersion=Ot.getDependencyInformationFromLine=Ot.getGradleDependencies=Ot.isGradleProject=void 0;var aJ=sJ(require("path")),um=sJ(Fn()),Ei=Ho(),H2e=$s();function w2e(e){let t=aJ.default.join(e,"build.gradle");try{return um.default.accessSync(t,um.default.constants.R_OK|um.default.constants.W_OK),!0}catch{return Ei.logger.debug(`No build.gradle found at ${t}`),!1}}Ot.isGradleProject=w2e;async function cJ(){let e;try{e=await(0,H2e.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(I){Ei.logger.debug(`Unable to run 'gradle dependencies': ${I}`);return}let t=e.split(/\r\n|\r|\n/),n=t.findIndex(I=>I.includes("implementation - "));if(n===-1){Ei.logger.debug(`Unable to find implementation section in output of 'gradle dependencies': ${e}`);return}let r=/^\s*$/,i=t.slice(n+1),o=i.findIndex(I=>r.test(I)),s=i.slice(0,o),a=t.findIndex(I=>I.includes("api - "));if(a===-1){Ei.logger.debug(`Unable to find api section in output of 'gradle dependencies': ${e}`);return}let c=t.slice(a+1),u=c.findIndex(I=>r.test(I)),l=c.slice(0,u),d=/^\s*[+\\-]+\s*/,f=/\s+\([nc*]\)\s*$/;return[...s,...l].filter(I=>I!=="No dependencies").map(I=>I.replace(d,"").replace(f,""))}Ot.getGradleDependencies=cJ;function uJ(e){let t=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,n=e.match(t);if(!n){Ei.logger.debug("Unexpected format for gradle build. Please file an issue at https://github.com/open-constructs/cdk-terrain/issues/new?assignees=&labels=bug%2Cnew&template=bug-report.yml&title=");return}return n[3]===void 0?{group:"",name:n[1],version:n[2]}:{group:n[1],name:n[2],version:n[3]}}Ot.getDependencyInformationFromLine=uJ;async function Y2e(e){let n={jsii:"jsii-runtime"}[e]||e;Ei.logger.debug("Running 'gradle dependencies' to find package version",n);let r=await cJ();if(!r||r.length===0)return;for(let o of r)if(o.includes(`:${n}:`)){let s=uJ(o);return s?s.version:void 0}let i=await lJ(e);if(i)return i.version}Ot.getGradlePackageVersion=Y2e;async function lJ(e){let t=aJ.default.join(process.cwd(),"build.gradle"),r=(await um.default.readFile(t,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(r.findIndex(f=>i.test(f))===-1){Ei.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=r.findIndex(f=>f.includes(e));if(s===-1){Ei.logger.debug(`Unable to find package ${e} in output build.gradle`);return}let a=r[s],u=new RegExp(`([^:]+):${e}(?::([^\\s]+))?`,"i").exec(a);if(u)return{group:u[1],name:e,version:u[2]||""};let d=new RegExp(`java/(.*)/${e}/([^/]+)/.*\\.jar`,"i").exec(a);if(d)return{group:d[1].replace(/\//g,"."),name:e,version:d[2]}}Ot.getGradlePackageVersionFromBuild=lJ});var vJ=g(fe=>{"use strict";var T2e=fe&&fe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),F2e=fe&&fe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),gJ=fe&&fe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&T2e(t,e,n);return F2e(t,e),t};Object.defineProperty(fe,"__esModule",{value:!0});fe.collectDebugInformation=fe.getPackageVersion=fe.getNodeVersion=fe.getGoVersion=fe.getPipenvVersion=fe.getPipVersion=fe.getPythonVersion=fe.getGradleVersion=fe.getMavenVersion=fe.getJavaVersion=fe.getDotnetVersion=fe.getLanguage=void 0;var X2e=gJ(require("path")),yZ=gJ(require("os")),Me=Ho(),fr=$s(),L2e=CZ(),k2e=Sd(),fJ=Fn(),dJ=bZ();function IJ(e=process.cwd()){try{return JSON.parse((0,fJ.readFileSync)(X2e.resolve(e,"cdktf.json"),"utf-8")).language}catch{Me.logger.debug(`Unable to detect language in ${e}`);return}}fe.getLanguage=IJ;async function Ir(e,t){let n=()=>{};try{return(await(0,fr.exec)(e,[t],{env:process.env,stdio:[void 0,void 0,"ignore"]},n,n)).trim().replace(/\r?\n|\r/g,"")}catch(r){Me.logger.debug(`Failed to run ${e} ${t}: ${r}`);return}}function pJ(){return Ir("dotnet","--version")}fe.getDotnetVersion=pJ;function mJ(){return Ir("java","-version")}fe.getJavaVersion=mJ;function hJ(){return Ir("mvn","--version")}fe.getMavenVersion=hJ;function CJ(){return Ir("gradle","--version")}fe.getGradleVersion=CJ;async function bJ(){return await Ir("python3","--version")||await Ir("python","--version")}fe.getPythonVersion=bJ;function yJ(){return Ir("pip","--version")}fe.getPipVersion=yJ;function AJ(){return Ir("pipenv","--version")}fe.getPipenvVersion=AJ;function GJ(){return Ir("go","version")}fe.getGoVersion=GJ;function BJ(){return Ir("node","--version")}fe.getNodeVersion=BJ;async function K2e(e){return await(0,fJ.pathExists)("pnpm-lock.yaml")?U2e(e):x2e(e)}async function U2e(e){var t,n,r;let i;try{i=await(0,fr.exec)("pnpm",["list",e,"--json"],{env:{...process.env}})}catch(s){Me.logger.debug(`Unable to run 'pnpm list ${e} --json': ${s}`);return}let o;try{o=JSON.parse(i)}catch(s){Me.logger.debug(`Unable to parse output of 'pnpm list ${e} --json': ${s}`);return}if(!o||!Array.isArray(o)||o.length===0||!(!((r=(n=(t=o[0])===null||t===void 0?void 0:t.dependencies)===null||n===void 0?void 0:n[e])===null||r===void 0)&&r.version)){Me.logger.debug(`Unable to find '${e}' in 'pnpm list ${e} --json': ${i}`);return}return o[0].dependencies[e].version}async function x2e(e){let t;try{t=await(0,fr.exec)("npm",["list",e,"--json","--include=dev"],{env:{...process.env}})}catch(r){Me.logger.debug(`Unable to run 'npm list ${e} --json': ${r}`);return}let n;try{n=JSON.parse(t)}catch(r){Me.logger.debug(`Unable to parse output of 'npm list ${e} --json': ${r}`);return}if(!n.dependencies||!n.dependencies[e]||!n.dependencies[e].version){Me.logger.debug(`Unable to find '${e}' in 'npm list ${e} --json': ${t}`);return}return n.dependencies[e].version}async function O2e(e){let t;try{t=await(0,fr.exec)("pipenv",["run","pip","show","-qq",e],{env:process.env}),t=await(0,fr.exec)("pipenv",["run","pip","show",e],{env:process.env})}catch(i){Me.logger.debug(`Unable to run 'pipenv run pip show ${e}': ${i}`)}if(!t)try{t=await(0,fr.exec)("pip",["show","-qq",e],{env:process.env}),t=await(0,fr.exec)("pip",["show",e],{env:process.env})}catch(i){Me.logger.debug(`Unable to run 'pip show ${e}': ${i}`)}if(!t)return;let n=t.split(/\r\n|\r|\n/).find(i=>i.startsWith("Version:"));if(!n){Me.logger.debug(`Unable to find version in output of 'pipenv run pip show ${e}' / 'pip show ${e}': ${t}`);return}return n.split(":")[1].trim()}async function J2e(e){let n={jsii:"Amazon.JSII.Runtime",constructs:"Constructs",cdktf:"HashiCorp.Cdktf",cdktn:"Io.Cdktn"}[e]||e,r;try{r=await(0,fr.exec)("dotnet",["list","package","--include-transitive"],{env:process.env})}catch(o){Me.logger.debug(`Unable to run 'dotnet list package --include-transitive': ${o}`);return}let i=r.split(/\r\n|\r|\n/).find(o=>o.includes(`> ${n}`));if(!i){Me.logger.debug(`Unable to find version for '${n}' in output of 'dotnet list package --include-transitive': ${r}`);return}return i.split(" ").reverse().find(o=>o!=="")}async function M2e(e){var t;let r={jsii:"jsii-runtime-go",cdktf:"github.com/hashicorp/terraform-cdk-go",cdktn:"github.com/open-constructs/cdk-terrain-go"}[e]||e,i;try{i=await(0,fr.exec)("go",["list","-m","all"],{env:process.env})}catch(s){Me.logger.debug(`Unable to run 'go list -m all': ${s}`);return}let o=i.split(/\r\n|\r|\n/).find(s=>s.includes(r));if(!o){Me.logger.debug(`Unable to find version for '${r}' in output of 'go list -m all': ${i}`);return}return o.includes("=>")&&(Me.logger.debug(`Found local version for '${r}': ${o}`),o=o.split("=>")[0].trim()),(t=o.split(" ").pop())===null||t===void 0?void 0:t.replace("v","")}async function D2e(e){let n={jsii:"jsii-runtime"}[e]||e,r;try{r=await(0,fr.exec)("mvn",["dependency:list"],{env:process.env})}catch(l){Me.logger.debug(`Unable to run 'mvn dependency:list': ${l}`);return}let i=r.split("The following files have been resolved")[1];if(!i){Me.logger.debug(`Unable to find resolution passage in output of 'mvn dependency:list': ${r}`);return}let o=i.split(/\r\n|\r|\n/).find(l=>l.includes(`${n}:`));if(!o){Me.logger.debug(`Unable to find version for '${n}' in output of 'mvn dependency:list': ${r}`);return}let s=`${n}:jar:`,a=o.indexOf(s)+s.length,u=o.indexOf(":compile");return o.substring(a,u)}async function q2e(e){return(0,dJ.isGradleProject)("./")?(0,dJ.getGradlePackageVersion)(e):D2e(e)}async function Nd(e,t){let n=async()=>{},i=await({typescript:K2e,python:O2e,go:M2e,csharp:J2e,java:q2e}[e]||n)(t);return i??void 0}fe.getPackageVersion=Nd;async function P2e(){var e,t,n,r,i,o,s,a,c,u,l,d,f;let I={},m=IJ();I.language=m??null,I["cdktn-cli"]=k2e.DISPLAY_VERSION;let C=BJ();if(I.node=(e=await C)!==null&&e!==void 0?e:null,m){let y=Nd(m,"cdktn"),B=Nd(m,"cdktf"),_=Nd(m,"constructs"),Y=Nd(m,"jsii");I.cdktn=(t=await y)!==null&&t!==void 0?t:null,I.cdktf=(n=await B)!==null&&n!==void 0?n:null,I.constructs=(r=await _)!==null&&r!==void 0?r:null,I.jsii=(i=await Y)!==null&&i!==void 0?i:null}switch(I.terraform=await L2e.terraformVersion,I.arch=yZ.arch(),I.os=`${yZ.platform()} ${yZ.release()}`,m){case"python":{let y=bJ(),B=yJ(),_=AJ();I.python=(o=await y)!==null&&o!==void 0?o:null,I.pip=(s=await B)!==null&&s!==void 0?s:null,I.pipenv=(a=await _)!==null&&a!==void 0?a:null}break;case"java":{let y=mJ(),B=hJ(),_=CJ();I.java=(c=await y)!==null&&c!==void 0?c:null,I.maven=(u=await B)!==null&&u!==void 0?u:null,I.gradle=(l=await _)!==null&&l!==void 0?l:null}break;case"csharp":I.dotnet=(d=await pJ())!==null&&d!==void 0?d:null;break;case"go":I.go=(f=await GJ())!==null&&f!==void 0?f:null;break}return I}fe.collectDebugInformation=P2e});var SJ=g(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.CDKTF_DISABLE_PLUGIN_CACHE_ENV=Vi.CHECKPOINT_DISABLE=Vi.DISABLE_VERSION_CHECK=void 0;function ZJ(e){return e==="true"||e==="1"}Vi.DISABLE_VERSION_CHECK=ZJ(process.env.DISABLE_VERSION_CHECK);Vi.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;Vi.CDKTF_DISABLE_PLUGIN_CACHE_ENV=ZJ(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var WJ=g(RJ=>{"use strict";Object.defineProperty(RJ,"__esModule",{value:!0})});var _J=g(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.isNestedTypeAttribute=ta.isAttributeNestedType=void 0;function NJ(e){return typeof e=="object"&&!Array.isArray(e)&&typeof e.nesting_mode=="string"&&(typeof e.attributes=="object"||typeof e.attributes>"u")}ta.isAttributeNestedType=NJ;function z2e(e){return typeof e.nested_type<"u"&&NJ(e.nested_type)}ta.isNestedTypeAttribute=z2e});var Ve=g(xe=>{"use strict";var j2e=xe&&xe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Jt=xe&&xe.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&j2e(t,e,n)};Object.defineProperty(xe,"__esModule",{value:!0});Jt(pZ(),xe);Jt(oJ(),xe);Jt(Qp(),xe);Jt(vJ(),xe);Jt(SJ(),xe);Jt(hZ(),xe);Jt(bZ(),xe);Jt(Ho(),xe);Jt(WJ(),xe);Jt(_J(),xe);Jt(Ov(),xe);Jt(CZ(),xe);Jt($s(),xe);Jt(Sd(),xe)});var VJ=g((WFe,AZ)=>{"use strict";var EJ=require("fs");AZ.exports=e=>new Promise(t=>{EJ.access(e,n=>{t(!n)})});AZ.exports.sync=e=>{try{return EJ.accessSync(e),!0}catch{return!1}}});var wJ=g((NFe,GZ)=>{"use strict";var HJ=(e,...t)=>new Promise(n=>{n(e(...t))});GZ.exports=HJ;GZ.exports.default=HJ});var TJ=g((_Fe,BZ)=>{"use strict";var Q2e=wJ(),YJ=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let t=[],n=0,r=()=>{n--,t.length>0&&t.shift()()},i=(a,c,...u)=>{n++;let l=Q2e(a,...u);c(l),l.then(r,r)},o=(a,c,...u)=>{n<e?i(a,c,...u):t.push(i.bind(null,a,c,...u))},s=(a,...c)=>new Promise(u=>o(a,u,...c));return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),s};BZ.exports=YJ;BZ.exports.default=YJ});var LJ=g((EFe,XJ)=>{"use strict";var FJ=TJ(),lm=class extends Error{constructor(t){super(),this.value=t}},$2e=(e,t)=>Promise.resolve(e).then(t),eNe=e=>Promise.all(e).then(t=>t[1]===!0&&Promise.reject(new lm(t[0])));XJ.exports=(e,t,n)=>{n=Object.assign({concurrency:1/0,preserveOrder:!0},n);let r=FJ(n.concurrency),i=[...e].map(s=>[s,r($2e,s,t)]),o=FJ(n.preserveOrder?1:1/0);return Promise.all(i.map(s=>o(eNe,s))).then(()=>{}).catch(s=>s instanceof lm?s.value:Promise.reject(s))}});var UJ=g((VFe,vZ)=>{"use strict";var kJ=require("path"),KJ=VJ(),tNe=LJ();vZ.exports=(e,t)=>(t=Object.assign({cwd:process.cwd()},t),tNe(e,n=>KJ(kJ.resolve(t.cwd,n)),t));vZ.exports.sync=(e,t)=>{t=Object.assign({cwd:process.cwd()},t);for(let n of e)if(KJ.sync(kJ.resolve(t.cwd,n)))return n}});var OJ=g((HFe,ZZ)=>{"use strict";var Hi=require("path"),xJ=UJ();ZZ.exports=(e,t={})=>{let n=Hi.resolve(t.cwd||""),{root:r}=Hi.parse(n),i=[].concat(e);return new Promise(o=>{(function s(a){xJ(i,{cwd:a}).then(c=>{c?o(Hi.join(a,c)):a===r?o(null):s(Hi.dirname(a))})})(n)})};ZZ.exports.sync=(e,t={})=>{let n=Hi.resolve(t.cwd||""),{root:r}=Hi.parse(n),i=[].concat(e);for(;;){let o=xJ.sync(i,{cwd:n});if(o)return Hi.join(n,o);if(n===r)return null;n=Hi.dirname(n)}}});var MJ=g((wFe,SZ)=>{"use strict";var JJ=OJ();SZ.exports=async({cwd:e}={})=>JJ("package.json",{cwd:e});SZ.exports.sync=({cwd:e}={})=>JJ.sync("package.json",{cwd:e})});var wi=de(require("yargs")),F3=de(require("path")),X3=de(require("os")),hm=de(Fn()),L3=de(HI()),Ur=de(Ve());var gm=de(Fn()),qJ=require("node:module"),dm=de(require("path")),RZ=de(MJ()),DJ=(0,qJ.createRequire)(__filename),PJ=()=>{let e=RZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return JSON.parse(gm.readFileSync(e,"utf-8"))},nNe=()=>{let e=RZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return dm.default.dirname(e)},Ce=()=>{let e=dm.default.join(__dirname,"..","handlers.js");return gm.existsSync(e)?DJ(e):DJ(dm.default.join(nNe(),"bundle","bin","cmds","handlers.js"))};var zJ=de(Ve());var Ie=class{constructor(){this.handler=async t=>{t.getYargsCompletions||await this.handleCommand(t)}}};var rNe=PJ(),WZ=class extends Ie{constructor(){super(...arguments);this.command="init";this.describe="Create a new cdktn project from a template.";this.builder=n=>n.showHelpOnFail(!0).option("template",{type:"string",desc:"The template to be used to create a new project. Either URL to zip file or one of the built-in templates."}).option("project-name",{type:"string",desc:"The name of the project."}).option("project-description",{type:"string",desc:"The description of the project."}).option("dist",{type:"string",desc:'Install dependencies from a "dist" directory (for development)'}).option("local",{type:"boolean",desc:"Use local state storage for generated Terraform.",default:!1}).option("cdktf-version",{type:"string",desc:"The cdktn version to use while creating a new project.",default:rNe.version}).option("from-terraform-project",{type:"string",desc:"Use a terraform project as the basis, CDK constructs will be generated based on the .tf files in the path"}).option("enable-crash-reporting",{type:"boolean",desc:"Enable crash reporting for the CLI, refer to https://cdktn.io/docs/telemetry#crash-reporting for more details"}).option("providers",{describe:"Providers to add to your project",type:"array",default:[]}).option("providers-force-local",{type:"boolean",desc:"Force local installation of provider specified in init"}).option("tfe-hostname",{type:"string",desc:"The hostname of the Terraform Enterprise instance to use for remote state storage"}).strict()}async handleCommand(n){zJ.Errors.setScope("init"),await Ce().init(n)}},jJ=new WZ;var fm=de(Ve());var $J=de(Ve());var QJ=(0,fm.readConfigSync)(),NZ=class extends Ie{constructor(){super(...arguments);this.command="get";this.describe="Generate CDK Constructs for Terraform providers and modules.";this.builder=n=>n.showHelpOnFail(!0).option("output",{default:QJ.codeMakerOutput,type:"string",desc:"Output directory for generated Constructs",alias:"o"}).option("language",{default:QJ.language,required:!0,type:"string",desc:"Output programming language",alias:"l",choices:fm.LANGUAGES}).option("force",{default:!1,type:"boolean",desc:"Regenerates all generated constructs"}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrently generated provider / module bindings. Only applies for languages that are not Typescript (translated by JSII). Defaults to infinity, denoted by -1",default:-1}).option("show-performance-info",{type:"boolean",required:!1,desc:"Shows performance information after generation"})}async handleCommand(n){$J.Errors.setScope("get"),await Ce().get(n)}},Im=new NZ;var e3=de(Ve());var t3=de(require("path")),n3=de(Fn());function iNe(e=process.cwd()){try{let t=t3.join(e,"cdktf.json");return n3.readJsonSync(t)}catch{return}}var _Z=class extends Ie{constructor(){super(...arguments);this.command="convert";this.describe="Converts a single file of HCL configuration to CDK Terrain. Takes the file to be converted on stdin.";this.builder=n=>n.example("cat main.tf | cdktn convert --provider integrations/github","Takes the HCL content of main.tf and converts it to CDK Terrain content and prints it").example("cat main.tf | cdktn convert --provider hashicorp/aws > imported.ts","Takes the HCL content of main.tf and converts it to CDK Terrain content in imported.ts").example("cat main.tf | cdktn convert --provider 'hashicorp/aws@ ~>3.62.0' 'integrations/github@ ~>4.16.0' --language python > imported.py","Takes the HCL content of main.tf and converts it to CDK Terrain content in imported.py").option("language",{choices:["typescript","python","csharp","java","go"],default:iNe()?.language||"typescript"}).option("provider",{describe:"The conversion needs to know which providers are used in addition to the ones in your cdktf.json file. We search for a cdktf.json below your current working directory.",type:"array",default:[]}).option("stack",{describe:"Wrap the generated code within a stack class",type:"boolean",default:!1}).showHelpOnFail(!0)}async handleCommand(n){e3.Errors.setScope("convert");let r=Ce();n.withProject!==void 0&&(n.language==="typescript"?n.withProject=!1:n.withProject=!0),await r.convert(n)}},r3=new _Z;var o3=de(Ve());var s3=de(Ve());var i3=(0,o3.readConfigSync)(),EZ=class extends Ie{constructor(){super(...arguments);this.command="deploy [stacks...]";this.describe="Deploy the given stacks";this.aliases=["apply"];this.builder=n=>n.positional("stacks",{desc:"Deploy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:i3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:i3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("outputs-file",{type:"string",required:!1,desc:"Path to file where stack outputs will be written as JSON",requiresArg:!0}).option("outputs-file-include-sensitive-outputs",{type:"boolean",required:!1,desc:"Whether to include sensitive outputs in the output file",default:!1}).option("ignore-missing-stack-dependencies",{type:"boolean",required:!1,desc:"Don't check if all stacks specified in the command have their dependencies included as well",default:!1}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("refresh-only",{default:!1,required:!1,boolean:!0,desc:'Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.'}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for all targeted stacks"}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack or stacks to apply. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){s3.Errors.setScope("deploy"),await Ce().deploy(n)}},a3=new EZ;var u3=de(Ve());var l3=de(Ve());var c3=(0,u3.readConfigSync)(),VZ=class extends Ie{constructor(){super(...arguments);this.command="destroy [stacks..]";this.describe="Destroy the given stacks";this.builder=n=>n.positional("stacks",{desc:"Destroy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:c3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:c3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("ignore-missing-stack-dependencies",{type:"boolean",required:!1,desc:"Don't check if all stacks specified in the command have their dependencies included as well",default:!1}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack or stacks to apply. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for all targeted stacks"}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){l3.Errors.setScope("destroy"),await Ce().destroy(n)}},d3=new VZ;var f3=de(Ve());var I3=de(Ve());var g3=(0,f3.readConfigSync)(),HZ=class extends Ie{constructor(){super(...arguments);this.command="diff [stack]";this.describe="Perform a diff (terraform plan) for the given stack";this.aliases=["plan"];this.builder=n=>n.positional("stack",{desc:"Diff stack which matches the given id only. Required when more than one stack is present in the app",type:"string"}).option("app",{default:g3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:g3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("refresh-only",{default:!1,required:!1,boolean:!0,desc:'Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.'}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for the targeted stack"}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){I3.Errors.setScope("diff"),await Ce().diff(n)}},p3=new HZ;var pm=de(Ve());var m3=(0,pm.readConfigSync)(),wZ=class extends Ie{constructor(){super(...arguments);this.command="list";this.describe="List stacks in app.";this.builder=n=>n.option("app",{default:m3.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:m3.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).showHelpOnFail(!0)}async handleCommand(n){pm.Errors.setScope("list"),await Ce().list(n)}},h3=new wZ;var C3=de(Ve());var YZ=class extends Ie{constructor(){super(...arguments);this.command="login";this.describe="Retrieves an API token to connect to Terraform Cloud or Terraform Enterprise.";this.builder=n=>n.showHelpOnFail(!0).option("tfe-hostname",{string:!0,requiresArg:!0,describe:"The Terraform Enterprise hostname to authenticate against. If you use Terraform Cloud you can leave this on the default.",default:"app.terraform.io"}).example("cdktn login","Takes you through the interactive login process").example("cdktn login --tfe-hostname tfe.my-company.com","Takes you through the interactive login process on your companies Terraform Enterprise instance.").example("cat my-token.txt | cdktn login","Uses a locally stored token directly, instead of going through the interactive login process").strict()}async handleCommand(n){C3.Errors.setScope("login"),await Ce().login(n)}},b3=new YZ;var na=de(Ve());var TZ=(0,na.readConfigSync)(),FZ=class extends Ie{constructor(){super(...arguments);this.command="synth";this.describe="Synthesizes Terraform code for the given app in a directory.";this.aliases=["synthesize"];this.builder=n=>n.option("app",{default:TZ.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:TZ.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("check-code-maker-output",{type:"boolean",desc:"Should `codeMakerOutput` existence check be performed? By default it will be checked if providers or modules are configured.",default:(0,na.shouldCheckCodeMakerOutput)(TZ)}).option("hcl",{type:"boolean",desc:"Should the output be in HCL format?",default:!1}).showHelpOnFail(!0)}async handleCommand(n){na.Errors.setScope("synth"),await Ce().synth(n)}},y3=new FZ;var G3=de(Ve());var B3=de(Ve());var A3=(0,G3.readConfigSync)(),XZ=class extends Ie{constructor(){super(...arguments);this.command="watch [stacks..]";this.describe="[experimental] Watch for file changes and automatically trigger a deploy";this.builder=n=>n.positional("stacks",{desc:"Deploy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:A3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:A3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).showHelpOnFail(!0)}async handleCommand(n){B3.Errors.setScope("watch"),await Ce().watch(n)}},v3=new XZ;var mm=de(Ve());var Z3=(0,mm.readConfigSync)(),LZ=class extends Ie{constructor(){super(...arguments);this.command="output [stacks..]";this.describe="Prints the output of stacks";this.aliases=["outputs"];this.builder=n=>n.positional("stacks",{desc:"Get outputs of the stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:Z3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:Z3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("outputs-file",{type:"string",required:!1,desc:"Path to file where stack outputs will be written as JSON",requiresArg:!0}).option("outputs-file-include-sensitive-outputs",{type:"boolean",required:!1,desc:"Whether to include sensitive outputs in the output file",default:!1}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){mm.Errors.setScope("output"),await Ce().output(n)}},S3=new LZ;var R3=de(Ve());var kZ=class extends Ie{constructor(){super(...arguments);this.command="debug";this.describe="Get debug information about the current project and environment";this.builder=n=>n.showHelpOnFail(!0).option("json",{default:!1,type:"boolean",desc:"If set, output will be in JSON format."})}async handleCommand(n){R3.Errors.setScope("debug"),await Ce().debug(n)}},W3=new kZ;var Y3=de(require("yargs"));var N3=de(Ve());var KZ=class extends Ie{constructor(){super(...arguments);this.command="add <provider...>";this.describe="Add one or more Terraform providers to your project.";this.builder=n=>n.showHelpOnFail(!0).positional("provider",{type:"string",desc:"Name of the provider to add. Can include a version constraint (e.g. aws@~>4.0).",required:!0}).option("force-local",{type:"boolean",desc:"force local provider installation, even if pre-built provider exists"})}async handleCommand(n){N3.Errors.setScope("provider add"),await Ce().providerAdd(n)}},_3=new KZ;var E3=de(Ve());var UZ=class extends Ie{constructor(){super(...arguments);this.command="upgrade <provider...>";this.describe=`Upgrade one or more Terraform providers in your project to the newest version compatible with your CDKTN version.
|
|
73
|
+
information on how to disable it.`)}et.getUserId=rJ;async function iJ(e){if(process.env.CHECKPOINT_DISABLE)return;e.runID||(e.runID=(0,eJ.randomUUID)()),e.dateTime||(e.dateTime=new Date),e.arch||(e.arch=im.arch()),e.os||(e.os=im.platform());let t=QO.default.isCI?QO.default.name||"unknown":!1;!e.userId&&!t&&(e.userId=rJ()),t&&(e.ci=t),e.projectId=e.projectId||nJ();let n=JSON.stringify(e);if(n.length>$O){IZ.logger.warn(`Skipped sending telemetry as the request body size was ${n.length} bytes. The limit is ${$O} bytes`);return}try{await y2e(`${h2e}telemetry/${e.product}`,n)}catch(r){(0,IZ.processLoggerError)(r.message)}}et.ReportRequest=iJ});var oJ=g(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.ConstructsMakerProviderTarget=_i.ConstructsMakerModuleTarget=_i.ConstructsMakerTarget=void 0;var gr=Qp(),Wd=class{constructor(t,n){this.constraint=t,this.targetLanguage=n,this.constraint instanceof gr.TerraformModuleConstraint?this.fileName=`${this.typesPath(this.constraint.fileName)}.ts`:this.fileName=`${this.typesPath(this.constraint.name)}.ts`}static from(t,n){return t instanceof gr.TerraformModuleConstraint?new sm(t,n):new am(t,n)}get version(){return this.constraint.version}get source(){return this.constraint.source}get name(){return this.constraint.name}get fqn(){return this.constraint.fqn}get namespace(){return this.constraint.namespace}get moduleKey(){return this.fqn.replace(/\//gi,"_")}};_i.ConstructsMakerTarget=Wd;var sm=class extends Wd{get isModule(){return!0}get isProvider(){return!1}get srcMakName(){switch(this.targetLanguage){case gr.Language.GO:return this.name.replace(/-/gi,"_");case gr.Language.JAVA:case gr.Language.CSHARP:case gr.Language.PYTHON:return this.simplifiedFqn;default:return this.simplifiedName}}get trackingPayload(){return{name:this.name,fullName:this.fqn,version:this.version,type:"module"}}typesPath(t){return`modules/${t}`}get simplifiedName(){var t,n;return(n=(t=this.namespace)===null||t===void 0?void 0:t.replace(/\//gi,".").replace(/-/gi,"_"))!==null&&n!==void 0?n:this.name}get simplifiedFqn(){return this.fqn.replace(/\//gi,".").replace(/-/gi,"_")}};_i.ConstructsMakerModuleTarget=sm;var am=class extends Wd{get isModule(){return!1}get isProvider(){return!0}get srcMakName(){switch(this.targetLanguage){case gr.Language.JAVA:return this.isNullProvider?"nullprovider":this.simplifiedName;case gr.Language.CSHARP:return this.isNullProvider?"Providers.Null":this.simplifiedName;case gr.Language.PYTHON:return this.simplifiedName;case gr.Language.GO:return this.name.replace(/-/gi,"_");default:return this.constraint.fqn}}get trackingPayload(){return{name:this.name,fullName:this.source,version:this.version,type:"provider"}}typesPath(t){return`providers/${t}/index`}get isNullProvider(){return this.constraint.name==="null"}get simplifiedName(){return this.name.replace(/\//gi,".").replace(/-/gi,"_")}};_i.ConstructsMakerProviderTarget=am});var hZ=g(yn=>{"use strict";var G2e=yn&&yn.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),B2e=yn&&yn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),v2e=yn&&yn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&G2e(t,e,n);return B2e(t,e),t};Object.defineProperty(yn,"__esModule",{value:!0});yn.Errors=yn.IsErrorType=void 0;var Z2e=pZ(),S2e=Sd(),R2e=v2e(HI());async function W2e(e,t){let n={command:e,product:"cdktn",version:`${S2e.DISPLAY_VERSION}`,dateTime:new Date,payload:t};await(0,Z2e.ReportRequest)(n)}function N2e(e,t){return e&&e.__type===t}yn.IsErrorType=N2e;function mZ(e,t){return(n,r=new Error,i)=>{W2e(t,{...i,message:n,type:e});let o=new Error(`${e} Error: ${n}`);return Object.entries(i||{}).forEach(([s,a])=>{o[s]=a}),o.__type=e,o.stack=r.stack,o}}var cm="unknown";yn.Errors={Internal:mZ("Internal",cm),Usage:mZ("Usage",cm),External:mZ("External",cm),setScope(e){cm=e,R2e.configureScope(t=>t.setTransactionName(e))}}});var CZ=g(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.terraformVersion=Kr.parseTerraformCliVersion=Kr.terraformBinaryName=void 0;var _2e=hZ(),E2e=$s();Kr.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";var V2e=require("cdktn/lib/validations");Object.defineProperty(Kr,"parseTerraformCliVersion",{enumerable:!0,get:function(){return V2e.parseTerraformCliVersion}});Kr.terraformVersion=(0,E2e.exec)(Kr.terraformBinaryName,["version","-json"],{}).then(e=>JSON.parse(e).terraform_version).catch(e=>_2e.Errors.Usage(`Unknown: Error loading terraform version ${e}`,e))});var bZ=g(Ot=>{"use strict";var sJ=Ot&&Ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.getGradlePackageVersionFromBuild=Ot.getGradlePackageVersion=Ot.getDependencyInformationFromLine=Ot.getGradleDependencies=Ot.isGradleProject=void 0;var aJ=sJ(require("path")),um=sJ(Fn()),Ei=Ho(),H2e=$s();function w2e(e){let t=aJ.default.join(e,"build.gradle");try{return um.default.accessSync(t,um.default.constants.R_OK|um.default.constants.W_OK),!0}catch{return Ei.logger.debug(`No build.gradle found at ${t}`),!1}}Ot.isGradleProject=w2e;async function cJ(){let e;try{e=await(0,H2e.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(I){Ei.logger.debug(`Unable to run 'gradle dependencies': ${I}`);return}let t=e.split(/\r\n|\r|\n/),n=t.findIndex(I=>I.includes("implementation - "));if(n===-1){Ei.logger.debug(`Unable to find implementation section in output of 'gradle dependencies': ${e}`);return}let r=/^\s*$/,i=t.slice(n+1),o=i.findIndex(I=>r.test(I)),s=i.slice(0,o),a=t.findIndex(I=>I.includes("api - "));if(a===-1){Ei.logger.debug(`Unable to find api section in output of 'gradle dependencies': ${e}`);return}let c=t.slice(a+1),u=c.findIndex(I=>r.test(I)),l=c.slice(0,u),d=/^\s*[+\\-]+\s*/,f=/\s+\([nc*]\)\s*$/;return[...s,...l].filter(I=>I!=="No dependencies").map(I=>I.replace(d,"").replace(f,""))}Ot.getGradleDependencies=cJ;function uJ(e){let t=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,n=e.match(t);if(!n){Ei.logger.debug("Unexpected format for gradle build. Please file an issue at https://github.com/open-constructs/cdk-terrain/issues/new?assignees=&labels=bug%2Cnew&template=bug-report.yml&title=");return}return n[3]===void 0?{group:n[1],name:n[2],version:""}:{group:n[1],name:n[2],version:n[3]}}Ot.getDependencyInformationFromLine=uJ;async function Y2e(e){let n={jsii:"jsii-runtime"}[e]||e;Ei.logger.debug("Running 'gradle dependencies' to find package version",n);let r=await cJ();if(!r||r.length===0)return;for(let o of r)if(o.includes(`:${n}:`)){let s=uJ(o);return s?s.version:void 0}let i=await lJ(e);if(i)return i.version}Ot.getGradlePackageVersion=Y2e;async function lJ(e){let t=aJ.default.join(process.cwd(),"build.gradle"),r=(await um.default.readFile(t,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(r.findIndex(f=>i.test(f))===-1){Ei.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=r.findIndex(f=>f.includes(e));if(s===-1){Ei.logger.debug(`Unable to find package ${e} in output build.gradle`);return}let a=r[s],u=new RegExp(`([^:]+):${e}(?::([^\\s]+))?`,"i").exec(a);if(u)return{group:u[1],name:e,version:u[2]||""};let d=new RegExp(`java/(.*)/${e}/([^/]+)/.*\\.jar`,"i").exec(a);if(d)return{group:d[1].replace(/\//g,"."),name:e,version:d[2]}}Ot.getGradlePackageVersionFromBuild=lJ});var vJ=g(fe=>{"use strict";var T2e=fe&&fe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),F2e=fe&&fe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),gJ=fe&&fe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&T2e(t,e,n);return F2e(t,e),t};Object.defineProperty(fe,"__esModule",{value:!0});fe.collectDebugInformation=fe.getPackageVersion=fe.getNodeVersion=fe.getGoVersion=fe.getPipenvVersion=fe.getPipVersion=fe.getPythonVersion=fe.getGradleVersion=fe.getMavenVersion=fe.getJavaVersion=fe.getDotnetVersion=fe.getLanguage=void 0;var X2e=gJ(require("path")),yZ=gJ(require("os")),Me=Ho(),fr=$s(),L2e=CZ(),k2e=Sd(),fJ=Fn(),dJ=bZ();function IJ(e=process.cwd()){try{return JSON.parse((0,fJ.readFileSync)(X2e.resolve(e,"cdktf.json"),"utf-8")).language}catch{Me.logger.debug(`Unable to detect language in ${e}`);return}}fe.getLanguage=IJ;async function Ir(e,t){let n=()=>{};try{return(await(0,fr.exec)(e,[t],{env:process.env,stdio:[void 0,void 0,"ignore"]},n,n)).trim().replace(/\r?\n|\r/g,"")}catch(r){Me.logger.debug(`Failed to run ${e} ${t}: ${r}`);return}}function pJ(){return Ir("dotnet","--version")}fe.getDotnetVersion=pJ;function mJ(){return Ir("java","-version")}fe.getJavaVersion=mJ;function hJ(){return Ir("mvn","--version")}fe.getMavenVersion=hJ;function CJ(){return Ir("gradle","--version")}fe.getGradleVersion=CJ;async function bJ(){return await Ir("python3","--version")||await Ir("python","--version")}fe.getPythonVersion=bJ;function yJ(){return Ir("pip","--version")}fe.getPipVersion=yJ;function AJ(){return Ir("pipenv","--version")}fe.getPipenvVersion=AJ;function GJ(){return Ir("go","version")}fe.getGoVersion=GJ;function BJ(){return Ir("node","--version")}fe.getNodeVersion=BJ;async function K2e(e){return await(0,fJ.pathExists)("pnpm-lock.yaml")?U2e(e):x2e(e)}async function U2e(e){var t,n,r;let i;try{i=await(0,fr.exec)("pnpm",["list",e,"--json"],{env:{...process.env}})}catch(s){Me.logger.debug(`Unable to run 'pnpm list ${e} --json': ${s}`);return}let o;try{o=JSON.parse(i)}catch(s){Me.logger.debug(`Unable to parse output of 'pnpm list ${e} --json': ${s}`);return}if(!o||!Array.isArray(o)||o.length===0||!(!((r=(n=(t=o[0])===null||t===void 0?void 0:t.dependencies)===null||n===void 0?void 0:n[e])===null||r===void 0)&&r.version)){Me.logger.debug(`Unable to find '${e}' in 'pnpm list ${e} --json': ${i}`);return}return o[0].dependencies[e].version}async function x2e(e){let t;try{t=await(0,fr.exec)("npm",["list",e,"--json","--include=dev"],{env:{...process.env}})}catch(r){Me.logger.debug(`Unable to run 'npm list ${e} --json': ${r}`);return}let n;try{n=JSON.parse(t)}catch(r){Me.logger.debug(`Unable to parse output of 'npm list ${e} --json': ${r}`);return}if(!n.dependencies||!n.dependencies[e]||!n.dependencies[e].version){Me.logger.debug(`Unable to find '${e}' in 'npm list ${e} --json': ${t}`);return}return n.dependencies[e].version}async function O2e(e){let t;try{t=await(0,fr.exec)("pipenv",["run","pip","show","-qq",e],{env:process.env}),t=await(0,fr.exec)("pipenv",["run","pip","show",e],{env:process.env})}catch(i){Me.logger.debug(`Unable to run 'pipenv run pip show ${e}': ${i}`)}if(!t)try{t=await(0,fr.exec)("pip",["show","-qq",e],{env:process.env}),t=await(0,fr.exec)("pip",["show",e],{env:process.env})}catch(i){Me.logger.debug(`Unable to run 'pip show ${e}': ${i}`)}if(!t)return;let n=t.split(/\r\n|\r|\n/).find(i=>i.startsWith("Version:"));if(!n){Me.logger.debug(`Unable to find version in output of 'pipenv run pip show ${e}' / 'pip show ${e}': ${t}`);return}return n.split(":")[1].trim()}async function J2e(e){let n={jsii:"Amazon.JSII.Runtime",constructs:"Constructs",cdktf:"HashiCorp.Cdktf",cdktn:"Io.Cdktn"}[e]||e,r;try{r=await(0,fr.exec)("dotnet",["list","package","--include-transitive"],{env:process.env})}catch(o){Me.logger.debug(`Unable to run 'dotnet list package --include-transitive': ${o}`);return}let i=r.split(/\r\n|\r|\n/).find(o=>o.includes(`> ${n}`));if(!i){Me.logger.debug(`Unable to find version for '${n}' in output of 'dotnet list package --include-transitive': ${r}`);return}return i.split(" ").reverse().find(o=>o!=="")}async function M2e(e){var t;let r={jsii:"jsii-runtime-go",cdktf:"github.com/hashicorp/terraform-cdk-go",cdktn:"github.com/open-constructs/cdk-terrain-go"}[e]||e,i;try{i=await(0,fr.exec)("go",["list","-m","all"],{env:process.env})}catch(s){Me.logger.debug(`Unable to run 'go list -m all': ${s}`);return}let o=i.split(/\r\n|\r|\n/).find(s=>s.includes(r));if(!o){Me.logger.debug(`Unable to find version for '${r}' in output of 'go list -m all': ${i}`);return}return o.includes("=>")&&(Me.logger.debug(`Found local version for '${r}': ${o}`),o=o.split("=>")[0].trim()),(t=o.split(" ").pop())===null||t===void 0?void 0:t.replace("v","")}async function D2e(e){let n={jsii:"jsii-runtime"}[e]||e,r;try{r=await(0,fr.exec)("mvn",["dependency:list"],{env:process.env})}catch(l){Me.logger.debug(`Unable to run 'mvn dependency:list': ${l}`);return}let i=r.split("The following files have been resolved")[1];if(!i){Me.logger.debug(`Unable to find resolution passage in output of 'mvn dependency:list': ${r}`);return}let o=i.split(/\r\n|\r|\n/).find(l=>l.includes(`${n}:`));if(!o){Me.logger.debug(`Unable to find version for '${n}' in output of 'mvn dependency:list': ${r}`);return}let s=`${n}:jar:`,a=o.indexOf(s)+s.length,u=o.indexOf(":compile");return o.substring(a,u)}async function q2e(e){return(0,dJ.isGradleProject)("./")?(0,dJ.getGradlePackageVersion)(e):D2e(e)}async function Nd(e,t){let n=async()=>{},i=await({typescript:K2e,python:O2e,go:M2e,csharp:J2e,java:q2e}[e]||n)(t);return i??void 0}fe.getPackageVersion=Nd;async function P2e(){var e,t,n,r,i,o,s,a,c,u,l,d,f;let I={},m=IJ();I.language=m??null,I["cdktn-cli"]=k2e.DISPLAY_VERSION;let C=BJ();if(I.node=(e=await C)!==null&&e!==void 0?e:null,m){let y=Nd(m,"cdktn"),B=Nd(m,"cdktf"),_=Nd(m,"constructs"),Y=Nd(m,"jsii");I.cdktn=(t=await y)!==null&&t!==void 0?t:null,I.cdktf=(n=await B)!==null&&n!==void 0?n:null,I.constructs=(r=await _)!==null&&r!==void 0?r:null,I.jsii=(i=await Y)!==null&&i!==void 0?i:null}switch(I.terraform=await L2e.terraformVersion,I.arch=yZ.arch(),I.os=`${yZ.platform()} ${yZ.release()}`,m){case"python":{let y=bJ(),B=yJ(),_=AJ();I.python=(o=await y)!==null&&o!==void 0?o:null,I.pip=(s=await B)!==null&&s!==void 0?s:null,I.pipenv=(a=await _)!==null&&a!==void 0?a:null}break;case"java":{let y=mJ(),B=hJ(),_=CJ();I.java=(c=await y)!==null&&c!==void 0?c:null,I.maven=(u=await B)!==null&&u!==void 0?u:null,I.gradle=(l=await _)!==null&&l!==void 0?l:null}break;case"csharp":I.dotnet=(d=await pJ())!==null&&d!==void 0?d:null;break;case"go":I.go=(f=await GJ())!==null&&f!==void 0?f:null;break}return I}fe.collectDebugInformation=P2e});var SJ=g(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.CDKTF_DISABLE_PLUGIN_CACHE_ENV=Vi.CHECKPOINT_DISABLE=Vi.DISABLE_VERSION_CHECK=void 0;function ZJ(e){return e==="true"||e==="1"}Vi.DISABLE_VERSION_CHECK=ZJ(process.env.DISABLE_VERSION_CHECK);Vi.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;Vi.CDKTF_DISABLE_PLUGIN_CACHE_ENV=ZJ(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var WJ=g(RJ=>{"use strict";Object.defineProperty(RJ,"__esModule",{value:!0})});var _J=g(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.isNestedTypeAttribute=ta.isAttributeNestedType=void 0;function NJ(e){return typeof e=="object"&&!Array.isArray(e)&&typeof e.nesting_mode=="string"&&(typeof e.attributes=="object"||typeof e.attributes>"u")}ta.isAttributeNestedType=NJ;function z2e(e){return typeof e.nested_type<"u"&&NJ(e.nested_type)}ta.isNestedTypeAttribute=z2e});var Ve=g(xe=>{"use strict";var j2e=xe&&xe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Jt=xe&&xe.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&j2e(t,e,n)};Object.defineProperty(xe,"__esModule",{value:!0});Jt(pZ(),xe);Jt(oJ(),xe);Jt(Qp(),xe);Jt(vJ(),xe);Jt(SJ(),xe);Jt(hZ(),xe);Jt(bZ(),xe);Jt(Ho(),xe);Jt(WJ(),xe);Jt(_J(),xe);Jt(Ov(),xe);Jt(CZ(),xe);Jt($s(),xe);Jt(Sd(),xe)});var VJ=g((WFe,AZ)=>{"use strict";var EJ=require("fs");AZ.exports=e=>new Promise(t=>{EJ.access(e,n=>{t(!n)})});AZ.exports.sync=e=>{try{return EJ.accessSync(e),!0}catch{return!1}}});var wJ=g((NFe,GZ)=>{"use strict";var HJ=(e,...t)=>new Promise(n=>{n(e(...t))});GZ.exports=HJ;GZ.exports.default=HJ});var TJ=g((_Fe,BZ)=>{"use strict";var Q2e=wJ(),YJ=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let t=[],n=0,r=()=>{n--,t.length>0&&t.shift()()},i=(a,c,...u)=>{n++;let l=Q2e(a,...u);c(l),l.then(r,r)},o=(a,c,...u)=>{n<e?i(a,c,...u):t.push(i.bind(null,a,c,...u))},s=(a,...c)=>new Promise(u=>o(a,u,...c));return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),s};BZ.exports=YJ;BZ.exports.default=YJ});var LJ=g((EFe,XJ)=>{"use strict";var FJ=TJ(),lm=class extends Error{constructor(t){super(),this.value=t}},$2e=(e,t)=>Promise.resolve(e).then(t),eNe=e=>Promise.all(e).then(t=>t[1]===!0&&Promise.reject(new lm(t[0])));XJ.exports=(e,t,n)=>{n=Object.assign({concurrency:1/0,preserveOrder:!0},n);let r=FJ(n.concurrency),i=[...e].map(s=>[s,r($2e,s,t)]),o=FJ(n.preserveOrder?1:1/0);return Promise.all(i.map(s=>o(eNe,s))).then(()=>{}).catch(s=>s instanceof lm?s.value:Promise.reject(s))}});var UJ=g((VFe,vZ)=>{"use strict";var kJ=require("path"),KJ=VJ(),tNe=LJ();vZ.exports=(e,t)=>(t=Object.assign({cwd:process.cwd()},t),tNe(e,n=>KJ(kJ.resolve(t.cwd,n)),t));vZ.exports.sync=(e,t)=>{t=Object.assign({cwd:process.cwd()},t);for(let n of e)if(KJ.sync(kJ.resolve(t.cwd,n)))return n}});var OJ=g((HFe,ZZ)=>{"use strict";var Hi=require("path"),xJ=UJ();ZZ.exports=(e,t={})=>{let n=Hi.resolve(t.cwd||""),{root:r}=Hi.parse(n),i=[].concat(e);return new Promise(o=>{(function s(a){xJ(i,{cwd:a}).then(c=>{c?o(Hi.join(a,c)):a===r?o(null):s(Hi.dirname(a))})})(n)})};ZZ.exports.sync=(e,t={})=>{let n=Hi.resolve(t.cwd||""),{root:r}=Hi.parse(n),i=[].concat(e);for(;;){let o=xJ.sync(i,{cwd:n});if(o)return Hi.join(n,o);if(n===r)return null;n=Hi.dirname(n)}}});var MJ=g((wFe,SZ)=>{"use strict";var JJ=OJ();SZ.exports=async({cwd:e}={})=>JJ("package.json",{cwd:e});SZ.exports.sync=({cwd:e}={})=>JJ.sync("package.json",{cwd:e})});var wi=de(require("yargs")),F3=de(require("path")),X3=de(require("os")),hm=de(Fn()),L3=de(HI()),Ur=de(Ve());var gm=de(Fn()),qJ=require("node:module"),dm=de(require("path")),RZ=de(MJ()),DJ=(0,qJ.createRequire)(__filename),PJ=()=>{let e=RZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return JSON.parse(gm.readFileSync(e,"utf-8"))},nNe=()=>{let e=RZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return dm.default.dirname(e)},Ce=()=>{let e=dm.default.join(__dirname,"..","handlers.js");return gm.existsSync(e)?DJ(e):DJ(dm.default.join(nNe(),"bundle","bin","cmds","handlers.js"))};var zJ=de(Ve());var Ie=class{constructor(){this.handler=async t=>{t.getYargsCompletions||await this.handleCommand(t)}}};var rNe=PJ(),WZ=class extends Ie{constructor(){super(...arguments);this.command="init";this.describe="Create a new cdktn project from a template.";this.builder=n=>n.showHelpOnFail(!0).option("template",{type:"string",desc:"The template to be used to create a new project. Either URL to zip file or one of the built-in templates."}).option("project-name",{type:"string",desc:"The name of the project."}).option("project-description",{type:"string",desc:"The description of the project."}).option("dist",{type:"string",desc:'Install dependencies from a "dist" directory (for development)'}).option("local",{type:"boolean",desc:"Use local state storage for generated Terraform.",default:!1}).option("cdktf-version",{type:"string",desc:"The cdktn version to use while creating a new project.",default:rNe.version}).option("from-terraform-project",{type:"string",desc:"Use a terraform project as the basis, CDK constructs will be generated based on the .tf files in the path"}).option("enable-crash-reporting",{type:"boolean",desc:"Enable crash reporting for the CLI, refer to https://cdktn.io/docs/telemetry#crash-reporting for more details"}).option("providers",{describe:"Providers to add to your project",type:"array",default:[]}).option("providers-force-local",{type:"boolean",desc:"Force local installation of provider specified in init"}).option("tfe-hostname",{type:"string",desc:"The hostname of the Terraform Enterprise instance to use for remote state storage"}).strict()}async handleCommand(n){zJ.Errors.setScope("init"),await Ce().init(n)}},jJ=new WZ;var fm=de(Ve());var $J=de(Ve());var QJ=(0,fm.readConfigSync)(),NZ=class extends Ie{constructor(){super(...arguments);this.command="get";this.describe="Generate CDK Constructs for Terraform providers and modules.";this.builder=n=>n.showHelpOnFail(!0).option("output",{default:QJ.codeMakerOutput,type:"string",desc:"Output directory for generated Constructs",alias:"o"}).option("language",{default:QJ.language,required:!0,type:"string",desc:"Output programming language",alias:"l",choices:fm.LANGUAGES}).option("force",{default:!1,type:"boolean",desc:"Regenerates all generated constructs"}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrently generated provider / module bindings. Only applies for languages that are not Typescript (translated by JSII). Defaults to infinity, denoted by -1",default:-1}).option("show-performance-info",{type:"boolean",required:!1,desc:"Shows performance information after generation"})}async handleCommand(n){$J.Errors.setScope("get"),await Ce().get(n)}},Im=new NZ;var e3=de(Ve());var t3=de(require("path")),n3=de(Fn());function iNe(e=process.cwd()){try{let t=t3.join(e,"cdktf.json");return n3.readJsonSync(t)}catch{return}}var _Z=class extends Ie{constructor(){super(...arguments);this.command="convert";this.describe="Converts a single file of HCL configuration to CDK Terrain. Takes the file to be converted on stdin.";this.builder=n=>n.example("cat main.tf | cdktn convert --provider integrations/github","Takes the HCL content of main.tf and converts it to CDK Terrain content and prints it").example("cat main.tf | cdktn convert --provider hashicorp/aws > imported.ts","Takes the HCL content of main.tf and converts it to CDK Terrain content in imported.ts").example("cat main.tf | cdktn convert --provider 'hashicorp/aws@ ~>3.62.0' 'integrations/github@ ~>4.16.0' --language python > imported.py","Takes the HCL content of main.tf and converts it to CDK Terrain content in imported.py").option("language",{choices:["typescript","python","csharp","java","go"],default:iNe()?.language||"typescript"}).option("provider",{describe:"The conversion needs to know which providers are used in addition to the ones in your cdktf.json file. We search for a cdktf.json below your current working directory.",type:"array",default:[]}).option("stack",{describe:"Wrap the generated code within a stack class",type:"boolean",default:!1}).showHelpOnFail(!0)}async handleCommand(n){e3.Errors.setScope("convert");let r=Ce();n.withProject!==void 0&&(n.language==="typescript"?n.withProject=!1:n.withProject=!0),await r.convert(n)}},r3=new _Z;var o3=de(Ve());var s3=de(Ve());var i3=(0,o3.readConfigSync)(),EZ=class extends Ie{constructor(){super(...arguments);this.command="deploy [stacks...]";this.describe="Deploy the given stacks";this.aliases=["apply"];this.builder=n=>n.positional("stacks",{desc:"Deploy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:i3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:i3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("outputs-file",{type:"string",required:!1,desc:"Path to file where stack outputs will be written as JSON",requiresArg:!0}).option("outputs-file-include-sensitive-outputs",{type:"boolean",required:!1,desc:"Whether to include sensitive outputs in the output file",default:!1}).option("ignore-missing-stack-dependencies",{type:"boolean",required:!1,desc:"Don't check if all stacks specified in the command have their dependencies included as well",default:!1}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("refresh-only",{default:!1,required:!1,boolean:!0,desc:'Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.'}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for all targeted stacks"}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack or stacks to apply. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){s3.Errors.setScope("deploy"),await Ce().deploy(n)}},a3=new EZ;var u3=de(Ve());var l3=de(Ve());var c3=(0,u3.readConfigSync)(),VZ=class extends Ie{constructor(){super(...arguments);this.command="destroy [stacks..]";this.describe="Destroy the given stacks";this.builder=n=>n.positional("stacks",{desc:"Destroy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:c3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:c3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("ignore-missing-stack-dependencies",{type:"boolean",required:!1,desc:"Don't check if all stacks specified in the command have their dependencies included as well",default:!1}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack or stacks to apply. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for all targeted stacks"}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){l3.Errors.setScope("destroy"),await Ce().destroy(n)}},d3=new VZ;var f3=de(Ve());var I3=de(Ve());var g3=(0,f3.readConfigSync)(),HZ=class extends Ie{constructor(){super(...arguments);this.command="diff [stack]";this.describe="Perform a diff (terraform plan) for the given stack";this.aliases=["plan"];this.builder=n=>n.positional("stack",{desc:"Diff stack which matches the given id only. Required when more than one stack is present in the app",type:"string"}).option("app",{default:g3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:g3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("refresh-only",{default:!1,required:!1,boolean:!0,desc:'Select the "refresh only" planning mode, which checks whether remote objects still match the outcome of the most recent Terraform apply but does not propose any actions to undo any changes made outside of Terraform.'}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).option("var",{type:"array",default:[],required:!1,desc:"Set a value for one of the input variables in the stack. Use this option more than once to set more than one variable."}).option("var-file",{type:"array",default:[],required:!1,desc:"Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file."}).option("no-color",{type:"boolean",default:process.env.FORCE_COLOR==="0",required:!1,desc:"Disables terminal formatting sequences in the output."}).option("migrate-state",{type:"boolean",default:!1,required:!1,desc:"Pass this flag after switching state backends to approve a state migration for the targeted stack"}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){I3.Errors.setScope("diff"),await Ce().diff(n)}},p3=new HZ;var pm=de(Ve());var m3=(0,pm.readConfigSync)(),wZ=class extends Ie{constructor(){super(...arguments);this.command="list";this.describe="List stacks in app.";this.builder=n=>n.option("app",{default:m3.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:m3.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).showHelpOnFail(!0)}async handleCommand(n){pm.Errors.setScope("list"),await Ce().list(n)}},h3=new wZ;var C3=de(Ve());var YZ=class extends Ie{constructor(){super(...arguments);this.command="login";this.describe="Retrieves an API token to connect to Terraform Cloud or Terraform Enterprise.";this.builder=n=>n.showHelpOnFail(!0).option("tfe-hostname",{string:!0,requiresArg:!0,describe:"The Terraform Enterprise hostname to authenticate against. If you use Terraform Cloud you can leave this on the default.",default:"app.terraform.io"}).example("cdktn login","Takes you through the interactive login process").example("cdktn login --tfe-hostname tfe.my-company.com","Takes you through the interactive login process on your companies Terraform Enterprise instance.").example("cat my-token.txt | cdktn login","Uses a locally stored token directly, instead of going through the interactive login process").strict()}async handleCommand(n){C3.Errors.setScope("login"),await Ce().login(n)}},b3=new YZ;var na=de(Ve());var TZ=(0,na.readConfigSync)(),FZ=class extends Ie{constructor(){super(...arguments);this.command="synth";this.describe="Synthesizes Terraform code for the given app in a directory.";this.aliases=["synthesize"];this.builder=n=>n.option("app",{default:TZ.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:TZ.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("check-code-maker-output",{type:"boolean",desc:"Should `codeMakerOutput` existence check be performed? By default it will be checked if providers or modules are configured.",default:(0,na.shouldCheckCodeMakerOutput)(TZ)}).option("hcl",{type:"boolean",desc:"Should the output be in HCL format?",default:!1}).showHelpOnFail(!0)}async handleCommand(n){na.Errors.setScope("synth"),await Ce().synth(n)}},y3=new FZ;var G3=de(Ve());var B3=de(Ve());var A3=(0,G3.readConfigSync)(),XZ=class extends Ie{constructor(){super(...arguments);this.command="watch [stacks..]";this.describe="[experimental] Watch for file changes and automatically trigger a deploy";this.builder=n=>n.positional("stacks",{desc:"Deploy stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:A3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:A3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("auto-approve",{type:"boolean",default:!1,required:!1,desc:"Auto approve"}).option("parallelism",{type:"number",required:!1,desc:"Number of concurrent CDKTN stacks to run. Defaults to infinity, denoted by -1",default:-1}).option("terraform-parallelism",{type:"number",required:!1,desc:"Forwards value as the `-parallelism` flag to Terraform. By default, the this flag is not forwarded to Terraform. Note: This flag is not supported by remote / cloud backend",default:-1}).showHelpOnFail(!0)}async handleCommand(n){B3.Errors.setScope("watch"),await Ce().watch(n)}},v3=new XZ;var mm=de(Ve());var Z3=(0,mm.readConfigSync)(),LZ=class extends Ie{constructor(){super(...arguments);this.command="output [stacks..]";this.describe="Prints the output of stacks";this.aliases=["outputs"];this.builder=n=>n.positional("stacks",{desc:"Get outputs of the stacks matching the given ids. Required when more than one stack is present in the app",type:"string"}).option("app",{default:Z3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:Z3.output,required:!0,desc:"Output directory for the synthesized Terraform config",alias:"o"}).option("outputs-file",{type:"string",required:!1,desc:"Path to file where stack outputs will be written as JSON",requiresArg:!0}).option("outputs-file-include-sensitive-outputs",{type:"boolean",required:!1,desc:"Whether to include sensitive outputs in the output file",default:!1}).option("skip-synth",{type:"boolean",default:!1,required:!1,desc:"Skip synthesis of the application, assume the synthesized Terraform code is already present and up to date"}).option("skip-provider-lock",{type:"boolean",default:!1,required:!1,desc:"Block `terraform provider lock` from being run for any reason. Warning: This may cause issues when used with HCP Terraform"}).showHelpOnFail(!0)}async handleCommand(n){mm.Errors.setScope("output"),await Ce().output(n)}},S3=new LZ;var R3=de(Ve());var kZ=class extends Ie{constructor(){super(...arguments);this.command="debug";this.describe="Get debug information about the current project and environment";this.builder=n=>n.showHelpOnFail(!0).option("json",{default:!1,type:"boolean",desc:"If set, output will be in JSON format."})}async handleCommand(n){R3.Errors.setScope("debug"),await Ce().debug(n)}},W3=new kZ;var Y3=de(require("yargs"));var N3=de(Ve());var KZ=class extends Ie{constructor(){super(...arguments);this.command="add <provider...>";this.describe="Add one or more Terraform providers to your project.";this.builder=n=>n.showHelpOnFail(!0).positional("provider",{type:"string",desc:"Name of the provider to add. Can include a version constraint (e.g. aws@~>4.0).",required:!0}).option("force-local",{type:"boolean",desc:"force local provider installation, even if pre-built provider exists"})}async handleCommand(n){N3.Errors.setScope("provider add"),await Ce().providerAdd(n)}},_3=new KZ;var E3=de(Ve());var UZ=class extends Ie{constructor(){super(...arguments);this.command="upgrade <provider...>";this.describe=`Upgrade one or more Terraform providers in your project to the newest version compatible with your CDKTN version.
|
|
74
74
|
If your project has the associated pre-built provider already installed, CDKTN updates the pre-built provider. Otherwise, CDKTN adds the specified provider to the cdktf.json configuration file and generates local provider bindings.`;this.builder=n=>n.showHelpOnFail(!0).positional("provider",{type:"string",desc:"Name of the provider to upgrade. Can include a version constraint (e.g. aws@~>4.0).",required:!0})}async handleCommand(n){E3.Errors.setScope("provider upgrade"),await Ce().providerUpgrade(n)}},V3=new UZ;var H3=de(Ve());var xZ=class extends Ie{constructor(){super(...arguments);this.command="list [flags]";this.describe="List installed providers";this.builder=n=>n.showHelpOnFail(!0).option("json",{type:"boolean",default:!1,desc:"get providers list as json"})}async handleCommand(n){H3.Errors.setScope("provider list"),await Ce().providerList(n)}},w3=new xZ;var OZ=class{constructor(){this.command="provider";this.describe="A set of subcommands that facilitates provider management";this.builder=t=>t.command(Im).command(_3).command(V3).command(w3);this.handler=()=>{Y3.default.showHelp()}}},T3=new OZ;process.env.NODE_ENV=process.env.NODE_ENV||"production";var oNe=()=>{let e=process.env.TF_PLUGIN_CACHE_DIR||F3.join(X3.homedir(),".terraform.d","plugin-cache");return hm.existsSync(e)||hm.mkdirpSync(e),e};Ur.CDKTF_DISABLE_PLUGIN_CACHE_ENV||(process.env.TF_PLUGIN_CACHE_DIR=oNe());var sNe=function(e,t,n,r){t._.includes("diff")||t._.includes("deploy")||t._.includes("plan")||t._.includes("apply")?n(async(i,o)=>{let s=[];try{let a=await(0,Ur.readCDKTFManifest)();s.push(...Object.values(a.stacks).map(c=>`${c.name}:target stack "${c.name}"`))}finally{r([...o,...s])}}):n()};wi.command(jJ).command(Im).command(r3).command(a3).command(d3).command(p3).command(h3).command(b3).command(y3).command(v3).command(S3).command(W3).command(T3).recommendCommands().exitProcess(!1).wrap(wi.terminalWidth()).showHelpOnFail(!1).env("CDKTF").epilogue('Options can be specified via environment variables with the "CDKTF_" prefix (e.g. "CDKTF_OUTPUT")').help().alias("h","help").option("experimental-provider-schema-cache-path",{type:"string",default:!1,required:!1,desc:"An experimental schema cache that can be used to improve the speed of cdktn get and convert. Supported using the env CDKTF_EXPERIMENTAL_PROVIDER_SCHEMA_CACHE_PATH."}).option("disable-plugin-cache-env",{type:"boolean",default:!1,required:!1,desc:"Dont set TF_PLUGIN_CACHE_DIR automatically. This is useful when the plugin cache is configured differently. Supported using the env CDKTF_DISABLE_PLUGIN_CACHE_ENV."}).option("log-level",{type:"string",required:!1,desc:"Which log level should be written. Only supported via setting the env CDKTF_LOG_LEVEL"}).option("log-file-directory",{require:!1,desc:"The directory path where CDKTN should create `cdktf.log` and print logs at the `debug` level. If not set, CDKTF writes logs to standard out at the level specified in `CDKTF_LOG_LEVEL`. Only supported via setting the env CDKTF_LOG_FILE_DIRECTORY"}).option("context-json",{required:!1,hidden:!0,desc:"Used internally for env variable"}).completion("completion",sNe).parserConfiguration({"boolean-negation":!1}).command({command:"*",handler:e=>{let t=e._[0];t!=="completion"&&(console.error(t?`Could not find command "${t}", here are all available ones:`:"Please pass a command to cdktn, here are all available ones:"),wi.showHelp(),process.exit(1))}}).fail(async(e,t)=>{if(wi.exit(1,t),e&&console.log(e),(0,Ur.IsErrorType)(t,"Usage")||(0,Ur.IsErrorType)(t,"External"))console.error(t.message);else if(t){console.error(t.message),console.error(t.stack),console.error("Collecting Debug Information...");let n=await(0,Ur.collectDebugInformation)();console.error("Debug Information:"),Object.entries(n).forEach(([r,i])=>{console.log(`${r}: ${i===null?"null":i}`)})}await L3.close(4e3),process.exit(1)}).argv;
|
|
75
75
|
/*! Bundled license information:
|
|
76
76
|
|