@webiny/pulumi-sdk 6.2.0 → 6.3.0-beta.1

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/Pulumi.js CHANGED
@@ -110,17 +110,35 @@ export class Pulumi {
110
110
  if (!pulumiAwsVersion) {
111
111
  throw new PulumiError("Could not determine the version of @pulumi/aws package. Please ensure it is installed.");
112
112
  }
113
- const pluginExists = fs.pathExistsSync(path.join(this.pulumiFolder, "plugins", `resource-aws-${pulumiAwsVersion}`, "pulumi-resource-aws"));
114
- if (pluginExists) {
115
- return;
113
+ const pluginsDir = path.join(this.pulumiFolder, "plugins");
114
+ // Pulumi names plugin directories with a "v" prefix (e.g. resource-aws-v7.25.0).
115
+ const requiredPluginDir = `resource-aws-v${pulumiAwsVersion}`;
116
+ const pluginExists = fs.pathExistsSync(path.join(pluginsDir, requiredPluginDir, "pulumi-resource-aws"));
117
+ if (!pluginExists) {
118
+ execa.sync(this.pulumiBinaryPath, ["plugin", "install", "resource", "aws", pulumiAwsVersion], {
119
+ stdio: "inherit",
120
+ env: {
121
+ PULUMI_HOME: this.pulumiFolder,
122
+ PULUMI_SKIP_UPDATE_CHECK: "true"
123
+ }
124
+ });
116
125
  }
117
- return execa.sync(this.pulumiBinaryPath, ["plugin", "install", "resource", "aws", pulumiAwsVersion], {
118
- stdio: "inherit",
119
- env: {
120
- PULUMI_HOME: this.pulumiFolder,
121
- PULUMI_SKIP_UPDATE_CHECK: "true"
126
+
127
+ // Remove stale resource-aws plugin versions to reclaim disk space.
128
+ if (fs.pathExistsSync(pluginsDir)) {
129
+ for (const entry of fs.readdirSync(pluginsDir)) {
130
+ if (!entry.startsWith("resource-aws-") || entry === requiredPluginDir) {
131
+ continue;
132
+ }
133
+ // Strip the trailing ".lock" suffix so both the directory and its
134
+ // lock file are matched by the same prefix check.
135
+ const baseName = entry.endsWith(".lock") ? entry.slice(0, -5) : entry;
136
+ if (baseName !== requiredPluginDir) {
137
+ console.log("DERI", entry);
138
+ fs.removeSync(path.join(pluginsDir, entry));
139
+ }
122
140
  }
123
- });
141
+ }
124
142
  }
125
143
  }
126
144
 
package/Pulumi.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["os","execa","path","fs","merge","kebabCase","set","downloadBinaries","FLAG_NON_INTERACTIVE","PulumiError","Error","Pulumi","create","options","pulumi","install","ensureAwsPluginIsInstalled","constructor","pulumiDownloadFolder","join","pulumiFolder","process","cwd","platform","pulumiBinaryPath","run","rawArgs","args","Array","isArray","command","finalArgs","key","value","i","length","push","arch","PATH_SEPARATOR","execaArgs","env","PATH","flags","includes","pulumiProcess","wrapped","then","result","err","stderr","stdout","message","cause","Object","assign","beforePulumiInstall","afterPulumiInstall","pulumiAwsVersion","sync","match","pluginExists","pathExistsSync","stdio","PULUMI_HOME","PULUMI_SKIP_UPDATE_CHECK"],"sources":["Pulumi.ts"],"sourcesContent":["import os from \"os\";\nimport execa, { ExecaChildProcess } from \"execa\";\nimport * as path from \"path\";\nimport fs from \"fs-extra\";\nimport merge from \"lodash/merge.js\";\nimport kebabCase from \"lodash/kebabCase.js\";\nimport set from \"lodash/set.js\";\nimport downloadBinaries from \"./downloadBinaries.js\";\n\ntype Command = string | string[];\n\nexport interface PulumiArgs {\n [key: string]: string | boolean | undefined | string[];\n}\n\nexport interface ExecaArgs {\n env?: {\n [key: string]: string | undefined;\n };\n\n [key: string]: any;\n}\n\nexport interface Options {\n args?: PulumiArgs;\n execa?: ExecaArgs;\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n\n // A folder into which the Pulumi CLI, along with all of its meta data and config files, will be set up.\n // It's recommended this folder is not checked in into a code repository, since the Pulumi CLI can store\n // sensitive information here, for example - user's Pulumi Service credentials.\n pulumiFolder?: string;\n}\n\nexport interface RunArgs {\n command: Command;\n args?: PulumiArgs;\n execa?: ExecaArgs;\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n}\n\nexport interface InstallArgs {\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n}\n\nexport const FLAG_NON_INTERACTIVE = \"--non-interactive\";\n\nexport class PulumiError extends Error {}\n\nexport class Pulumi {\n options: Options;\n pulumiFolder: string;\n pulumiDownloadFolder: string;\n pulumiBinaryPath: string;\n\n static async create(options: Options = {}) {\n const pulumi = new Pulumi(options);\n // If not already installed, Pulumi binaries will be downloaded in this step.\n await pulumi.install();\n // No matter if it's a fresh installation or not, we make sure that Pulumi AWS plugin is installed.\n await pulumi.ensureAwsPluginIsInstalled();\n return pulumi;\n }\n\n private constructor(options: Options = {}) {\n this.options = options;\n\n this.pulumiDownloadFolder = path.join(\n options.pulumiFolder || process.cwd(),\n \"pulumi-cli\",\n os.platform()\n );\n\n this.pulumiFolder = path.join(this.pulumiDownloadFolder, \"pulumi\");\n this.pulumiBinaryPath = path.join(this.pulumiFolder, \"pulumi\");\n }\n\n run(rawArgs: RunArgs) {\n const args = merge({}, this.options, rawArgs);\n\n if (!Array.isArray(args.command)) {\n args.command = [args.command];\n }\n\n // 1. Prepare Pulumi args.\n const finalArgs = [];\n for (const key in args.args) {\n const value = args.args[key];\n if (!value) {\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n finalArgs.push(`--${kebabCase(key)}`, value[i]);\n }\n continue;\n }\n\n if (typeof value === \"boolean\") {\n finalArgs.push(`--${kebabCase(key)}`);\n continue;\n }\n\n finalArgs.push(`--${kebabCase(key)}`, value);\n }\n\n // Prepare execa args.\n if (!args.execa) {\n args.execa = {};\n }\n\n set(args.execa, \"env.PULUMI_SKIP_UPDATE_CHECK\", \"true\");\n set(args.execa, \"env.PULUMI_HOME\", this.pulumiFolder);\n\n if (os.arch() === \"arm64\") {\n /**\n * This variable is an attempt to resolve this issue:\n * https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/\n */\n set(args.execa, \"env.GODEBUG\", \"asyncpreemptoff=1\");\n }\n\n // Use \";\" when on Windows. For Mac and Linux, use \":\".\n const PATH_SEPARATOR = os.platform() === \"win32\" ? \";\" : \":\";\n\n const execaArgs = {\n ...args.execa,\n env: {\n ...(args.execa.env || {}),\n /**\n * Due to an issue with Pulumi https://github.com/pulumi/pulumi/issues/8374, and even though this\n * commit suggests it should already work like that https://github.com/pulumi/pulumi/commit/c878916901a997a9c0ffcbed23560e19e224a6f1,\n * we need to specify the exact location of our Pulumi binaries, using the PATH environment variable, so it can correctly resolve\n * plugins necessary for custom resources and dynamic providers to work.\n */\n PATH: this.pulumiFolder + PATH_SEPARATOR + process.env.PATH\n }\n };\n\n // We want to keep the \"interactive\" output format of the Pulumi command when `--preview` flag is passed in.\n const flags =\n args.command && args.command.includes(\"preview\") ? [] : [FLAG_NON_INTERACTIVE];\n\n const pulumiProcess = execa(\n this.pulumiBinaryPath,\n [...args.command, ...finalArgs, ...flags],\n execaArgs\n );\n\n // We want to throw an instance of PulumiError when the Pulumi command fails.\n // Makes it easier to catch and handle Pulumi errors in the code.\n // Note: this code definitely looks funky, but it is because how `execa` works.\n const wrapped = pulumiProcess.then(\n result => result,\n err => {\n throw new PulumiError(err.stderr || err.stdout || err.message, { cause: err });\n }\n );\n\n Object.assign(wrapped, pulumiProcess);\n\n return wrapped as ExecaChildProcess<string>;\n }\n\n private async install(rawArgs?: InstallArgs): Promise<boolean> {\n const args = merge({}, this.options, rawArgs);\n\n return await downloadBinaries(\n this.pulumiDownloadFolder,\n args.beforePulumiInstall,\n args.afterPulumiInstall\n );\n }\n\n private async ensureAwsPluginIsInstalled() {\n let pulumiAwsVersion = \"\";\n const { stdout } = execa.sync(\"yarn\", [\n \"info\",\n \"@pulumi/aws\",\n \"-A\",\n \"-R\",\n \"--name-only\",\n \"--json\"\n ]);\n\n const match = stdout.match(/npm:(.*?)\"/);\n if (match) {\n pulumiAwsVersion = match[1];\n }\n\n if (!pulumiAwsVersion) {\n throw new PulumiError(\n \"Could not determine the version of @pulumi/aws package. Please ensure it is installed.\"\n );\n }\n\n const pluginExists = fs.pathExistsSync(\n path.join(\n this.pulumiFolder,\n \"plugins\",\n `resource-aws-${pulumiAwsVersion}`,\n \"pulumi-resource-aws\"\n )\n );\n\n if (pluginExists) {\n return;\n }\n\n return execa.sync(\n this.pulumiBinaryPath,\n [\"plugin\", \"install\", \"resource\", \"aws\", pulumiAwsVersion],\n {\n stdio: \"inherit\",\n env: {\n PULUMI_HOME: this.pulumiFolder,\n PULUMI_SKIP_UPDATE_CHECK: \"true\"\n }\n }\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,KAAK,MAA6B,OAAO;AAChD,OAAO,KAAKC,IAAI,MAAM,MAAM;AAC5B,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,gBAAgB;AAyCvB,OAAO,MAAMC,oBAAoB,GAAG,mBAAmB;AAEvD,OAAO,MAAMC,WAAW,SAASC,KAAK,CAAC;AAEvC,OAAO,MAAMC,MAAM,CAAC;EAMhB,aAAaC,MAAMA,CAACC,OAAgB,GAAG,CAAC,CAAC,EAAE;IACvC,MAAMC,MAAM,GAAG,IAAIH,MAAM,CAACE,OAAO,CAAC;IAClC;IACA,MAAMC,MAAM,CAACC,OAAO,CAAC,CAAC;IACtB;IACA,MAAMD,MAAM,CAACE,0BAA0B,CAAC,CAAC;IACzC,OAAOF,MAAM;EACjB;EAEQG,WAAWA,CAACJ,OAAgB,GAAG,CAAC,CAAC,EAAE;IACvC,IAAI,CAACA,OAAO,GAAGA,OAAO;IAEtB,IAAI,CAACK,oBAAoB,GAAGhB,IAAI,CAACiB,IAAI,CACjCN,OAAO,CAACO,YAAY,IAAIC,OAAO,CAACC,GAAG,CAAC,CAAC,EACrC,YAAY,EACZtB,EAAE,CAACuB,QAAQ,CAAC,CAChB,CAAC;IAED,IAAI,CAACH,YAAY,GAAGlB,IAAI,CA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EAAE,SAAS;MAChBtB,GAAG,EAAE;QACDuB,WAAW,EAAE,IAAI,CAAC3C,YAAY;QAC9B4C,wBAAwB,EAAE;MAC9B;IACJ,CACJ,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["os","execa","path","fs","merge","kebabCase","set","downloadBinaries","FLAG_NON_INTERACTIVE","PulumiError","Error","Pulumi","create","options","pulumi","install","ensureAwsPluginIsInstalled","constructor","pulumiDownloadFolder","join","pulumiFolder","process","cwd","platform","pulumiBinaryPath","run","rawArgs","args","Array","isArray","command","finalArgs","key","value","i","length","push","arch","PATH_SEPARATOR","execaArgs","env","PATH","flags","includes","pulumiProcess","wrapped","then","result","err","stderr","stdout","message","cause","Object","assign","beforePulumiInstall","afterPulumiInstall","pulumiAwsVersion","sync","match","pluginsDir","requiredPluginDir","pluginExists","pathExistsSync","stdio","PULUMI_HOME","PULUMI_SKIP_UPDATE_CHECK","entry","readdirSync","startsWith","baseName","endsWith","slice","console","log","removeSync"],"sources":["Pulumi.ts"],"sourcesContent":["import os from \"os\";\nimport execa, { ExecaChildProcess } from \"execa\";\nimport * as path from \"path\";\nimport fs from \"fs-extra\";\nimport merge from \"lodash/merge.js\";\nimport kebabCase from \"lodash/kebabCase.js\";\nimport set from \"lodash/set.js\";\nimport downloadBinaries from \"./downloadBinaries.js\";\n\ntype Command = string | string[];\n\nexport interface PulumiArgs {\n [key: string]: string | boolean | undefined | string[];\n}\n\nexport interface ExecaArgs {\n env?: {\n [key: string]: string | undefined;\n };\n\n [key: string]: any;\n}\n\nexport interface Options {\n args?: PulumiArgs;\n execa?: ExecaArgs;\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n\n // A folder into which the Pulumi CLI, along with all of its meta data and config files, will be set up.\n // It's recommended this folder is not checked in into a code repository, since the Pulumi CLI can store\n // sensitive information here, for example - user's Pulumi Service credentials.\n pulumiFolder?: string;\n}\n\nexport interface RunArgs {\n command: Command;\n args?: PulumiArgs;\n execa?: ExecaArgs;\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n}\n\nexport interface InstallArgs {\n beforePulumiInstall?: () => any;\n afterPulumiInstall?: () => any;\n}\n\nexport const FLAG_NON_INTERACTIVE = \"--non-interactive\";\n\nexport class PulumiError extends Error {}\n\nexport class Pulumi {\n options: Options;\n pulumiFolder: string;\n pulumiDownloadFolder: string;\n pulumiBinaryPath: string;\n\n static async create(options: Options = {}) {\n const pulumi = new Pulumi(options);\n // If not already installed, Pulumi binaries will be downloaded in this step.\n await pulumi.install();\n // No matter if it's a fresh installation or not, we make sure that Pulumi AWS plugin is installed.\n await pulumi.ensureAwsPluginIsInstalled();\n return pulumi;\n }\n\n private constructor(options: Options = {}) {\n this.options = options;\n\n this.pulumiDownloadFolder = path.join(\n options.pulumiFolder || process.cwd(),\n \"pulumi-cli\",\n os.platform()\n );\n\n this.pulumiFolder = path.join(this.pulumiDownloadFolder, \"pulumi\");\n this.pulumiBinaryPath = path.join(this.pulumiFolder, \"pulumi\");\n }\n\n run(rawArgs: RunArgs) {\n const args = merge({}, this.options, rawArgs);\n\n if (!Array.isArray(args.command)) {\n args.command = [args.command];\n }\n\n // 1. Prepare Pulumi args.\n const finalArgs = [];\n for (const key in args.args) {\n const value = args.args[key];\n if (!value) {\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n finalArgs.push(`--${kebabCase(key)}`, value[i]);\n }\n continue;\n }\n\n if (typeof value === \"boolean\") {\n finalArgs.push(`--${kebabCase(key)}`);\n continue;\n }\n\n finalArgs.push(`--${kebabCase(key)}`, value);\n }\n\n // Prepare execa args.\n if (!args.execa) {\n args.execa = {};\n }\n\n set(args.execa, \"env.PULUMI_SKIP_UPDATE_CHECK\", \"true\");\n set(args.execa, \"env.PULUMI_HOME\", this.pulumiFolder);\n\n if (os.arch() === \"arm64\") {\n /**\n * This variable is an attempt to resolve this issue:\n * https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/\n */\n set(args.execa, \"env.GODEBUG\", \"asyncpreemptoff=1\");\n }\n\n // Use \";\" when on Windows. For Mac and Linux, use \":\".\n const PATH_SEPARATOR = os.platform() === \"win32\" ? \";\" : \":\";\n\n const execaArgs = {\n ...args.execa,\n env: {\n ...(args.execa.env || {}),\n /**\n * Due to an issue with Pulumi https://github.com/pulumi/pulumi/issues/8374, and even though this\n * commit suggests it should already work like that https://github.com/pulumi/pulumi/commit/c878916901a997a9c0ffcbed23560e19e224a6f1,\n * we need to specify the exact location of our Pulumi binaries, using the PATH environment variable, so it can correctly resolve\n * plugins necessary for custom resources and dynamic providers to work.\n */\n PATH: this.pulumiFolder + PATH_SEPARATOR + process.env.PATH\n }\n };\n\n // We want to keep the \"interactive\" output format of the Pulumi command when `--preview` flag is passed in.\n const flags =\n args.command && args.command.includes(\"preview\") ? [] : [FLAG_NON_INTERACTIVE];\n\n const pulumiProcess = execa(\n this.pulumiBinaryPath,\n [...args.command, ...finalArgs, ...flags],\n execaArgs\n );\n\n // We want to throw an instance of PulumiError when the Pulumi command fails.\n // Makes it easier to catch and handle Pulumi errors in the code.\n // Note: this code definitely looks funky, but it is because how `execa` works.\n const wrapped = pulumiProcess.then(\n result => result,\n err => {\n throw new PulumiError(err.stderr || err.stdout || err.message, { cause: err });\n }\n );\n\n Object.assign(wrapped, pulumiProcess);\n\n return wrapped as ExecaChildProcess<string>;\n }\n\n private async install(rawArgs?: InstallArgs): Promise<boolean> {\n const args = merge({}, this.options, rawArgs);\n\n return await downloadBinaries(\n this.pulumiDownloadFolder,\n args.beforePulumiInstall,\n args.afterPulumiInstall\n );\n }\n\n private async ensureAwsPluginIsInstalled() {\n let pulumiAwsVersion = \"\";\n const { stdout } = execa.sync(\"yarn\", [\n \"info\",\n \"@pulumi/aws\",\n \"-A\",\n \"-R\",\n \"--name-only\",\n \"--json\"\n ]);\n\n const match = stdout.match(/npm:(.*?)\"/);\n if (match) {\n pulumiAwsVersion = match[1];\n }\n\n if (!pulumiAwsVersion) {\n throw new PulumiError(\n \"Could not determine the version of @pulumi/aws package. Please ensure it is installed.\"\n );\n }\n\n const pluginsDir = path.join(this.pulumiFolder, \"plugins\");\n // Pulumi names plugin directories with a \"v\" prefix (e.g. resource-aws-v7.25.0).\n const requiredPluginDir = `resource-aws-v${pulumiAwsVersion}`;\n\n const pluginExists = fs.pathExistsSync(\n path.join(pluginsDir, requiredPluginDir, \"pulumi-resource-aws\")\n );\n\n if (!pluginExists) {\n execa.sync(\n this.pulumiBinaryPath,\n [\"plugin\", \"install\", \"resource\", \"aws\", pulumiAwsVersion],\n {\n stdio: \"inherit\",\n env: {\n PULUMI_HOME: this.pulumiFolder,\n PULUMI_SKIP_UPDATE_CHECK: \"true\"\n }\n }\n );\n }\n\n // Remove stale resource-aws plugin versions to reclaim disk space.\n if (fs.pathExistsSync(pluginsDir)) {\n for (const entry of fs.readdirSync(pluginsDir)) {\n if (!entry.startsWith(\"resource-aws-\") || entry === requiredPluginDir) {\n continue;\n }\n // Strip the trailing \".lock\" suffix so both the directory and its\n // lock file are matched by the same prefix check.\n const baseName = entry.endsWith(\".lock\") ? entry.slice(0, -5) : entry;\n if (baseName !== requiredPluginDir) {\n console.log(\"DERI\", entry);\n fs.removeSync(path.join(pluginsDir, entry));\n }\n }\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,KAAK,MAA6B,OAAO;AAChD,OAAO,KAAKC,IAAI,MAAM,MAAM;AAC5B,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,gBAAgB;AAyCvB,OAAO,MAAMC,oBAAoB,GAAG,mBAAmB;AAEvD,OAAO,MAAMC,WAAW,SAASC,KAAK,CAAC;AAEvC,OAAO,MAAMC,MAAM,CAAC;EAMhB,aAAaC,MAAMA,CAACC,OAAgB,GAAG,CAAC,CAAC,EA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E,UAAU,CAACzE,IAAI,CAACiB,IAAI,CAACyC,UAAU,EAAEO,KAAK,CAAC,CAAC;QAC/C;MACJ;IACJ;EACJ;AACJ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/pulumi-sdk",
3
- "version": "6.2.0",
3
+ "version": "6.3.0-beta.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -15,8 +15,8 @@
15
15
  "directory": "dist"
16
16
  },
17
17
  "dependencies": {
18
- "@pulumi/aws": "^7.25.0",
19
- "@pulumi/pulumi": "^3.230.0",
18
+ "@pulumi/aws": "^7.26.0",
19
+ "@pulumi/pulumi": "^3.231.0",
20
20
  "decompress": "4.2.1",
21
21
  "execa": "5.1.1",
22
22
  "find-up": "8.0.0",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/lodash": "4.17.24",
31
- "@webiny/build-tools": "6.2.0",
31
+ "@webiny/build-tools": "6.3.0-beta.1",
32
32
  "rimraf": "6.1.3",
33
- "type-fest": "5.5.0",
34
- "typescript": "5.9.3"
33
+ "type-fest": "5.6.0",
34
+ "typescript": "6.0.3"
35
35
  },
36
36
  "adio": {
37
37
  "ignore": {
@@ -41,5 +41,5 @@
41
41
  ]
42
42
  }
43
43
  },
44
- "gitHead": "3d3148358b6febbc857371930871743bec3b3939"
44
+ "gitHead": "664b273a9f0a971f9ca7e6ffe920db77fefdced1"
45
45
  }