cdktn-cli 0.25.0-pre.40 → 0.25.0-pre.42
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 +2 -2
- package/bundle/bin/cdktn.js.map +2 -2
- package/bundle/bin/cmds/handlers.js +148 -148
- package/bundle/bin/cmds/handlers.js.map +3 -3
- package/package.json +9 -9
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?{[dZ.TARGET_VERSIONS_CONTEXT_KEY]:r.targetVersions}:{}};return Object.keys(o).length>0&&(i2e.env[s2e]=JSON.stringify(o)),r};he.parseConfig=c2e;function u2e(e=xO.join(process.cwd(),OO)){let t;return kO.existsSync(e)&&(t=kO.readFileSync(e).toString()),(0,he.parseConfig)(t)}function l2e(e){return qp(e.terraformModules)||qp(e.terraformProviders)}function d2e(e){UO.logger.debug(`Start timer for ${e}...`);let t=Date.now();return function(){let i=Date.now()-t;UO.logger.debug(`${e} took ${i}ms`)}}});var DO=g((kFe,MO)=>{"use strict";MO.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 PO=g((UFe,qO)=>{"use strict";var g2e=DO();qO.exports=e=>typeof e=="string"?e.replace(g2e(),""):e});var ia=g(Ze=>{"use strict";var f2e=Ze&&Ze.__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=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),em=Ze&&Ze.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&f2e(n,t,r[i]);return I2e(n,t),n}})(),p2e=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.HttpError=Ze.exec=void 0;Ze.shell=y2e;Ze.withTempDir=A2e;Ze.mkdtemp=G2e;Ze.readCDKTFVersion=v2e;Ze.readCDKTFManifest=Z2e;Ze.downcaseFirst=S2e;Ze.downloadFile=R2e;Ze.ensureAllSettledBeforeThrowing=W2e;Ze.hasNoColorFlagOrEnv=QO;var m2e=_9(),wn=em(Fn()),zO=F9(),jO=em(require("os")),Sd=em(require("path")),Qp=Fo(),h2e=require("cdktn"),C2e=em(jp()),Zd=p2e(PO());function b2e(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 y2e(e,t=[],n={}){return(0,Ze.exec)(e,t,n,r=>{let i=n.noColor?(0,Zd.default)(r.toLocaleString()):r.toLocaleString();console.log(i)},()=>{})}async function A2e(e,t){let n=process.cwd(),r=await wn.mkdtemp(Sd.join(jO.tmpdir(),"cdktf.")),i=Sd.join(r,e);await wn.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(n),await wn.remove(r)}}async function G2e(e){let t=await wn.mkdtemp(Sd.join(jO.tmpdir(),"cdktf."));try{await e(t)}finally{await wn.remove(t)}}var B2e=async(e,t,n,r,i,o=!0)=>{typeof n.noColor!="boolean"&&QO()&&(n.noColor=!0);let{signal:s,logStderrAsDebug:a,...c}=n,u=a?Qp.processLoggerDebug:Qp.processLoggerError;return new Promise((l,d)=>{var f,I,m,C;let y=(0,m2e.spawn)(e,t,c),Z=new Array,V=new Array;r!==void 0?(f=y.stdout)===null||f===void 0||f.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();(0,Qp.processLoggerDebug)(M),Z.push(M),r(M)}):(I=y.stdout)===null||I===void 0||I.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();(0,Qp.processLoggerDebug)(M),Z.push(M)}),i!==void 0?(m=y.stderr)===null||m===void 0||m.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();u(M),o&&i(M),V.push(M)}):(C=y.stderr)===null||C===void 0||C.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();u(M),o&&process.stderr.write(M),V.push(M)}),y.once("error",_=>d(_)),y.once("close",_=>{if(_!==0){let M=new Error(`${e} ${t.join(" ")} exited with code ${_}`);return b2e(M,V.join(""),Z.join("")),d(M)}return l(Z.join(""))})})};Ze.exec=B2e;async function v2e(e){let t=Sd.join(e,"cdk.tf.json");if(wn.existsSync(t)){let n=wn.readFileSync(t,"utf8");return JSON.parse(n)["//"].metadata.version}return""}async function Z2e(){let{output:e}=C2e.readConfigSync(),t=await wn.readFile(Sd.join(e,h2e.Manifest.fileName));return JSON.parse(t.toString())}function S2e(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}var $p=class extends Error{constructor(t,n){super(t),this.statusCode=n,Object.setPrototypeOf(this,new.target.prototype)}};Ze.HttpError=$p;async function R2e(e,t){let n=e.startsWith("http://")?zO.http:zO.https,r=wn.createWriteStream(t);return new Promise((i,o)=>{let s=n.get(e,a=>{if(a.statusCode!==200){o(new $p(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(r)});r.on("finish",()=>i()),s.on("error",a=>{wn.unlink(t,()=>o(a))}),r.on("error",a=>{wn.unlink(t,()=>o(a))}),s.end()})}async function W2e(e,t){try{await e}catch(n){throw await Promise.allSettled(t),n}}function QO(){return N2e("no-color")||process.env.FORCE_COLOR==="0"}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 Fo=g(pt=>{"use strict";var _2e=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]})),E2e=pt&&pt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fZ=pt&&pt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&_2e(n,t,r[i]);return E2e(n,t),n}})();Object.defineProperty(pt,"__esModule",{value:!0});pt.logFileName=pt.processLoggerError=pt.processLoggerDebug=pt.logger=void 0;var gZ=U1(),$O=fZ(Fn()),V2e=fZ(require("path")),oa=fZ(wI()),H2e=ia(),kr=(0,gZ.getLogger)(),IZ={trace(e,...t){kr.trace(e,...t),oa.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){kr.debug(e,...t),oa.addBreadcrumb({message:e,level:"debug"})},info(e,...t){kr.info(e,...t),oa.addBreadcrumb({message:e,level:"info"})},warn(e,...t){kr.warn(e,...t),oa.addBreadcrumb({message:e,level:"warning"})},error(e,...t){kr.error(e,...t),oa.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){kr.fatal(e,...t),oa.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){kr.level=e},useDefaultLevel(){kr.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};pt.logger=IZ;kr.level=process.env.CDKTF_LOG_LEVEL||"INFO";var eJ="cdktf.log";pt.logFileName=eJ;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&$O.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&$O.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,gZ.configure)({appenders:{cdktf:{type:"file",filename:V2e.join(process.env.CDKTF_LOG_FILE_DIRECTORY,eJ)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,H2e.hasNoColorFlagOrEnv)()?"basic":"colored";(0,gZ.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var w2e=e=>{IZ.debug(e.toString())};pt.processLoggerDebug=w2e;var Y2e=e=>{IZ.error(e.toString())};pt.processLoggerError=Y2e});var tJ=g((JFe,T2e)=>{T2e.exports={name:"@cdktn/commons",version:"0.25.0-pre.
|
|
69
|
+
${r}`}}async function y2e(e,t=[],n={}){return(0,Ze.exec)(e,t,n,r=>{let i=n.noColor?(0,Zd.default)(r.toLocaleString()):r.toLocaleString();console.log(i)},()=>{})}async function A2e(e,t){let n=process.cwd(),r=await wn.mkdtemp(Sd.join(jO.tmpdir(),"cdktf.")),i=Sd.join(r,e);await wn.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(n),await wn.remove(r)}}async function G2e(e){let t=await wn.mkdtemp(Sd.join(jO.tmpdir(),"cdktf."));try{await e(t)}finally{await wn.remove(t)}}var B2e=async(e,t,n,r,i,o=!0)=>{typeof n.noColor!="boolean"&&QO()&&(n.noColor=!0);let{signal:s,logStderrAsDebug:a,...c}=n,u=a?Qp.processLoggerDebug:Qp.processLoggerError;return new Promise((l,d)=>{var f,I,m,C;let y=(0,m2e.spawn)(e,t,c),Z=new Array,V=new Array;r!==void 0?(f=y.stdout)===null||f===void 0||f.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();(0,Qp.processLoggerDebug)(M),Z.push(M),r(M)}):(I=y.stdout)===null||I===void 0||I.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();(0,Qp.processLoggerDebug)(M),Z.push(M)}),i!==void 0?(m=y.stderr)===null||m===void 0||m.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();u(M),o&&i(M),V.push(M)}):(C=y.stderr)===null||C===void 0||C.on("data",_=>{let M=n.noColor?(0,Zd.default)(_.toLocaleString()):_.toLocaleString();u(M),o&&process.stderr.write(M),V.push(M)}),y.once("error",_=>d(_)),y.once("close",_=>{if(_!==0){let M=new Error(`${e} ${t.join(" ")} exited with code ${_}`);return b2e(M,V.join(""),Z.join("")),d(M)}return l(Z.join(""))})})};Ze.exec=B2e;async function v2e(e){let t=Sd.join(e,"cdk.tf.json");if(wn.existsSync(t)){let n=wn.readFileSync(t,"utf8");return JSON.parse(n)["//"].metadata.version}return""}async function Z2e(){let{output:e}=C2e.readConfigSync(),t=await wn.readFile(Sd.join(e,h2e.Manifest.fileName));return JSON.parse(t.toString())}function S2e(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}var $p=class extends Error{constructor(t,n){super(t),this.statusCode=n,Object.setPrototypeOf(this,new.target.prototype)}};Ze.HttpError=$p;async function R2e(e,t){let n=e.startsWith("http://")?zO.http:zO.https,r=wn.createWriteStream(t);return new Promise((i,o)=>{let s=n.get(e,a=>{if(a.statusCode!==200){o(new $p(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(r)});r.on("finish",()=>i()),s.on("error",a=>{wn.unlink(t,()=>o(a))}),r.on("error",a=>{wn.unlink(t,()=>o(a))}),s.end()})}async function W2e(e,t){try{await e}catch(n){throw await Promise.allSettled(t),n}}function QO(){return N2e("no-color")||process.env.FORCE_COLOR==="0"}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 Fo=g(pt=>{"use strict";var _2e=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]})),E2e=pt&&pt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fZ=pt&&pt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&_2e(n,t,r[i]);return E2e(n,t),n}})();Object.defineProperty(pt,"__esModule",{value:!0});pt.logFileName=pt.processLoggerError=pt.processLoggerDebug=pt.logger=void 0;var gZ=U1(),$O=fZ(Fn()),V2e=fZ(require("path")),oa=fZ(wI()),H2e=ia(),kr=(0,gZ.getLogger)(),IZ={trace(e,...t){kr.trace(e,...t),oa.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){kr.debug(e,...t),oa.addBreadcrumb({message:e,level:"debug"})},info(e,...t){kr.info(e,...t),oa.addBreadcrumb({message:e,level:"info"})},warn(e,...t){kr.warn(e,...t),oa.addBreadcrumb({message:e,level:"warning"})},error(e,...t){kr.error(e,...t),oa.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){kr.fatal(e,...t),oa.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){kr.level=e},useDefaultLevel(){kr.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};pt.logger=IZ;kr.level=process.env.CDKTF_LOG_LEVEL||"INFO";var eJ="cdktf.log";pt.logFileName=eJ;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&$O.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&$O.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,gZ.configure)({appenders:{cdktf:{type:"file",filename:V2e.join(process.env.CDKTF_LOG_FILE_DIRECTORY,eJ)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,H2e.hasNoColorFlagOrEnv)()?"basic":"colored";(0,gZ.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var w2e=e=>{IZ.debug(e.toString())};pt.processLoggerDebug=w2e;var Y2e=e=>{IZ.error(e.toString())};pt.processLoggerError=Y2e});var tJ=g((JFe,T2e)=>{T2e.exports={name:"@cdktn/commons",version:"0.25.0-pre.42",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:"bash package.sh","dist-clean":"rm -rf dist","package:js":"bash 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.140.0","cross-spawn":"7.0.6","follow-redirects":"1.16.0","fs-extra":"11.3.6",log4js:"6.9.1",semver:"7.8.5","strip-ansi":"6.0.1",validator:"13.15.35"},devDependencies:{"@types/node":"22.20.1","@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:"~6.0.0"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var Rd=g(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.DISPLAY_VERSION=void 0;tm.DISPLAY_VERSION=`${F2e()}`;function F2e(){return tJ().version.replace(/\+[0-9a-f]+$/,"")}});var mZ=g(Ot=>{"use strict";var X2e=Ot&&Ot.__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]})),L2e=Ot&&Ot.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),im=Ot&&Ot.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&X2e(n,t,r[i]);return L2e(n,t),n}})(),K2e=Ot&&Ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.sendTelemetry=q2e;Ot.getProjectId=sJ;Ot.getUserId=aJ;Ot.ReportRequest=cJ;var k2e=im(require("https")),U2e=require("url"),iJ=require("node:crypto"),rm=im(require("os")),nJ=K2e(BY()),pZ=Fo(),Wd=im(require("path")),nm=im(Fn()),x2e=Rd(),O2e="https://checkpoint-api.hashicorp.com/v1/",J2e=[200,201],rJ=8192;function M2e(){var e;return process.env.CDKTF_HOME?Wd.resolve(process.env.CDKTF_HOME):Wd.join(((e=rm.userInfo().homedir)!==null&&e!==void 0?e:rm.homedir()).trim()||"/",".cdktf")}async function D2e(e,t){return new Promise((n,r)=>{let i=k2e.request((0,U2e.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(!J2e.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 q2e(e,t){let n={command:e,product:"cdktn",version:`${x2e.DISPLAY_VERSION}`,dateTime:new Date,language:t.language,payload:t};try{await cJ(n)}catch(r){pZ.logger.error(`Could not send telemetry data: ${r}`)}}function oJ(e,t,n=!1,r){let i=(0,iJ.randomUUID)(),o;try{o=JSON.parse(nm.readFileSync(e,"utf-8"))}catch{if(n){let a={};r&&(a["//"]=r.replace(/\n/g," ")),a[t]=i,nm.ensureDirSync(Wd.dirname(e)),nm.writeFileSync(e,JSON.stringify(a,null,2))}return i}return o[t]?o[t]:(nm.writeFileSync(e,JSON.stringify({...o,[t]:i},null,2)),i)}function sJ(e=process.cwd()){return oJ(Wd.resolve(e,"cdktf.json"),"projectId")}function aJ(){return oJ(Wd.resolve(M2e(),"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.`)}async function cJ(e){if(process.env.CHECKPOINT_DISABLE)return;e.runID||(e.runID=(0,iJ.randomUUID)()),e.dateTime||(e.dateTime=new Date),e.arch||(e.arch=rm.arch()),e.os||(e.os=rm.platform());let t=nJ.default.isCI?nJ.default.name||"unknown":!1;!e.userId&&!t&&(e.userId=aJ()),t&&(e.ci=t),e.projectId=e.projectId||sJ();let n=JSON.stringify(e);if(n.length>rJ){pZ.logger.warn(`Skipped sending telemetry as the request body size was ${n.length} bytes. The limit is ${rJ} bytes`);return}try{await D2e(`${O2e}telemetry/${e.product}`,n)}catch(r){(0,pZ.processLoggerError)(r.message)}}});var uJ=g(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.ConstructsMakerProviderTarget=wi.ConstructsMakerModuleTarget=wi.ConstructsMakerTarget=void 0;var gr=jp(),Nd=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 om(t,n):new sm(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,"_")}};wi.ConstructsMakerTarget=Nd;var om=class extends Nd{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,"_")}};wi.ConstructsMakerModuleTarget=om;var sm=class extends Nd{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,"_")}};wi.ConstructsMakerProviderTarget=sm});var CZ=g(Yn=>{"use strict";var P2e=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]})),z2e=Yn&&Yn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),j2e=Yn&&Yn.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&P2e(n,t,r[i]);return z2e(n,t),n}})();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.Errors=void 0;Yn.IsErrorType=nNe;var Q2e=mZ(),$2e=Rd(),eNe=j2e(wI());async function tNe(e,t){let n={command:e,product:"cdktn",version:`${$2e.DISPLAY_VERSION}`,dateTime:new Date,payload:t};await(0,Q2e.ReportRequest)(n)}function nNe(e,t){return e&&e.__type===t}function hZ(e,t){return(n,r=new Error,i)=>{tNe(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 am="unknown";Yn.Errors={Internal:hZ("Internal",am),Usage:hZ("Usage",am),External:hZ("External",am),setScope(e){am=e,eNe.configureScope(t=>t.setTransactionName(e))}}});var bZ=g(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.terraformVersion=Ur.parseTerraformCliVersion=Ur.terraformBinaryName=void 0;var rNe=CZ(),iNe=ia();Ur.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";var oNe=require("cdktn/lib/validations");Object.defineProperty(Ur,"parseTerraformCliVersion",{enumerable:!0,get:function(){return oNe.parseTerraformCliVersion}});Ur.terraformVersion=(0,iNe.exec)(Ur.terraformBinaryName,["version","-json"],{}).then(e=>JSON.parse(e).terraform_version).catch(e=>rNe.Errors.Usage(`Unknown: Error loading terraform version ${e}`,e))});var yZ=g(xr=>{"use strict";var lJ=xr&&xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xr,"__esModule",{value:!0});xr.isGradleProject=aNe;xr.getGradleDependencies=gJ;xr.getDependencyInformationFromLine=fJ;xr.getGradlePackageVersion=cNe;xr.getGradlePackageVersionFromBuild=IJ;var dJ=lJ(require("path")),cm=lJ(Fn()),Yi=Fo(),sNe=ia();function aNe(e){let t=dJ.default.join(e,"build.gradle");try{return cm.default.accessSync(t,cm.default.constants.R_OK|cm.default.constants.W_OK),!0}catch{return Yi.logger.debug(`No build.gradle found at ${t}`),!1}}async function gJ(){let e;try{e=await(0,sNe.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(I){Yi.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){Yi.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){Yi.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,""))}function fJ(e){let t=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,n=e.match(t);if(!n){Yi.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]}}async function cNe(e){let n={jsii:"jsii-runtime"}[e]||e;Yi.logger.debug("Running 'gradle dependencies' to find package version",n);let r=await gJ();if(!r||r.length===0)return;for(let o of r)if(o.includes(`:${n}:`)){let s=fJ(o);return s?s.version:void 0}let i=await IJ(e);if(i)return i.version}async function IJ(e){let t=dJ.default.join(process.cwd(),"build.gradle"),r=(await cm.default.readFile(t,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(r.findIndex(f=>i.test(f))===-1){Yi.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=r.findIndex(f=>f.includes(e));if(s===-1){Yi.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]}}});var WJ=g(xe=>{"use strict";var uNe=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]})),lNe=xe&&xe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),mJ=xe&&xe.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&uNe(n,t,r[i]);return lNe(n,t),n}})();Object.defineProperty(xe,"__esModule",{value:!0});xe.getLanguage=CJ;xe.getDotnetVersion=bJ;xe.getJavaVersion=yJ;xe.getMavenVersion=AJ;xe.getGradleVersion=GJ;xe.getPythonVersion=BJ;xe.getPipVersion=vJ;xe.getPipenvVersion=ZJ;xe.getGoVersion=SJ;xe.getNodeVersion=RJ;xe.getPackageVersion=_d;xe.collectDebugInformation=GNe;var dNe=mJ(require("path")),AZ=mJ(require("os")),De=Fo(),fr=ia(),gNe=bZ(),fNe=Rd(),hJ=Fn(),pJ=yZ();function CJ(e=process.cwd()){try{return JSON.parse((0,hJ.readFileSync)(dNe.resolve(e,"cdktf.json"),"utf-8")).language}catch{De.logger.debug(`Unable to detect language in ${e}`);return}}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){De.logger.debug(`Failed to run ${e} ${t}: ${r}`);return}}function bJ(){return Ir("dotnet","--version")}function yJ(){return Ir("java","-version")}function AJ(){return Ir("mvn","--version")}function GJ(){return Ir("gradle","--version")}async function BJ(){return await Ir("python3","--version")||await Ir("python","--version")}function vJ(){return Ir("pip","--version")}function ZJ(){return Ir("pipenv","--version")}function SJ(){return Ir("go","version")}function RJ(){return Ir("node","--version")}async function INe(e){return await(0,hJ.pathExists)("pnpm-lock.yaml")?pNe(e):mNe(e)}async function pNe(e){var t,n,r;let i;try{i=await(0,fr.exec)("pnpm",["list",e,"--json"],{env:{...process.env}})}catch(s){De.logger.debug(`Unable to run 'pnpm list ${e} --json': ${s}`);return}let o;try{o=JSON.parse(i)}catch(s){De.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)){De.logger.debug(`Unable to find '${e}' in 'pnpm list ${e} --json': ${i}`);return}return o[0].dependencies[e].version}async function mNe(e){let t;try{t=await(0,fr.exec)("npm",["list",e,"--json","--include=dev"],{env:{...process.env}})}catch(r){De.logger.debug(`Unable to run 'npm list ${e} --json': ${r}`);return}let n;try{n=JSON.parse(t)}catch(r){De.logger.debug(`Unable to parse output of 'npm list ${e} --json': ${r}`);return}if(!n.dependencies||!n.dependencies[e]||!n.dependencies[e].version){De.logger.debug(`Unable to find '${e}' in 'npm list ${e} --json': ${t}`);return}return n.dependencies[e].version}async function hNe(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){De.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){De.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){De.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 CNe(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){De.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){De.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 bNe(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){De.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){De.logger.debug(`Unable to find version for '${r}' in output of 'go list -m all': ${i}`);return}return o.includes("=>")&&(De.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 yNe(e){let n={jsii:"jsii-runtime"}[e]||e,r;try{r=await(0,fr.exec)("mvn",["dependency:list"],{env:process.env})}catch(l){De.logger.debug(`Unable to run 'mvn dependency:list': ${l}`);return}let i=r.split("The following files have been resolved")[1];if(!i){De.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){De.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 ANe(e){return(0,pJ.isGradleProject)("./")?(0,pJ.getGradlePackageVersion)(e):yNe(e)}async function _d(e,t){let n=async()=>{},i=await({typescript:INe,python:hNe,go:bNe,csharp:CNe,java:ANe}[e]||n)(t);return i??void 0}async function GNe(){var e,t,n,r,i,o,s,a,c,u,l,d,f;let I={},m=CJ();I.language=m??null,I["cdktn-cli"]=fNe.DISPLAY_VERSION;let C=RJ();if(I.node=(e=await C)!==null&&e!==void 0?e:null,m){let y=_d(m,"cdktn"),Z=_d(m,"cdktf"),V=_d(m,"constructs"),_=_d(m,"jsii");I.cdktn=(t=await y)!==null&&t!==void 0?t:null,I.cdktf=(n=await Z)!==null&&n!==void 0?n:null,I.constructs=(r=await V)!==null&&r!==void 0?r:null,I.jsii=(i=await _)!==null&&i!==void 0?i:null}switch(I.terraform=await gNe.terraformVersion,I.arch=AZ.arch(),I.os=`${AZ.platform()} ${AZ.release()}`,m){case"python":{let y=BJ(),Z=vJ(),V=ZJ();I.python=(o=await y)!==null&&o!==void 0?o:null,I.pip=(s=await Z)!==null&&s!==void 0?s:null,I.pipenv=(a=await V)!==null&&a!==void 0?a:null}break;case"java":{let y=yJ(),Z=AJ(),V=GJ();I.java=(c=await y)!==null&&c!==void 0?c:null,I.maven=(u=await Z)!==null&&u!==void 0?u:null,I.gradle=(l=await V)!==null&&l!==void 0?l:null}break;case"csharp":I.dotnet=(d=await bJ())!==null&&d!==void 0?d:null;break;case"go":I.go=(f=await SJ())!==null&&f!==void 0?f:null;break}return I}});var _J=g(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CDKTF_DISABLE_PLUGIN_CACHE_ENV=Ti.CHECKPOINT_DISABLE=Ti.DISABLE_VERSION_CHECK=void 0;function NJ(e){return e==="true"||e==="1"}Ti.DISABLE_VERSION_CHECK=NJ(process.env.DISABLE_VERSION_CHECK);Ti.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;Ti.CDKTF_DISABLE_PLUGIN_CACHE_ENV=NJ(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var VJ=g(EJ=>{"use strict";Object.defineProperty(EJ,"__esModule",{value:!0})});var wJ=g(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.isAttributeNestedType=HJ;um.isNestedTypeAttribute=BNe;function HJ(e){return typeof e=="object"&&!Array.isArray(e)&&typeof e.nesting_mode=="string"&&(typeof e.attributes=="object"||typeof e.attributes>"u")}function BNe(e){return typeof e.nested_type<"u"&&HJ(e.nested_type)}});var YJ=g(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.OPENTOFU_REGISTRY=Or.TERRAFORM_REGISTRY=void 0;Or.registryForTargetVersions=vNe;Or.TERRAFORM_REGISTRY={hostname:"registry.terraform.io",browseUrl:"https://registry.terraform.io/browse/providers",docsUrl(e,t,n,r,i){let o=`https://registry.terraform.io/providers/${e}/${t}/${n}/docs`;switch(r){case"provider":return o;case"resource":return`${o}/resources/${i}`;case"data-source":return`${o}/data-sources/${i}`;case"ephemeral-resource":return`${o}/ephemeral-resources/${i}`}}};Or.OPENTOFU_REGISTRY={hostname:"registry.opentofu.org",browseUrl:"https://search.opentofu.org/providers",docsUrl(e,t,n,r,i){let o=`https://search.opentofu.org/provider/${e}/${t}/v${n}/docs`;switch(r){case"provider":case"ephemeral-resource":return o;case"resource":return`${o}/resources/${i}`;case"data-source":return`${o}/datasources/${i}`}}};function vNe(e){return e?.opentofu!==void 0&&e?.terraform===void 0?Or.OPENTOFU_REGISTRY:Or.TERRAFORM_REGISTRY}});var Ee=g(Te=>{"use strict";var ZNe=Te&&Te.__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]})),Rt=Te&&Te.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ZNe(t,e,n)};Object.defineProperty(Te,"__esModule",{value:!0});Rt(mZ(),Te);Rt(uJ(),Te);Rt(jp(),Te);Rt(WJ(),Te);Rt(_J(),Te);Rt(CZ(),Te);Rt(yZ(),Te);Rt(Fo(),Te);Rt(VJ(),Te);Rt(wJ(),Te);Rt(YJ(),Te);Rt(Mv(),Te);Rt(bZ(),Te);Rt(ia(),Te);Rt(Rd(),Te)});var FJ=g((iXe,GZ)=>{"use strict";var TJ=require("fs");GZ.exports=e=>new Promise(t=>{TJ.access(e,n=>{t(!n)})});GZ.exports.sync=e=>{try{return TJ.accessSync(e),!0}catch{return!1}}});var LJ=g((oXe,BZ)=>{"use strict";var XJ=(e,...t)=>new Promise(n=>{n(e(...t))});BZ.exports=XJ;BZ.exports.default=XJ});var kJ=g((sXe,vZ)=>{"use strict";var SNe=LJ(),KJ=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=SNe(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};vZ.exports=KJ;vZ.exports.default=KJ});var OJ=g((aXe,xJ)=>{"use strict";var UJ=kJ(),lm=class extends Error{constructor(t){super(),this.value=t}},RNe=(e,t)=>Promise.resolve(e).then(t),WNe=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=UJ(n.concurrency),i=[...e].map(s=>[s,r(RNe,s,t)]),o=UJ(n.preserveOrder?1:1/0);return Promise.all(i.map(s=>o(WNe,s))).then(()=>{}).catch(s=>s instanceof lm?s.value:Promise.reject(s))}});var DJ=g((cXe,ZZ)=>{"use strict";var JJ=require("path"),MJ=FJ(),NNe=OJ();ZZ.exports=(e,t)=>(t=Object.assign({cwd:process.cwd()},t),NNe(e,n=>MJ(JJ.resolve(t.cwd,n)),t));ZZ.exports.sync=(e,t)=>{t=Object.assign({cwd:process.cwd()},t);for(let n of e)if(MJ.sync(JJ.resolve(t.cwd,n)))return n}});var PJ=g((uXe,SZ)=>{"use strict";var Fi=require("path"),qJ=DJ();SZ.exports=(e,t={})=>{let n=Fi.resolve(t.cwd||""),{root:r}=Fi.parse(n),i=[].concat(e);return new Promise(o=>{(function s(a){qJ(i,{cwd:a}).then(c=>{c?o(Fi.join(a,c)):a===r?o(null):s(Fi.dirname(a))})})(n)})};SZ.exports.sync=(e,t={})=>{let n=Fi.resolve(t.cwd||""),{root:r}=Fi.parse(n),i=[].concat(e);for(;;){let o=qJ.sync(i,{cwd:n});if(o)return Fi.join(n,o);if(n===r)return null;n=Fi.dirname(n)}}});var jJ=g((lXe,RZ)=>{"use strict";var zJ=PJ();RZ.exports=async({cwd:e}={})=>zJ("package.json",{cwd:e});RZ.exports.sync=({cwd:e}={})=>zJ.sync("package.json",{cwd:e})});var Xi=ue(require("yargs")),U3=ue(require("path")),x3=ue(require("os")),hm=ue(Fn()),O3=ue(wI()),Jr=ue(Ee());var gm=ue(Fn()),$J=require("node:module"),dm=ue(require("path")),WZ=ue(jJ()),QJ=(0,$J.createRequire)(__filename),e3=()=>{let e=WZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return JSON.parse(gm.readFileSync(e,"utf-8"))},_Ne=()=>{let e=WZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return dm.default.dirname(e)},pe=()=>{let e=dm.default.join(__dirname,"..","handlers.js");return gm.existsSync(e)?QJ(e):QJ(dm.default.join(_Ne(),"bundle","bin","cmds","handlers.js"))};var t3=ue(Ee());var de=class{constructor(){this.handler=async t=>{t.getYargsCompletions||await this.handleCommand(t)}}};var ENe=e3(),NZ=class extends de{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:ENe.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){t3.Errors.setScope("init"),await pe().init(n)}},n3=new NZ;var fm=ue(Ee());var i3=ue(Ee());var r3=(0,fm.readConfigSync)(),_Z=class extends de{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:r3.codeMakerOutput,type:"string",desc:"Output directory for generated Constructs",alias:"o"}).option("language",{default:r3.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){i3.Errors.setScope("get"),await pe().get(n)}},Im=new _Z;var o3=ue(Ee());var s3=ue(require("path")),a3=ue(Fn());function VNe(e=process.cwd()){try{let t=s3.join(e,"cdktf.json");return a3.readJsonSync(t)}catch{return}}var EZ=class extends de{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:VNe()?.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){o3.Errors.setScope("convert");let r=pe();n.withProject!==void 0&&(n.language==="typescript"?n.withProject=!1:n.withProject=!0),await r.convert(n)}},c3=new EZ;var l3=ue(Ee());var d3=ue(Ee());var u3=(0,l3.readConfigSync)(),VZ=class extends de{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:u3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:u3.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){d3.Errors.setScope("deploy"),await pe().deploy(n)}},g3=new VZ;var I3=ue(Ee());var p3=ue(Ee());var f3=(0,I3.readConfigSync)(),HZ=class extends de{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:f3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:f3.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){p3.Errors.setScope("destroy"),await pe().destroy(n)}},m3=new HZ;var C3=ue(Ee());var b3=ue(Ee());var h3=(0,C3.readConfigSync)(),wZ=class extends de{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:h3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:h3.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){b3.Errors.setScope("diff"),await pe().diff(n)}},y3=new wZ;var pm=ue(Ee());var A3=(0,pm.readConfigSync)(),YZ=class extends de{constructor(){super(...arguments);this.command="list";this.describe="List stacks in app.";this.builder=n=>n.option("app",{default:A3.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:A3.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).showHelpOnFail(!0)}async handleCommand(n){pm.Errors.setScope("list"),await pe().list(n)}},G3=new YZ;var B3=ue(Ee());var TZ=class extends de{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){B3.Errors.setScope("login"),await pe().login(n)}},v3=new TZ;var sa=ue(Ee());var FZ=(0,sa.readConfigSync)(),XZ=class extends de{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:FZ.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:FZ.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,sa.shouldCheckCodeMakerOutput)(FZ)}).option("hcl",{type:"boolean",desc:"Should the output be in HCL format?",default:!1}).showHelpOnFail(!0)}async handleCommand(n){sa.Errors.setScope("synth"),await pe().synth(n)}},Z3=new XZ;var R3=ue(Ee());var W3=ue(Ee());var S3=(0,R3.readConfigSync)(),LZ=class extends de{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:S3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:S3.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){W3.Errors.setScope("watch"),await pe().watch(n)}},N3=new LZ;var mm=ue(Ee());var _3=(0,mm.readConfigSync)(),KZ=class extends de{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:_3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:_3.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 pe().output(n)}},E3=new KZ;var V3=ue(Ee());var kZ=class extends de{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){V3.Errors.setScope("debug"),await pe().debug(n)}},H3=new kZ;var K3=ue(require("yargs"));var w3=ue(Ee());var UZ=class extends de{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){w3.Errors.setScope("provider add"),await pe().providerAdd(n)}},Y3=new UZ;var T3=ue(Ee());var xZ=class extends de{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.`)}async function cJ(e){if(process.env.CHECKPOINT_DISABLE)return;e.runID||(e.runID=(0,iJ.randomUUID)()),e.dateTime||(e.dateTime=new Date),e.arch||(e.arch=rm.arch()),e.os||(e.os=rm.platform());let t=nJ.default.isCI?nJ.default.name||"unknown":!1;!e.userId&&!t&&(e.userId=aJ()),t&&(e.ci=t),e.projectId=e.projectId||sJ();let n=JSON.stringify(e);if(n.length>rJ){pZ.logger.warn(`Skipped sending telemetry as the request body size was ${n.length} bytes. The limit is ${rJ} bytes`);return}try{await D2e(`${O2e}telemetry/${e.product}`,n)}catch(r){(0,pZ.processLoggerError)(r.message)}}});var uJ=g(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.ConstructsMakerProviderTarget=wi.ConstructsMakerModuleTarget=wi.ConstructsMakerTarget=void 0;var gr=jp(),Nd=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 om(t,n):new sm(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,"_")}};wi.ConstructsMakerTarget=Nd;var om=class extends Nd{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,"_")}};wi.ConstructsMakerModuleTarget=om;var sm=class extends Nd{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,"_")}};wi.ConstructsMakerProviderTarget=sm});var CZ=g(Yn=>{"use strict";var P2e=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]})),z2e=Yn&&Yn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),j2e=Yn&&Yn.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&P2e(n,t,r[i]);return z2e(n,t),n}})();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.Errors=void 0;Yn.IsErrorType=nNe;var Q2e=mZ(),$2e=Rd(),eNe=j2e(wI());async function tNe(e,t){let n={command:e,product:"cdktn",version:`${$2e.DISPLAY_VERSION}`,dateTime:new Date,payload:t};await(0,Q2e.ReportRequest)(n)}function nNe(e,t){return e&&e.__type===t}function hZ(e,t){return(n,r=new Error,i)=>{tNe(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 am="unknown";Yn.Errors={Internal:hZ("Internal",am),Usage:hZ("Usage",am),External:hZ("External",am),setScope(e){am=e,eNe.configureScope(t=>t.setTransactionName(e))}}});var bZ=g(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.terraformVersion=Ur.parseTerraformCliVersion=Ur.terraformBinaryName=void 0;var rNe=CZ(),iNe=ia();Ur.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";var oNe=require("cdktn/lib/validations");Object.defineProperty(Ur,"parseTerraformCliVersion",{enumerable:!0,get:function(){return oNe.parseTerraformCliVersion}});Ur.terraformVersion=(0,iNe.exec)(Ur.terraformBinaryName,["version","-json"],{}).then(e=>JSON.parse(e).terraform_version).catch(e=>rNe.Errors.Usage(`Unknown: Error loading terraform version ${e}`,e))});var yZ=g(xr=>{"use strict";var lJ=xr&&xr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xr,"__esModule",{value:!0});xr.isGradleProject=aNe;xr.getGradleDependencies=gJ;xr.getDependencyInformationFromLine=fJ;xr.getGradlePackageVersion=cNe;xr.getGradlePackageVersionFromBuild=IJ;var dJ=lJ(require("path")),cm=lJ(Fn()),Yi=Fo(),sNe=ia();function aNe(e){let t=dJ.default.join(e,"build.gradle");try{return cm.default.accessSync(t,cm.default.constants.R_OK|cm.default.constants.W_OK),!0}catch{return Yi.logger.debug(`No build.gradle found at ${t}`),!1}}async function gJ(){let e;try{e=await(0,sNe.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(I){Yi.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){Yi.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){Yi.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,""))}function fJ(e){let t=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,n=e.match(t);if(!n){Yi.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]}}async function cNe(e){let n={jsii:"jsii-runtime"}[e]||e;Yi.logger.debug("Running 'gradle dependencies' to find package version",n);let r=await gJ();if(!r||r.length===0)return;for(let o of r)if(o.includes(`:${n}:`)){let s=fJ(o);return s?s.version:void 0}let i=await IJ(e);if(i)return i.version}async function IJ(e){let t=dJ.default.join(process.cwd(),"build.gradle"),r=(await cm.default.readFile(t,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(r.findIndex(f=>i.test(f))===-1){Yi.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=r.findIndex(f=>f.includes(e));if(s===-1){Yi.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]}}});var WJ=g(xe=>{"use strict";var uNe=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]})),lNe=xe&&xe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),mJ=xe&&xe.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&uNe(n,t,r[i]);return lNe(n,t),n}})();Object.defineProperty(xe,"__esModule",{value:!0});xe.getLanguage=CJ;xe.getDotnetVersion=bJ;xe.getJavaVersion=yJ;xe.getMavenVersion=AJ;xe.getGradleVersion=GJ;xe.getPythonVersion=BJ;xe.getPipVersion=vJ;xe.getPipenvVersion=ZJ;xe.getGoVersion=SJ;xe.getNodeVersion=RJ;xe.getPackageVersion=_d;xe.collectDebugInformation=GNe;var dNe=mJ(require("path")),AZ=mJ(require("os")),De=Fo(),fr=ia(),gNe=bZ(),fNe=Rd(),hJ=Fn(),pJ=yZ();function CJ(e=process.cwd()){try{return JSON.parse((0,hJ.readFileSync)(dNe.resolve(e,"cdktf.json"),"utf-8")).language}catch{De.logger.debug(`Unable to detect language in ${e}`);return}}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){De.logger.debug(`Failed to run ${e} ${t}: ${r}`);return}}function bJ(){return Ir("dotnet","--version")}function yJ(){return Ir("java","-version")}function AJ(){return Ir("mvn","--version")}function GJ(){return Ir("gradle","--version")}async function BJ(){return await Ir("python3","--version")||await Ir("python","--version")}function vJ(){return Ir("pip","--version")}function ZJ(){return Ir("pipenv","--version")}function SJ(){return Ir("go","version")}function RJ(){return Ir("node","--version")}async function INe(e){return await(0,hJ.pathExists)("pnpm-lock.yaml")?pNe(e):mNe(e)}async function pNe(e){var t,n,r;let i;try{i=await(0,fr.exec)("pnpm",["list",e,"--json"],{env:{...process.env}})}catch(s){De.logger.debug(`Unable to run 'pnpm list ${e} --json': ${s}`);return}let o;try{o=JSON.parse(i)}catch(s){De.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)){De.logger.debug(`Unable to find '${e}' in 'pnpm list ${e} --json': ${i}`);return}return o[0].dependencies[e].version}async function mNe(e){let t;try{t=await(0,fr.exec)("npm",["list",e,"--json","--include=dev"],{env:{...process.env}})}catch(r){De.logger.debug(`Unable to run 'npm list ${e} --json': ${r}`);return}let n;try{n=JSON.parse(t)}catch(r){De.logger.debug(`Unable to parse output of 'npm list ${e} --json': ${r}`);return}if(!n.dependencies||!n.dependencies[e]||!n.dependencies[e].version){De.logger.debug(`Unable to find '${e}' in 'npm list ${e} --json': ${t}`);return}return n.dependencies[e].version}async function hNe(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){De.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){De.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){De.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 CNe(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){De.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){De.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 bNe(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){De.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){De.logger.debug(`Unable to find version for '${r}' in output of 'go list -m all': ${i}`);return}return o.includes("=>")&&(De.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 yNe(e){let n={jsii:"jsii-runtime"}[e]||e,r;try{r=await(0,fr.exec)("mvn",["dependency:list"],{env:process.env})}catch(l){De.logger.debug(`Unable to run 'mvn dependency:list': ${l}`);return}let i=r.split("The following files have been resolved")[1];if(!i){De.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){De.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 ANe(e){return(0,pJ.isGradleProject)("./")?(0,pJ.getGradlePackageVersion)(e):yNe(e)}async function _d(e,t){let n=async()=>{},i=await({typescript:INe,python:hNe,go:bNe,csharp:CNe,java:ANe}[e]||n)(t);return i??void 0}async function GNe(){var e,t,n,r,i,o,s,a,c,u,l,d,f;let I={},m=CJ();I.language=m??null,I["cdktn-cli"]=fNe.DISPLAY_VERSION;let C=RJ();if(I.node=(e=await C)!==null&&e!==void 0?e:null,m){let y=_d(m,"cdktn"),Z=_d(m,"cdktf"),V=_d(m,"constructs"),_=_d(m,"jsii");I.cdktn=(t=await y)!==null&&t!==void 0?t:null,I.cdktf=(n=await Z)!==null&&n!==void 0?n:null,I.constructs=(r=await V)!==null&&r!==void 0?r:null,I.jsii=(i=await _)!==null&&i!==void 0?i:null}switch(I.terraform=await gNe.terraformVersion,I.arch=AZ.arch(),I.os=`${AZ.platform()} ${AZ.release()}`,m){case"python":{let y=BJ(),Z=vJ(),V=ZJ();I.python=(o=await y)!==null&&o!==void 0?o:null,I.pip=(s=await Z)!==null&&s!==void 0?s:null,I.pipenv=(a=await V)!==null&&a!==void 0?a:null}break;case"java":{let y=yJ(),Z=AJ(),V=GJ();I.java=(c=await y)!==null&&c!==void 0?c:null,I.maven=(u=await Z)!==null&&u!==void 0?u:null,I.gradle=(l=await V)!==null&&l!==void 0?l:null}break;case"csharp":I.dotnet=(d=await bJ())!==null&&d!==void 0?d:null;break;case"go":I.go=(f=await SJ())!==null&&f!==void 0?f:null;break}return I}});var _J=g(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CDKTF_DISABLE_PLUGIN_CACHE_ENV=Ti.CHECKPOINT_DISABLE=Ti.DISABLE_VERSION_CHECK=void 0;function NJ(e){return e==="true"||e==="1"}Ti.DISABLE_VERSION_CHECK=NJ(process.env.DISABLE_VERSION_CHECK);Ti.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;Ti.CDKTF_DISABLE_PLUGIN_CACHE_ENV=NJ(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var VJ=g(EJ=>{"use strict";Object.defineProperty(EJ,"__esModule",{value:!0})});var wJ=g(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.isAttributeNestedType=HJ;um.isNestedTypeAttribute=BNe;function HJ(e){return typeof e=="object"&&!Array.isArray(e)&&typeof e.nesting_mode=="string"&&(typeof e.attributes=="object"||typeof e.attributes>"u")}function BNe(e){return typeof e.nested_type<"u"&&HJ(e.nested_type)}});var YJ=g(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.OPENTOFU_REGISTRY=Or.TERRAFORM_REGISTRY=void 0;Or.registryForTargetVersions=vNe;Or.TERRAFORM_REGISTRY={hostname:"registry.terraform.io",displayName:"Terraform Registry",browseUrl:"https://registry.terraform.io/browse/providers",docsUrl(e,t,n,r,i){let o=`https://registry.terraform.io/providers/${e}/${t}/${n}/docs`;switch(r){case"provider":return o;case"resource":return`${o}/resources/${i}`;case"data-source":return`${o}/data-sources/${i}`;case"ephemeral-resource":return`${o}/ephemeral-resources/${i}`}}};Or.OPENTOFU_REGISTRY={hostname:"registry.opentofu.org",displayName:"OpenTofu Registry",browseUrl:"https://search.opentofu.org/providers",docsUrl(e,t,n,r,i){let o=`https://search.opentofu.org/provider/${e}/${t}/v${n}/docs`;switch(r){case"provider":case"ephemeral-resource":return o;case"resource":return`${o}/resources/${i}`;case"data-source":return`${o}/datasources/${i}`}}};function vNe(e){return e?.opentofu!==void 0&&e?.terraform===void 0?Or.OPENTOFU_REGISTRY:Or.TERRAFORM_REGISTRY}});var Ee=g(Te=>{"use strict";var ZNe=Te&&Te.__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]})),Rt=Te&&Te.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ZNe(t,e,n)};Object.defineProperty(Te,"__esModule",{value:!0});Rt(mZ(),Te);Rt(uJ(),Te);Rt(jp(),Te);Rt(WJ(),Te);Rt(_J(),Te);Rt(CZ(),Te);Rt(yZ(),Te);Rt(Fo(),Te);Rt(VJ(),Te);Rt(wJ(),Te);Rt(YJ(),Te);Rt(Mv(),Te);Rt(bZ(),Te);Rt(ia(),Te);Rt(Rd(),Te)});var FJ=g((iXe,GZ)=>{"use strict";var TJ=require("fs");GZ.exports=e=>new Promise(t=>{TJ.access(e,n=>{t(!n)})});GZ.exports.sync=e=>{try{return TJ.accessSync(e),!0}catch{return!1}}});var LJ=g((oXe,BZ)=>{"use strict";var XJ=(e,...t)=>new Promise(n=>{n(e(...t))});BZ.exports=XJ;BZ.exports.default=XJ});var kJ=g((sXe,vZ)=>{"use strict";var SNe=LJ(),KJ=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=SNe(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};vZ.exports=KJ;vZ.exports.default=KJ});var OJ=g((aXe,xJ)=>{"use strict";var UJ=kJ(),lm=class extends Error{constructor(t){super(),this.value=t}},RNe=(e,t)=>Promise.resolve(e).then(t),WNe=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=UJ(n.concurrency),i=[...e].map(s=>[s,r(RNe,s,t)]),o=UJ(n.preserveOrder?1:1/0);return Promise.all(i.map(s=>o(WNe,s))).then(()=>{}).catch(s=>s instanceof lm?s.value:Promise.reject(s))}});var DJ=g((cXe,ZZ)=>{"use strict";var JJ=require("path"),MJ=FJ(),NNe=OJ();ZZ.exports=(e,t)=>(t=Object.assign({cwd:process.cwd()},t),NNe(e,n=>MJ(JJ.resolve(t.cwd,n)),t));ZZ.exports.sync=(e,t)=>{t=Object.assign({cwd:process.cwd()},t);for(let n of e)if(MJ.sync(JJ.resolve(t.cwd,n)))return n}});var PJ=g((uXe,SZ)=>{"use strict";var Fi=require("path"),qJ=DJ();SZ.exports=(e,t={})=>{let n=Fi.resolve(t.cwd||""),{root:r}=Fi.parse(n),i=[].concat(e);return new Promise(o=>{(function s(a){qJ(i,{cwd:a}).then(c=>{c?o(Fi.join(a,c)):a===r?o(null):s(Fi.dirname(a))})})(n)})};SZ.exports.sync=(e,t={})=>{let n=Fi.resolve(t.cwd||""),{root:r}=Fi.parse(n),i=[].concat(e);for(;;){let o=qJ.sync(i,{cwd:n});if(o)return Fi.join(n,o);if(n===r)return null;n=Fi.dirname(n)}}});var jJ=g((lXe,RZ)=>{"use strict";var zJ=PJ();RZ.exports=async({cwd:e}={})=>zJ("package.json",{cwd:e});RZ.exports.sync=({cwd:e}={})=>zJ.sync("package.json",{cwd:e})});var Xi=ue(require("yargs")),U3=ue(require("path")),x3=ue(require("os")),hm=ue(Fn()),O3=ue(wI()),Jr=ue(Ee());var gm=ue(Fn()),$J=require("node:module"),dm=ue(require("path")),WZ=ue(jJ()),QJ=(0,$J.createRequire)(__filename),e3=()=>{let e=WZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return JSON.parse(gm.readFileSync(e,"utf-8"))},_Ne=()=>{let e=WZ.sync({cwd:__dirname});if(!e)throw new Error("unable to find package.json");return dm.default.dirname(e)},pe=()=>{let e=dm.default.join(__dirname,"..","handlers.js");return gm.existsSync(e)?QJ(e):QJ(dm.default.join(_Ne(),"bundle","bin","cmds","handlers.js"))};var t3=ue(Ee());var de=class{constructor(){this.handler=async t=>{t.getYargsCompletions||await this.handleCommand(t)}}};var ENe=e3(),NZ=class extends de{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:ENe.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){t3.Errors.setScope("init"),await pe().init(n)}},n3=new NZ;var fm=ue(Ee());var i3=ue(Ee());var r3=(0,fm.readConfigSync)(),_Z=class extends de{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:r3.codeMakerOutput,type:"string",desc:"Output directory for generated Constructs",alias:"o"}).option("language",{default:r3.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){i3.Errors.setScope("get"),await pe().get(n)}},Im=new _Z;var o3=ue(Ee());var s3=ue(require("path")),a3=ue(Fn());function VNe(e=process.cwd()){try{let t=s3.join(e,"cdktf.json");return a3.readJsonSync(t)}catch{return}}var EZ=class extends de{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:VNe()?.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){o3.Errors.setScope("convert");let r=pe();n.withProject!==void 0&&(n.language==="typescript"?n.withProject=!1:n.withProject=!0),await r.convert(n)}},c3=new EZ;var l3=ue(Ee());var d3=ue(Ee());var u3=(0,l3.readConfigSync)(),VZ=class extends de{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:u3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:u3.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){d3.Errors.setScope("deploy"),await pe().deploy(n)}},g3=new VZ;var I3=ue(Ee());var p3=ue(Ee());var f3=(0,I3.readConfigSync)(),HZ=class extends de{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:f3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:f3.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){p3.Errors.setScope("destroy"),await pe().destroy(n)}},m3=new HZ;var C3=ue(Ee());var b3=ue(Ee());var h3=(0,C3.readConfigSync)(),wZ=class extends de{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:h3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:h3.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){b3.Errors.setScope("diff"),await pe().diff(n)}},y3=new wZ;var pm=ue(Ee());var A3=(0,pm.readConfigSync)(),YZ=class extends de{constructor(){super(...arguments);this.command="list";this.describe="List stacks in app.";this.builder=n=>n.option("app",{default:A3.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:A3.output,desc:"Output directory for the synthesized Terraform config",alias:"o"}).showHelpOnFail(!0)}async handleCommand(n){pm.Errors.setScope("list"),await pe().list(n)}},G3=new YZ;var B3=ue(Ee());var TZ=class extends de{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){B3.Errors.setScope("login"),await pe().login(n)}},v3=new TZ;var sa=ue(Ee());var FZ=(0,sa.readConfigSync)(),XZ=class extends de{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:FZ.app,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:FZ.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,sa.shouldCheckCodeMakerOutput)(FZ)}).option("hcl",{type:"boolean",desc:"Should the output be in HCL format?",default:!1}).showHelpOnFail(!0)}async handleCommand(n){sa.Errors.setScope("synth"),await pe().synth(n)}},Z3=new XZ;var R3=ue(Ee());var W3=ue(Ee());var S3=(0,R3.readConfigSync)(),LZ=class extends de{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:S3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:S3.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){W3.Errors.setScope("watch"),await pe().watch(n)}},N3=new LZ;var mm=ue(Ee());var _3=(0,mm.readConfigSync)(),KZ=class extends de{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:_3.app,required:!0,desc:"Command to use in order to execute cdktn app",alias:"a"}).option("output",{default:_3.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 pe().output(n)}},E3=new KZ;var V3=ue(Ee());var kZ=class extends de{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){V3.Errors.setScope("debug"),await pe().debug(n)}},H3=new kZ;var K3=ue(require("yargs"));var w3=ue(Ee());var UZ=class extends de{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){w3.Errors.setScope("provider add"),await pe().providerAdd(n)}},Y3=new UZ;var T3=ue(Ee());var xZ=class extends de{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){T3.Errors.setScope("provider upgrade"),await pe().providerUpgrade(n)}},F3=new xZ;var X3=ue(Ee());var OZ=class extends de{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){X3.Errors.setScope("provider list"),await pe().providerList(n)}},L3=new OZ;var JZ=class{constructor(){this.command="provider";this.describe="A set of subcommands that facilitates provider management";this.builder=t=>t.command(Im).command(Y3).command(F3).command(L3);this.handler=()=>{K3.default.showHelp()}}},k3=new JZ;process.env.NODE_ENV=process.env.NODE_ENV||"production";var HNe=()=>{let e=process.env.TF_PLUGIN_CACHE_DIR||U3.join(x3.homedir(),".terraform.d","plugin-cache");return hm.existsSync(e)||hm.mkdirpSync(e),e};Jr.CDKTF_DISABLE_PLUGIN_CACHE_ENV||(process.env.TF_PLUGIN_CACHE_DIR=HNe());var wNe=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,Jr.readCDKTFManifest)();s.push(...Object.values(a.stacks).map(c=>`${c.name}:target stack "${c.name}"`))}finally{r([...o,...s])}}):n()};Xi.command(n3).command(Im).command(c3).command(g3).command(m3).command(y3).command(G3).command(v3).command(Z3).command(N3).command(E3).command(H3).command(k3).recommendCommands().exitProcess(!1).wrap(Xi.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",wNe).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:"),Xi.showHelp(),process.exit(1))}}).fail(async(e,t)=>{if(Xi.exit(1,t),e&&console.log(e),(0,Jr.IsErrorType)(t,"Usage")||(0,Jr.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,Jr.collectDebugInformation)();console.error("Debug Information:"),Object.entries(n).forEach(([r,i])=>{console.log(`${r}: ${i===null?"null":i}`)})}await O3.close(4e3),process.exit(1)}).argv;
|
|
75
75
|
/*! Bundled license information:
|
|
76
76
|
|