@webiny/pulumi-sdk 0.0.0-unstable.496cf268ac → 0.0.0-unstable.5387e5f7c8
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.d.ts +20 -7
- package/Pulumi.js +107 -140
- package/Pulumi.js.map +1 -1
- package/README.md +6 -71
- package/downloadBinaries.d.ts +1 -1
- package/downloadBinaries.js +79 -102
- package/downloadBinaries.js.map +1 -1
- package/downloadFile.d.ts +1 -0
- package/downloadFile.js +22 -0
- package/downloadFile.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -18
- package/package.json +27 -25
- package/index.js.map +0 -1
package/Pulumi.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { type Readable, type Writable } from "node:stream";
|
|
2
|
+
export interface PulumiProcessResult {
|
|
3
|
+
readonly stdout: string;
|
|
4
|
+
readonly stderr: string;
|
|
5
|
+
readonly exitCode: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PulumiProcess extends Promise<PulumiProcessResult> {
|
|
8
|
+
readonly stdin: Writable | null;
|
|
9
|
+
readonly stdout: Readable | null;
|
|
10
|
+
readonly stderr: Readable | null;
|
|
11
|
+
}
|
|
12
|
+
type Command = string | string[];
|
|
3
13
|
export interface PulumiArgs {
|
|
4
|
-
[key: string]: string | boolean;
|
|
14
|
+
[key: string]: string | boolean | undefined | string[];
|
|
5
15
|
}
|
|
6
16
|
export interface ExecaArgs {
|
|
7
17
|
env?: {
|
|
@@ -28,14 +38,17 @@ export interface InstallArgs {
|
|
|
28
38
|
afterPulumiInstall?: () => any;
|
|
29
39
|
}
|
|
30
40
|
export declare const FLAG_NON_INTERACTIVE = "--non-interactive";
|
|
41
|
+
export declare class PulumiError extends Error {
|
|
42
|
+
}
|
|
31
43
|
export declare class Pulumi {
|
|
32
44
|
options: Options;
|
|
33
45
|
pulumiFolder: string;
|
|
34
46
|
pulumiDownloadFolder: string;
|
|
35
47
|
pulumiBinaryPath: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
static create(options?: Options): Promise<Pulumi>;
|
|
49
|
+
private constructor();
|
|
50
|
+
run(rawArgs: RunArgs): PulumiProcess;
|
|
51
|
+
private install;
|
|
52
|
+
private ensureAwsPluginIsInstalled;
|
|
40
53
|
}
|
|
41
54
|
export {};
|
package/Pulumi.js
CHANGED
|
@@ -1,148 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
exports.Pulumi = exports.FLAG_NON_INTERACTIVE = void 0;
|
|
11
|
-
|
|
12
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
17
|
-
|
|
18
|
-
var _kebabCase2 = _interopRequireDefault(require("lodash/kebabCase"));
|
|
19
|
-
|
|
20
|
-
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
21
|
-
|
|
22
|
-
var _os = _interopRequireDefault(require("os"));
|
|
23
|
-
|
|
24
|
-
var _execa = _interopRequireDefault(require("execa"));
|
|
25
|
-
|
|
26
|
-
var path = _interopRequireWildcard(require("path"));
|
|
27
|
-
|
|
28
|
-
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
29
|
-
|
|
30
|
-
var _downloadBinaries = _interopRequireDefault(require("./downloadBinaries"));
|
|
31
|
-
|
|
1
|
+
import os from "os";
|
|
2
|
+
import { execa, execaSync } from "execa";
|
|
3
|
+
import fs_extra from "fs-extra";
|
|
4
|
+
import merge from "lodash/merge.js";
|
|
5
|
+
import kebabCase from "lodash/kebabCase.js";
|
|
6
|
+
import set from "lodash/set.js";
|
|
7
|
+
import downloadBinaries from "./downloadBinaries.js";
|
|
8
|
+
import * as __rspack_external_path from "path";
|
|
32
9
|
const FLAG_NON_INTERACTIVE = "--non-interactive";
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
class PulumiError extends Error {
|
|
11
|
+
}
|
|
35
12
|
class Pulumi {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
finalArgs.push(`--${(0, _kebabCase2.default)(key)}`, value[i]);
|
|
13
|
+
static async create(options = {}) {
|
|
14
|
+
const pulumi = new Pulumi(options);
|
|
15
|
+
await pulumi.install();
|
|
16
|
+
await pulumi.ensureAwsPluginIsInstalled();
|
|
17
|
+
return pulumi;
|
|
18
|
+
}
|
|
19
|
+
constructor(options = {}){
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.pulumiDownloadFolder = __rspack_external_path.join(options.pulumiFolder || process.cwd(), "pulumi-cli", os.platform());
|
|
22
|
+
this.pulumiFolder = __rspack_external_path.join(this.pulumiDownloadFolder, "pulumi");
|
|
23
|
+
this.pulumiBinaryPath = __rspack_external_path.join(this.pulumiFolder, "pulumi");
|
|
24
|
+
}
|
|
25
|
+
run(rawArgs) {
|
|
26
|
+
const args = merge({}, this.options, rawArgs);
|
|
27
|
+
if (!Array.isArray(args.command)) args.command = [
|
|
28
|
+
args.command
|
|
29
|
+
];
|
|
30
|
+
const finalArgs = [];
|
|
31
|
+
for(const key in args.args){
|
|
32
|
+
const value = args.args[key];
|
|
33
|
+
if (value) {
|
|
34
|
+
if (Array.isArray(value)) {
|
|
35
|
+
for(let i = 0; i < value.length; i++)finalArgs.push(`--${kebabCase(key)}`, value[i]);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if ("boolean" == typeof value) {
|
|
39
|
+
finalArgs.push(`--${kebabCase(key)}`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
finalArgs.push(`--${kebabCase(key)}`, value);
|
|
43
|
+
}
|
|
68
44
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
45
|
+
if (!args.execa) args.execa = {};
|
|
46
|
+
set(args.execa, "env.PULUMI_SKIP_UPDATE_CHECK", "true");
|
|
47
|
+
set(args.execa, "env.PULUMI_HOME", this.pulumiFolder);
|
|
48
|
+
if ("arm64" === os.arch()) set(args.execa, "env.GODEBUG", "asyncpreemptoff=1");
|
|
49
|
+
const PATH_SEPARATOR = "win32" === os.platform() ? ";" : ":";
|
|
50
|
+
const execaArgs = {
|
|
51
|
+
...args.execa,
|
|
52
|
+
env: {
|
|
53
|
+
...args.execa.env || {},
|
|
54
|
+
PATH: this.pulumiFolder + PATH_SEPARATOR + process.env.PATH
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const flags = args.command && args.command.includes("preview") ? [] : [
|
|
58
|
+
FLAG_NON_INTERACTIVE
|
|
59
|
+
];
|
|
60
|
+
const pulumiProcess = execa(this.pulumiBinaryPath, [
|
|
61
|
+
...args.command,
|
|
62
|
+
...finalArgs,
|
|
63
|
+
...flags
|
|
64
|
+
], execaArgs);
|
|
65
|
+
const wrapped = pulumiProcess.then((result)=>result, (err)=>{
|
|
66
|
+
throw new PulumiError(err.stderr || err.stdout || err.message, {
|
|
67
|
+
cause: err
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
Object.assign(wrapped, pulumiProcess);
|
|
71
|
+
return wrapped;
|
|
84
72
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (_os.default.arch() === "arm64") {
|
|
90
|
-
/**
|
|
91
|
-
* This variable is an attempt to resolve this issue:
|
|
92
|
-
* https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/
|
|
93
|
-
*/
|
|
94
|
-
(0, _set2.default)(args.execa, "env.GODEBUG", "asyncpreemptoff=1");
|
|
95
|
-
} // Use ";" when on Windows. For Mac and Linux, use ":".
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const PATH_SEPARATOR = _os.default.platform() === "win32" ? ";" : ":";
|
|
99
|
-
const execaArgs = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args.execa), {}, {
|
|
100
|
-
env: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args.execa.env || {}), {}, {
|
|
101
|
-
/**
|
|
102
|
-
* Due to an issue with Pulumi https://github.com/pulumi/pulumi/issues/8374, and even though this
|
|
103
|
-
* commit suggests it should already work like that https://github.com/pulumi/pulumi/commit/c878916901a997a9c0ffcbed23560e19e224a6f1,
|
|
104
|
-
* we need to specify the exact location of our Pulumi binaries, using the PATH environment variable, so it can correctly resolve
|
|
105
|
-
* plugins necessary for custom resources and dynamic providers to work.
|
|
106
|
-
*/
|
|
107
|
-
PATH: process.env.PATH + PATH_SEPARATOR + this.pulumiFolder
|
|
108
|
-
})
|
|
109
|
-
}); // We want to keep the "interactive" output format of the Pulumi command when `--preview` flag is passed in.
|
|
110
|
-
|
|
111
|
-
const flags = args.command && args.command.includes("preview") ? [] : [FLAG_NON_INTERACTIVE];
|
|
112
|
-
return (0, _execa.default)(this.pulumiBinaryPath, [...args.command, ...finalArgs, ...flags], execaArgs);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
async install(rawArgs) {
|
|
116
|
-
const args = (0, _merge2.default)({}, this.options, rawArgs);
|
|
117
|
-
const installed = await (0, _downloadBinaries.default)(this.pulumiDownloadFolder, args.beforePulumiInstall, args.afterPulumiInstall);
|
|
118
|
-
|
|
119
|
-
if (installed) {
|
|
120
|
-
this.ensureAwsPluginIsInstalled();
|
|
73
|
+
async install(rawArgs) {
|
|
74
|
+
const args = merge({}, this.options, rawArgs);
|
|
75
|
+
return await downloadBinaries(this.pulumiDownloadFolder, args.beforePulumiInstall, args.afterPulumiInstall);
|
|
121
76
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
77
|
+
async ensureAwsPluginIsInstalled() {
|
|
78
|
+
let pulumiAwsVersion = "";
|
|
79
|
+
const { stdout } = execaSync("yarn", [
|
|
80
|
+
"info",
|
|
81
|
+
"@pulumi/aws",
|
|
82
|
+
"-A",
|
|
83
|
+
"-R",
|
|
84
|
+
"--name-only",
|
|
85
|
+
"--json"
|
|
86
|
+
]);
|
|
87
|
+
const match = stdout.match(/npm:(.*?)"/);
|
|
88
|
+
if (match) pulumiAwsVersion = match[1];
|
|
89
|
+
if (!pulumiAwsVersion) throw new PulumiError("Could not determine the version of @pulumi/aws package. Please ensure it is installed.");
|
|
90
|
+
const pluginsDir = __rspack_external_path.join(this.pulumiFolder, "plugins");
|
|
91
|
+
const requiredPluginDir = `resource-aws-v${pulumiAwsVersion}`;
|
|
92
|
+
const pluginExists = fs_extra.pathExistsSync(__rspack_external_path.join(pluginsDir, requiredPluginDir, "pulumi-resource-aws"));
|
|
93
|
+
if (!pluginExists) execaSync(this.pulumiBinaryPath, [
|
|
94
|
+
"plugin",
|
|
95
|
+
"install",
|
|
96
|
+
"resource",
|
|
97
|
+
"aws",
|
|
98
|
+
pulumiAwsVersion
|
|
99
|
+
], {
|
|
100
|
+
stdio: "inherit",
|
|
101
|
+
env: {
|
|
102
|
+
PULUMI_HOME: this.pulumiFolder,
|
|
103
|
+
PULUMI_SKIP_UPDATE_CHECK: "true"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
if (fs_extra.pathExistsSync(pluginsDir)) for (const entry of fs_extra.readdirSync(pluginsDir)){
|
|
107
|
+
if (!entry.startsWith("resource-aws-") || entry === requiredPluginDir) continue;
|
|
108
|
+
const baseName = entry.endsWith(".lock") ? entry.slice(0, -5) : entry;
|
|
109
|
+
if (baseName !== requiredPluginDir) fs_extra.removeSync(__rspack_external_path.join(pluginsDir, entry));
|
|
110
|
+
}
|
|
135
111
|
}
|
|
136
|
-
|
|
137
|
-
return _execa.default.sync(this.pulumiBinaryPath, ["plugin", "install", "resource", "aws", version], {
|
|
138
|
-
stdio: "inherit",
|
|
139
|
-
env: {
|
|
140
|
-
PULUMI_HOME: this.pulumiFolder,
|
|
141
|
-
PULUMI_SKIP_UPDATE_CHECK: "true"
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
112
|
}
|
|
113
|
+
export { FLAG_NON_INTERACTIVE, Pulumi, PulumiError };
|
|
147
114
|
|
|
148
|
-
|
|
115
|
+
//# sourceMappingURL=Pulumi.js.map
|
package/Pulumi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FLAG_NON_INTERACTIVE","Pulumi","constructor","options","pulumiDownloadFolder","path","join","pulumiFolder","process","cwd","os","platform","pulumiBinaryPath","run","rawArgs","ensureAwsPluginIsInstalled","args","Array","isArray","command","finalArgs","key","value","i","length","push","execa","arch","PATH_SEPARATOR","execaArgs","env","PATH","flags","includes","install","installed","downloadBinaries","beforePulumiInstall","afterPulumiInstall","version","require","pluginExists","fs","pathExistsSync","sync","stdio","PULUMI_HOME","PULUMI_SKIP_UPDATE_CHECK"],"sources":["Pulumi.ts"],"sourcesContent":["import os from \"os\";\nimport execa from \"execa\";\nimport * as path from \"path\";\nimport fs from \"fs-extra\";\nimport { merge, kebabCase, set } from \"lodash\";\nimport downloadBinaries from \"./downloadBinaries\";\n\ntype Command = string | string[];\n\nexport interface PulumiArgs {\n [key: string]: string | boolean;\n}\n\nexport interface ExecaArgs {\n env?: {\n [key: string]: string | undefined;\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\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 Pulumi {\n options: Options;\n pulumiFolder: string;\n pulumiDownloadFolder: string;\n pulumiBinaryPath: string;\n 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 this.ensureAwsPluginIsInstalled();\n\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: process.env.PATH + PATH_SEPARATOR + this.pulumiFolder\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 return execa(this.pulumiBinaryPath, [...args.command, ...finalArgs, ...flags], execaArgs);\n }\n\n async install(rawArgs?: InstallArgs): Promise<boolean> {\n const args = merge({}, this.options, rawArgs);\n\n const installed = await downloadBinaries(\n this.pulumiDownloadFolder,\n args.beforePulumiInstall,\n args.afterPulumiInstall\n );\n\n if (installed) {\n this.ensureAwsPluginIsInstalled();\n }\n\n return installed;\n }\n\n ensureAwsPluginIsInstalled() {\n const { version } = require(\"@pulumi/aws/package.json\");\n\n const pluginExists = fs.pathExistsSync(\n path.join(\n this.pulumiFolder,\n \"plugins\",\n `resource-aws-${version}`,\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\", version],\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;;AACA;;AACA;;AACA;;AAEA;;AAyCO,MAAMA,oBAAoB,GAAG,mBAA7B;;;AAEA,MAAMC,MAAN,CAAa;EAKhBC,WAAW,CAACC,OAAgB,GAAG,EAApB,EAAwB;IAAA;IAAA;IAAA;IAAA;IAC/B,KAAKA,OAAL,GAAeA,OAAf;IAEA,KAAKC,oBAAL,GAA4BC,IAAI,CAACC,IAAL,CACxBH,OAAO,CAACI,YAAR,IAAwBC,OAAO,CAACC,GAAR,EADA,EAExB,YAFwB,EAGxBC,WAAA,CAAGC,QAAH,EAHwB,CAA5B;IAMA,KAAKJ,YAAL,GAAoBF,IAAI,CAACC,IAAL,CAAU,KAAKF,oBAAf,EAAqC,QAArC,CAApB;IACA,KAAKQ,gBAAL,GAAwBP,IAAI,CAACC,IAAL,CAAU,KAAKC,YAAf,EAA6B,QAA7B,CAAxB;EACH;;EAEDM,GAAG,CAACC,OAAD,EAAmB;IAClB,KAAKC,0BAAL;IAEA,MAAMC,IAAI,GAAG,qBAAM,EAAN,EAAU,KAAKb,OAAf,EAAwBW,OAAxB,CAAb;;IAEA,IAAI,CAACG,KAAK,CAACC,OAAN,CAAcF,IAAI,CAACG,OAAnB,CAAL,EAAkC;MAC9BH,IAAI,CAACG,OAAL,GAAe,CAACH,IAAI,CAACG,OAAN,CAAf;IACH,CAPiB,CASlB;;;IACA,MAAMC,SAAS,GAAG,EAAlB;;IACA,KAAK,MAAMC,GAAX,IAAkBL,IAAI,CAACA,IAAvB,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WAAW,EAAE,KAAKvC,YADjB;QAEDwC,wBAAwB,EAAE;MAFzB;IAFT,CAHG,CAAP;EAWH;;AArIe"}
|
|
1
|
+
{"version":3,"file":"Pulumi.js","sources":["../src/Pulumi.ts"],"sourcesContent":["import os from \"os\";\nimport { execa, execaSync } from \"execa\";\nimport { type Readable, type Writable } from \"node:stream\";\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\nexport interface PulumiProcessResult {\n readonly stdout: string;\n readonly stderr: string;\n readonly exitCode: number;\n}\n\nexport interface PulumiProcess extends Promise<PulumiProcessResult> {\n readonly stdin: Writable | null;\n readonly stdout: Readable | null;\n readonly stderr: Readable | null;\n}\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 unknown as PulumiProcess;\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 } = execaSync(\"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 execaSync(\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 fs.removeSync(path.join(pluginsDir, entry));\n }\n }\n }\n }\n}\n"],"names":["FLAG_NON_INTERACTIVE","PulumiError","Error","Pulumi","options","pulumi","path","process","os","rawArgs","args","merge","Array","finalArgs","key","value","i","kebabCase","set","PATH_SEPARATOR","execaArgs","flags","pulumiProcess","execa","wrapped","result","err","Object","downloadBinaries","pulumiAwsVersion","stdout","execaSync","match","pluginsDir","requiredPluginDir","pluginExists","fs","entry","baseName"],"mappings":";;;;;;;;AA6DO,MAAMA,uBAAuB;AAE7B,MAAMC,oBAAoBC;AAAO;AAEjC,MAAMC;IAMT,aAAa,OAAOC,UAAmB,CAAC,CAAC,EAAE;QACvC,MAAMC,SAAS,IAAIF,OAAOC;QAE1B,MAAMC,OAAO,OAAO;QAEpB,MAAMA,OAAO,0BAA0B;QACvC,OAAOA;IACX;IAEA,YAAoBD,UAAmB,CAAC,CAAC,CAAE;QACvC,IAAI,CAAC,OAAO,GAAGA;QAEf,IAAI,CAAC,oBAAoB,GAAGE,uBAAAA,IAAS,CACjCF,QAAQ,YAAY,IAAIG,QAAQ,GAAG,IACnC,cACAC,GAAG,QAAQ;QAGf,IAAI,CAAC,YAAY,GAAGF,uBAAAA,IAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACzD,IAAI,CAAC,gBAAgB,GAAGA,uBAAAA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AO;YACP,KAAK;gBACD,aAAa,IAAI,CAAC,YAAY;gBAC9B,0BAA0B;YAC9B;QACJ;QAKR,IAAIO,SAAAA,cAAiB,CAACH,aAClB,KAAK,MAAMI,SAASD,SAAAA,WAAc,CAACH,YAAa;YAC5C,IAAI,CAACI,MAAM,UAAU,CAAC,oBAAoBA,UAAUH,mBAChD;YAIJ,MAAMI,WAAWD,MAAM,QAAQ,CAAC,WAAWA,MAAM,KAAK,CAAC,GAAG,MAAMA;YAChE,IAAIC,aAAaJ,mBACbE,SAAAA,UAAa,CAAC9B,uBAAAA,IAAS,CAAC2B,YAAYI;QAE5C;IAER;AACJ"}
|
package/README.md
CHANGED
|
@@ -1,76 +1,11 @@
|
|
|
1
1
|
# @webiny/pulumi-sdk
|
|
2
|
-
[](https://www.npmjs.com/package/@webiny/pulumi-sdk)
|
|
3
|
-
[](https://www.npmjs.com/package/@webiny/pulumi-sdk)
|
|
4
|
-
[](https://github.com/prettier/prettier)
|
|
5
|
-
[](http://makeapullrequest.com)
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
const { Pulumi } = require("@webiny/pulumi-sdk");
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
// Note that Pulumi will be installed automatically on first use, you don't need to install it
|
|
16
|
-
// manually first. That's why the `beforePulumiInstall` and `afterPulumiInstall` are exposed.
|
|
17
|
-
const pulumi = new Pulumi({
|
|
18
|
-
execa: {
|
|
19
|
-
cwd: stacksDir,
|
|
20
|
-
env: { PULUMI_CONFIG_PASSPHRASE: process.env.PULUMI_CONFIG_PASSPHRASE }
|
|
21
|
-
},
|
|
22
|
-
args: {
|
|
23
|
-
secretsProvider: "passphrase"
|
|
24
|
-
},
|
|
25
|
-
beforePulumiInstall: () => {
|
|
26
|
-
console.log(
|
|
27
|
-
`💡 It looks like this is your first time using ${green(
|
|
28
|
-
"@webiny/pulumi-sdk"
|
|
29
|
-
)}.`
|
|
30
|
-
);
|
|
31
|
-
spinner.start(`Downloading Pulumi...`);
|
|
32
|
-
},
|
|
33
|
-
afterPulumiInstall: () => {
|
|
34
|
-
spinner.stopAndPersist({
|
|
35
|
-
symbol: green("✔"),
|
|
36
|
-
text: `Pulumi downloaded, continuing...`
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
9
|
+
---
|
|
40
10
|
|
|
41
|
-
|
|
42
|
-
let stackExists = true;
|
|
43
|
-
try {
|
|
44
|
-
const { process } = await pulumi.run({ command: ["stack", "select", env] });
|
|
45
|
-
await process;
|
|
46
|
-
} catch (e) {
|
|
47
|
-
stackExists = false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (!stackExists) {
|
|
51
|
-
const { process } = await pulumi.run({ command: ["stack", "init", env] });
|
|
52
|
-
await process;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If isPreview was set to true in our script, then run `preview` command, otherwise `up`.
|
|
56
|
-
if (isPreview) {
|
|
57
|
-
const pulumi = new Pulumi();
|
|
58
|
-
const { toConsole } = await pulumi.run({
|
|
59
|
-
command: "preview",
|
|
60
|
-
execa: {
|
|
61
|
-
cwd: stacksDir,
|
|
62
|
-
env: { PULUMI_CONFIG_PASSPHRASE: process.env.PULUMI_CONFIG_PASSPHRASE }
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
await toConsole();
|
|
66
|
-
} else {
|
|
67
|
-
const { toConsole } = await pulumi.run({
|
|
68
|
-
command: "up",
|
|
69
|
-
args: {
|
|
70
|
-
yes: true,
|
|
71
|
-
skipPreview: true
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
await toConsole();
|
|
75
|
-
}
|
|
76
|
-
```
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/downloadBinaries.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (downloadFolder: string, beforeInstall?: () => void, afterInstall?: () => void) => Promise<boolean>;
|
|
2
1
|
export default _default;
|
|
2
|
+
declare function _default(downloadFolder: string, beforeInstall?: () => void, afterInstall?: () => void): Promise<boolean>;
|
package/downloadBinaries.js
CHANGED
|
@@ -1,107 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const download = require("download");
|
|
15
|
-
|
|
16
|
-
const path = require("path");
|
|
17
|
-
|
|
18
|
-
const decompress = require("decompress");
|
|
19
|
-
|
|
20
|
-
const semver = require("semver"); // We gotta sanitize the package version, since on a few occasions, we've detected the Pulumi version
|
|
21
|
-
// can look like the following: "2.25.2+dirty". We want to ensure only "2.25.2" is returned.
|
|
22
|
-
// @see https://github.com/pulumi/pulumi/issues/6847
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const getPulumiVersion = () => {
|
|
26
|
-
const {
|
|
27
|
-
version
|
|
28
|
-
} = require("@pulumi/pulumi/package.json");
|
|
29
|
-
|
|
30
|
-
return semver.clean(version);
|
|
1
|
+
import os from "os";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import adm_zip from "adm-zip";
|
|
5
|
+
import semver from "semver";
|
|
6
|
+
import { findUpSync } from "find-up";
|
|
7
|
+
import { loadJsonFileSync } from "load-json-file";
|
|
8
|
+
import { downloadFile } from "./downloadFile.js";
|
|
9
|
+
import * as __rspack_external_tar from "tar";
|
|
10
|
+
const getPulumiVersion = ()=>{
|
|
11
|
+
const pkgJsonPath = findUpSync("node_modules/@pulumi/pulumi/package.json");
|
|
12
|
+
const { version } = loadJsonFileSync(pkgJsonPath);
|
|
13
|
+
return semver.clean(version);
|
|
31
14
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
case "linux":
|
|
50
|
-
await setupLinux(downloadFolder);
|
|
51
|
-
break;
|
|
52
|
-
|
|
53
|
-
case "win32":
|
|
54
|
-
await setupWindows(downloadFolder);
|
|
55
|
-
break;
|
|
56
|
-
|
|
57
|
-
default:
|
|
58
|
-
throw Error(`Cannot download Pulumi binaries - platform "${platform}" not supported. Supported ones are "darwin", "linux", and "win32"`);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (typeof afterInstall === "function") {
|
|
62
|
-
await afterInstall();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return true;
|
|
15
|
+
const downloadBinaries = async (downloadFolder, beforeInstall, afterInstall)=>{
|
|
16
|
+
if (fs.existsSync(downloadFolder)) return false;
|
|
17
|
+
if ("function" == typeof beforeInstall) await beforeInstall();
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
if ("darwin" !== platform && "linux" !== platform && "win32" !== platform) throw Error(`Cannot download Pulumi binaries - platform "${platform}" not supported. Supported ones are "darwin", "linux", and "win32"`);
|
|
20
|
+
try {
|
|
21
|
+
await setupPlatform(downloadFolder, platform);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
fs.rmSync(downloadFolder, {
|
|
24
|
+
recursive: true,
|
|
25
|
+
force: true
|
|
26
|
+
});
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
if ("function" == typeof afterInstall) await afterInstall();
|
|
30
|
+
return true;
|
|
66
31
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
32
|
+
const SUPPORTED_ARCHITECTURES = [
|
|
33
|
+
"x64",
|
|
34
|
+
"arm64"
|
|
35
|
+
];
|
|
36
|
+
function getDownloadFilename(version, platform) {
|
|
37
|
+
switch(platform){
|
|
38
|
+
case "darwin":
|
|
39
|
+
{
|
|
40
|
+
const arch = SUPPORTED_ARCHITECTURES.includes(process.arch) ? process.arch : "x64";
|
|
41
|
+
return `pulumi-v${version}-darwin-${arch}.tar.gz`;
|
|
42
|
+
}
|
|
43
|
+
case "linux":
|
|
44
|
+
return `pulumi-v${version}-linux-x64.tar.gz`;
|
|
45
|
+
case "win32":
|
|
46
|
+
return `pulumi-v${version}-windows-x64.zip`;
|
|
47
|
+
}
|
|
82
48
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
49
|
+
async function setupPlatform(downloadFolder, platform) {
|
|
50
|
+
const version = getPulumiVersion();
|
|
51
|
+
const filename = getDownloadFilename(version, platform);
|
|
52
|
+
const downloadUrl = "https://get.pulumi.com/releases/sdk/" + filename;
|
|
53
|
+
const absoluteFilename = path.join(downloadFolder, filename);
|
|
54
|
+
await downloadFile(downloadUrl, absoluteFilename);
|
|
55
|
+
if ("win32" === platform) extractZip(absoluteFilename, path.join(downloadFolder, "pulumi"));
|
|
56
|
+
else await __rspack_external_tar.extract({
|
|
57
|
+
cwd: downloadFolder,
|
|
58
|
+
file: absoluteFilename
|
|
59
|
+
});
|
|
60
|
+
fs.unlinkSync(absoluteFilename);
|
|
61
|
+
}
|
|
62
|
+
function extractZip(zipPath, destination) {
|
|
63
|
+
fs.mkdirSync(destination, {
|
|
64
|
+
recursive: true
|
|
65
|
+
});
|
|
66
|
+
const zip = new adm_zip(zipPath);
|
|
67
|
+
const stripComponents = 2;
|
|
68
|
+
const destinationResolved = path.resolve(destination);
|
|
69
|
+
for (const entry of zip.getEntries()){
|
|
70
|
+
if (entry.isDirectory) continue;
|
|
71
|
+
const segments = entry.entryName.split(/[\\/]+/).slice(stripComponents);
|
|
72
|
+
if (0 === segments.length) continue;
|
|
73
|
+
if (segments.some((s)=>".." === s || path.isAbsolute(s))) throw new Error(`Unsafe zip entry: ${entry.entryName}`);
|
|
74
|
+
const targetPath = path.resolve(destinationResolved, ...segments);
|
|
75
|
+
if (!targetPath.startsWith(destinationResolved + path.sep)) throw new Error(`Zip slip detected: ${entry.entryName}`);
|
|
76
|
+
fs.mkdirSync(path.dirname(targetPath), {
|
|
77
|
+
recursive: true
|
|
78
|
+
});
|
|
79
|
+
fs.writeFileSync(targetPath, entry.getData());
|
|
80
|
+
}
|
|
95
81
|
}
|
|
82
|
+
export default downloadBinaries;
|
|
96
83
|
|
|
97
|
-
|
|
98
|
-
const version = getPulumiVersion();
|
|
99
|
-
const filename = `pulumi-v${version}-linux-x64.tar.gz`;
|
|
100
|
-
const downloadUrl = "https://get.pulumi.com/releases/sdk/" + filename;
|
|
101
|
-
await download(downloadUrl, downloadFolder);
|
|
102
|
-
await tar.extract({
|
|
103
|
-
cwd: downloadFolder,
|
|
104
|
-
file: path.join(downloadFolder, filename)
|
|
105
|
-
});
|
|
106
|
-
fs.unlinkSync(path.join(downloadFolder, filename));
|
|
107
|
-
}
|
|
84
|
+
//# sourceMappingURL=downloadBinaries.js.map
|
package/downloadBinaries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"downloadBinaries.js","sources":["../src/downloadBinaries.ts"],"sourcesContent":["import os from \"os\";\nimport * as tar from \"tar\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport AdmZip from \"adm-zip\";\nimport semver from \"semver\";\nimport { findUpSync } from \"find-up\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { downloadFile } from \"./downloadFile.js\";\nimport { PackageJson } from \"type-fest\";\n\n// We need to sanitize the package version because, occasionally, we've noticed that the Pulumi version\n// can look like the following: \"2.25.2+dirty\". We want to ensure only \"2.25.2\" is returned.\n// @see https://github.com/pulumi/pulumi/issues/6847\nconst getPulumiVersion = () => {\n const pkgJsonPath = findUpSync(\"node_modules/@pulumi/pulumi/package.json\");\n const { version } = loadJsonFileSync<PackageJson>(pkgJsonPath!);\n return semver.clean(version!);\n};\n\nexport default async (\n downloadFolder: string,\n beforeInstall?: () => void,\n afterInstall?: () => void\n) => {\n if (fs.existsSync(downloadFolder)) {\n return false;\n }\n\n if (typeof beforeInstall === \"function\") {\n await beforeInstall();\n }\n\n const platform = os.platform();\n if (platform !== \"darwin\" && platform !== \"linux\" && platform !== \"win32\") {\n throw Error(\n `Cannot download Pulumi binaries - platform \"${platform}\" not supported. Supported ones are \"darwin\", \"linux\", and \"win32\"`\n );\n }\n\n try {\n await setupPlatform(downloadFolder, platform);\n } catch (error) {\n fs.rmSync(downloadFolder, { recursive: true, force: true });\n throw error;\n }\n\n if (typeof afterInstall === \"function\") {\n await afterInstall();\n }\n\n return true;\n};\n\nconst SUPPORTED_ARCHITECTURES = [\"x64\", \"arm64\"];\n\ntype SupportedPlatform = \"darwin\" | \"linux\" | \"win32\";\n\nfunction getDownloadFilename(version: string, platform: SupportedPlatform): string {\n switch (platform) {\n case \"darwin\": {\n const arch = SUPPORTED_ARCHITECTURES.includes(process.arch) ? process.arch : \"x64\";\n return `pulumi-v${version}-darwin-${arch}.tar.gz`;\n }\n case \"linux\":\n return `pulumi-v${version}-linux-x64.tar.gz`;\n case \"win32\":\n return `pulumi-v${version}-windows-x64.zip`;\n }\n}\n\nasync function setupPlatform(downloadFolder: string, platform: SupportedPlatform) {\n const version = getPulumiVersion();\n const filename = getDownloadFilename(version!, platform);\n const downloadUrl = \"https://get.pulumi.com/releases/sdk/\" + filename;\n\n const absoluteFilename = path.join(downloadFolder, filename);\n await downloadFile(downloadUrl, absoluteFilename);\n\n if (platform === \"win32\") {\n extractZip(absoluteFilename, path.join(downloadFolder, \"pulumi\"));\n } else {\n await tar.extract({ cwd: downloadFolder, file: absoluteFilename });\n }\n\n fs.unlinkSync(absoluteFilename);\n}\n\nfunction extractZip(zipPath: string, destination: string) {\n fs.mkdirSync(destination, { recursive: true });\n\n const zip = new AdmZip(zipPath);\n const stripComponents = 2;\n const destinationResolved = path.resolve(destination);\n\n for (const entry of zip.getEntries()) {\n if (entry.isDirectory) {\n continue;\n }\n\n const segments = entry.entryName.split(/[\\\\/]+/).slice(stripComponents);\n if (segments.length === 0) {\n continue;\n }\n\n if (segments.some(s => s === \"..\" || path.isAbsolute(s))) {\n throw new Error(`Unsafe zip entry: ${entry.entryName}`);\n }\n\n const targetPath = path.resolve(destinationResolved, ...segments);\n if (!targetPath.startsWith(destinationResolved + path.sep)) {\n throw new Error(`Zip slip detected: ${entry.entryName}`);\n }\n\n fs.mkdirSync(path.dirname(targetPath), { recursive: true });\n fs.writeFileSync(targetPath, entry.getData());\n }\n}\n"],"names":["getPulumiVersion","pkgJsonPath","findUpSync","version","loadJsonFileSync","semver","downloadFolder","beforeInstall","afterInstall","fs","platform","os","Error","setupPlatform","error","SUPPORTED_ARCHITECTURES","getDownloadFilename","arch","process","filename","downloadUrl","absoluteFilename","path","downloadFile","extractZip","tar","zipPath","destination","zip","AdmZip","stripComponents","destinationResolved","entry","segments","s","targetPath"],"mappings":";;;;;;;;;AAcA,MAAMA,mBAAmB;IACrB,MAAMC,cAAcC,WAAW;IAC/B,MAAM,EAAEC,OAAO,EAAE,GAAGC,iBAA8BH;IAClD,OAAOI,OAAO,KAAK,CAACF;AACxB;AAEA,yBAAe,OACXG,gBACAC,eACAC;IAEA,IAAIC,GAAG,UAAU,CAACH,iBACd,OAAO;IAGX,IAAI,AAAyB,cAAzB,OAAOC,eACP,MAAMA;IA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GAAG,SAAS,CAACkB,aAAa;QAAE,WAAW;IAAK;IAE5C,MAAMC,MAAM,IAAIC,QAAOH;IACvB,MAAMI,kBAAkB;IACxB,MAAMC,sBAAsBT,KAAK,OAAO,CAACK;IAEzC,KAAK,MAAMK,SAASJ,IAAI,UAAU,GAAI;QAClC,IAAII,MAAM,WAAW,EACjB;QAGJ,MAAMC,WAAWD,MAAM,SAAS,CAAC,KAAK,CAAC,UAAU,KAAK,CAACF;QACvD,IAAIG,AAAoB,MAApBA,SAAS,MAAM,EACf;QAGJ,IAAIA,SAAS,IAAI,CAACC,CAAAA,IAAKA,AAAM,SAANA,KAAcZ,KAAK,UAAU,CAACY,KACjD,MAAM,IAAItB,MAAM,CAAC,kBAAkB,EAAEoB,MAAM,SAAS,EAAE;QAG1D,MAAMG,aAAab,KAAK,OAAO,CAACS,wBAAwBE;QACxD,IAAI,CAACE,WAAW,UAAU,CAACJ,sBAAsBT,KAAK,GAAG,GACrD,MAAM,IAAIV,MAAM,CAAC,mBAAmB,EAAEoB,MAAM,SAAS,EAAE;QAG3DvB,GAAG,SAAS,CAACa,KAAK,OAAO,CAACa,aAAa;YAAE,WAAW;QAAK;QACzD1B,GAAG,aAAa,CAAC0B,YAAYH,MAAM,OAAO;IAC9C;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const downloadFile: (url: string, file: string) => Promise<void>;
|
package/downloadFile.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { dirname } from "path";
|
|
2
|
+
import fs_extra from "fs-extra";
|
|
3
|
+
import { Readable } from "stream";
|
|
4
|
+
const downloadFile = async (url, file)=>{
|
|
5
|
+
const res = await fetch(url);
|
|
6
|
+
if (!res.body) throw new Error("Response body is null");
|
|
7
|
+
const nodeStream = Readable.fromWeb(res.body);
|
|
8
|
+
await fs_extra.ensureDir(dirname(file));
|
|
9
|
+
await new Promise((resolve, reject)=>{
|
|
10
|
+
const fileStream = fs_extra.createWriteStream(file);
|
|
11
|
+
nodeStream.pipe(fileStream);
|
|
12
|
+
nodeStream.on("error", (err)=>{
|
|
13
|
+
reject(err);
|
|
14
|
+
});
|
|
15
|
+
fileStream.on("finish", ()=>{
|
|
16
|
+
resolve();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export { downloadFile };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=downloadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadFile.js","sources":["../src/downloadFile.ts"],"sourcesContent":["import { dirname } from \"path\";\nimport fs from \"fs-extra\";\nimport { Readable } from \"stream\";\nimport type { ReadableStream as NodeReadableStream } from \"stream/web\";\n\nexport const downloadFile = async (url: string, file: string) => {\n const res = await fetch(url);\n\n if (!res.body) {\n throw new Error(\"Response body is null\");\n }\n\n const nodeStream = Readable.fromWeb(res.body as NodeReadableStream);\n\n await fs.ensureDir(dirname(file));\n\n await new Promise<void>((resolve, reject) => {\n const fileStream = fs.createWriteStream(file);\n nodeStream.pipe(fileStream);\n nodeStream.on(\"error\", (err: Error) => {\n reject(err);\n });\n fileStream.on(\"finish\", () => {\n resolve();\n });\n });\n};\n"],"names":["downloadFile","url","file","res","fetch","Error","nodeStream","Readable","fs","dirname","Promise","resolve","reject","fileStream","err"],"mappings":";;;AAKO,MAAMA,eAAe,OAAOC,KAAaC;IAC5C,MAAMC,MAAM,MAAMC,MAAMH;IAExB,IAAI,CAACE,IAAI,IAAI,EACT,MAAM,IAAIE,MAAM;IAGpB,MAAMC,aAAaC,SAAS,OAAO,CAACJ,IAAI,IAAI;IAE5C,MAAMK,SAAAA,SAAY,CAACC,QAAQP;IAE3B,MAAM,IAAIQ,QAAc,CAACC,SAASC;QAC9B,MAAMC,aAAaL,SAAAA,iBAAoB,CAACN;QACxCI,WAAW,IAAI,CAACO;QAChBP,WAAW,EAAE,CAAC,SAAS,CAACQ;YACpBF,OAAOE;QACX;QACAD,WAAW,EAAE,CAAC,UAAU;YACpBF;QACJ;IACJ;AACJ"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Pulumi";
|
|
1
|
+
export * from "./Pulumi.js";
|
package/index.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _Pulumi = require("./Pulumi");
|
|
8
|
-
|
|
9
|
-
Object.keys(_Pulumi).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _Pulumi[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _Pulumi[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
1
|
+
export * from "./Pulumi.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/pulumi-sdk",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.5387e5f7c8",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -10,28 +14,27 @@
|
|
|
10
14
|
"author": "Webiny Ltd",
|
|
11
15
|
"license": "MIT",
|
|
12
16
|
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
"directory": "dist"
|
|
17
|
+
"access": "public"
|
|
15
18
|
},
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@pulumi/aws": "^
|
|
18
|
-
"@pulumi/pulumi": "^3.
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"fs-extra": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
20
|
+
"@pulumi/aws": "^7.43.0",
|
|
21
|
+
"@pulumi/pulumi": "^3.259.0",
|
|
22
|
+
"adm-zip": "0.6.0",
|
|
23
|
+
"execa": "10.0.1",
|
|
24
|
+
"find-up": "8.0.0",
|
|
25
|
+
"fs-extra": "11.4.0",
|
|
26
|
+
"load-json-file": "7.0.1",
|
|
27
|
+
"lodash": "4.18.1",
|
|
28
|
+
"semver": "7.8.5",
|
|
29
|
+
"tar": "7.5.22"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"typescript": "4.7.4"
|
|
32
|
+
"@types/adm-zip": "0.5.8",
|
|
33
|
+
"@types/lodash": "4.17.25",
|
|
34
|
+
"@webiny/build-tools": "0.0.0-unstable.5387e5f7c8",
|
|
35
|
+
"rimraf": "6.1.3",
|
|
36
|
+
"type-fest": "5.8.0",
|
|
37
|
+
"typescript": "7.0.2"
|
|
35
38
|
},
|
|
36
39
|
"adio": {
|
|
37
40
|
"ignore": {
|
|
@@ -41,9 +44,8 @@
|
|
|
41
44
|
]
|
|
42
45
|
}
|
|
43
46
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
}
|
|
48
|
-
"gitHead": "496cf268acd5b092c860b62d75c7d765c9472043"
|
|
47
|
+
"gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
|
|
48
|
+
"webiny": {
|
|
49
|
+
"publishFrom": "dist"
|
|
50
|
+
}
|
|
49
51
|
}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Pulumi\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|