@powerlines/plugin-pulumi 0.6.4 → 0.6.6
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/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/plugin.cjs +63 -0
- package/dist/plugin.d.cts +17 -0
- package/dist/plugin.d.cts.map +1 -0
- package/dist/plugin.d.mts +17 -0
- package/dist/plugin.d.mts.map +1 -0
- package/dist/plugin.mjs +62 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/types/_internal.cjs +0 -0
- package/dist/types/_internal.d.cts +9 -0
- package/dist/types/_internal.d.cts.map +1 -0
- package/dist/types/_internal.d.mts +9 -0
- package/dist/types/_internal.d.mts.map +1 -0
- package/dist/types/_internal.mjs +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +40 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +40 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types/pulumi.cjs +0 -0
- package/dist/types/pulumi.d.cts +12 -0
- package/dist/types/pulumi.d.cts.map +1 -0
- package/dist/types/pulumi.d.mts +12 -0
- package/dist/types/pulumi.d.mts.map +1 -0
- package/dist/types/pulumi.mjs +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/index.cjs
ADDED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
+
import { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord } from "./types/pulumi.cjs";
|
|
3
|
+
import { plugin } from "./plugin.cjs";
|
|
4
|
+
import { MaybePromise } from "@stryke/types";
|
|
5
|
+
import { PluginContext } from "powerlines";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
|
+
pulumi?: PulumiPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
interface Hooks<TContext extends PluginContext> {
|
|
13
|
+
/**
|
|
14
|
+
* A hook that can be implemented to deploy Pulumi resources after the main build process. This allows you to define and manage your infrastructure as code using Pulumi, directly from your Powerlines plugin.
|
|
15
|
+
*
|
|
16
|
+
* @param this - The plugin context.
|
|
17
|
+
* @param resources - An object containing the Pulumi resources' outputs that were added in earlier hook invocations.
|
|
18
|
+
* @returns Optionally, the resources' outputs that were added during the Pulumi deployment that will be passed to the next hook invocation.
|
|
19
|
+
*/
|
|
20
|
+
deployPulumi?: (this: TContext, resources?: PulumiOutputRecord) => MaybePromise<DeployPulumiResult>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { DeployPulumiResult, PulumiOutputRecord, PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩDeployPulumiResult, __ΩPulumiOutputRecord, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig, plugin };
|
|
25
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAwBY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;EAAA,UAGD,KAAA,kBAAuB,aAAA;IAPkB;;;;;;;IAejD,YAAA,IACE,IAAA,EAAM,QAAA,EACN,SAAA,GAAY,kBAAA,KACT,YAAA,CAAa,kBAAA;EAAA;AAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
+
import { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord } from "./types/pulumi.mjs";
|
|
3
|
+
import { plugin } from "./plugin.mjs";
|
|
4
|
+
import { MaybePromise } from "@stryke/types";
|
|
5
|
+
import { PluginContext } from "powerlines";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
|
+
pulumi?: PulumiPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
interface Hooks<TContext extends PluginContext> {
|
|
13
|
+
/**
|
|
14
|
+
* A hook that can be implemented to deploy Pulumi resources after the main build process. This allows you to define and manage your infrastructure as code using Pulumi, directly from your Powerlines plugin.
|
|
15
|
+
*
|
|
16
|
+
* @param this - The plugin context.
|
|
17
|
+
* @param resources - An object containing the Pulumi resources' outputs that were added in earlier hook invocations.
|
|
18
|
+
* @returns Optionally, the resources' outputs that were added during the Pulumi deployment that will be passed to the next hook invocation.
|
|
19
|
+
*/
|
|
20
|
+
deployPulumi?: (this: TContext, resources?: PulumiOutputRecord) => MaybePromise<DeployPulumiResult>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { DeployPulumiResult, PulumiOutputRecord, PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩDeployPulumiResult, __ΩPulumiOutputRecord, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig, plugin };
|
|
25
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAwBY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;EAAA,UAGD,KAAA,kBAAuB,aAAA;IAPkB;;;;;;;IAejD,YAAA,IACE,IAAA,EAAM,QAAA,EACN,SAAA,GAAY,kBAAA,KACT,YAAA,CAAa,kBAAA;EAAA;AAAA"}
|
package/dist/index.mjs
ADDED
package/dist/plugin.cjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let _pulumi_pulumi_automation = require("@pulumi/pulumi/automation");
|
|
3
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
4
|
+
let defu = require("defu");
|
|
5
|
+
defu = require_runtime.__toESM(defu);
|
|
6
|
+
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
7
|
+
|
|
8
|
+
//#region src/plugin.ts
|
|
9
|
+
/**
|
|
10
|
+
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
11
|
+
*
|
|
12
|
+
* @see https://www.pulumi.com
|
|
13
|
+
*
|
|
14
|
+
* @param options - The Pulumi plugin user configuration options.
|
|
15
|
+
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
16
|
+
*/
|
|
17
|
+
const plugin = (options = {}) => {
|
|
18
|
+
return [{
|
|
19
|
+
name: "pulumi",
|
|
20
|
+
async config() {
|
|
21
|
+
return { deploy: { pulumi: (0, defu.default)(options, {
|
|
22
|
+
projectName: this.config.name,
|
|
23
|
+
settings: {}
|
|
24
|
+
}) } };
|
|
25
|
+
},
|
|
26
|
+
async configResolved() {
|
|
27
|
+
const organizationName = (0, _stryke_string_format_kebab_case.kebabCase)((0, powerlines_plugin_utils.getOrganizationName)(this));
|
|
28
|
+
const workspaceName = (0, _stryke_string_format_kebab_case.kebabCase)((0, powerlines_plugin_utils.getWorkspaceName)(this));
|
|
29
|
+
const projectName = (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name);
|
|
30
|
+
this.config.pulumi.stackName ??= (0, _pulumi_pulumi_automation.fullyQualifiedStackName)(organizationName || workspaceName || projectName, `${workspaceName && workspaceName !== organizationName && workspaceName !== projectName ? `${workspaceName}-` : ""}${projectName}`, this.config.mode);
|
|
31
|
+
},
|
|
32
|
+
async deploy() {
|
|
33
|
+
this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`);
|
|
34
|
+
this.pulumi ??= await _pulumi_pulumi_automation.LocalWorkspace.createOrSelectStack({
|
|
35
|
+
...this.config.pulumi,
|
|
36
|
+
program: async () => {
|
|
37
|
+
this.debug("Executing Pulumi program to define infrastructure resources.");
|
|
38
|
+
await this.$$internal.callHook("deployPulumi", {
|
|
39
|
+
sequential: true,
|
|
40
|
+
result: "merge"
|
|
41
|
+
});
|
|
42
|
+
this.debug("Pulumi program execution completed. Resources have been defined.");
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
await this.pulumi.workspace.installPlugin("terraform-provider", "v1.0.2");
|
|
46
|
+
if (this.config.pulumi.stackSettings && Object.keys(this.config.pulumi.stackSettings).length > 0) await this.pulumi.workspace.saveStackSettings(this.pulumi.name, this.config.pulumi.stackSettings);
|
|
47
|
+
await this.pulumi.workspace.saveProjectSettings((0, defu.default)(this.config.pulumi.projectSettings ?? {}, {
|
|
48
|
+
name: this.config.name,
|
|
49
|
+
runtime: { name: "nodejs" },
|
|
50
|
+
description: this.config.description,
|
|
51
|
+
author: this.config.organization
|
|
52
|
+
}));
|
|
53
|
+
this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);
|
|
54
|
+
await this.pulumi.refresh({ onOutput: this.debug.bind(this) });
|
|
55
|
+
if (this.config.pulumi.destroy) await this.pulumi.destroy({ onOutput: this.debug.bind(this) });
|
|
56
|
+
const result = await this.pulumi.up({ onOutput: this.debug.bind(this) });
|
|
57
|
+
this.info(`Successfully deployed ${this.pulumi.name} (v${result.summary.version}): ${result.summary.message}`);
|
|
58
|
+
}
|
|
59
|
+
}];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.default = plugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PulumiPluginOptions } from "./types/plugin.cjs";
|
|
2
|
+
import { UNSAFE_PulumiPluginContext } from "./types/_internal.cjs";
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/plugin.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.pulumi.com
|
|
10
|
+
*
|
|
11
|
+
* @param options - The Pulumi plugin user configuration options.
|
|
12
|
+
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
13
|
+
*/
|
|
14
|
+
declare const plugin: <TContext extends UNSAFE_PulumiPluginContext = UNSAFE_PulumiPluginContext>(options?: PulumiPluginOptions) => Plugin<TContext>[];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { plugin };
|
|
17
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;AAsCA;;;;;;cAAa,MAAA,oBACM,0BAAA,GAA6B,0BAAA,EAE9C,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PulumiPluginOptions } from "./types/plugin.mjs";
|
|
2
|
+
import { UNSAFE_PulumiPluginContext } from "./types/_internal.mjs";
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/plugin.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.pulumi.com
|
|
10
|
+
*
|
|
11
|
+
* @param options - The Pulumi plugin user configuration options.
|
|
12
|
+
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
13
|
+
*/
|
|
14
|
+
declare const plugin: <TContext extends UNSAFE_PulumiPluginContext = UNSAFE_PulumiPluginContext>(options?: PulumiPluginOptions) => Plugin<TContext>[];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { plugin };
|
|
17
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;AAsCA;;;;;;cAAa,MAAA,oBACM,0BAAA,GAA6B,0BAAA,EAE9C,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/plugin.mjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LocalWorkspace, fullyQualifiedStackName } from "@pulumi/pulumi/automation";
|
|
2
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
3
|
+
import defu from "defu";
|
|
4
|
+
import { getOrganizationName, getWorkspaceName } from "powerlines/plugin-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/plugin.ts
|
|
7
|
+
/**
|
|
8
|
+
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
9
|
+
*
|
|
10
|
+
* @see https://www.pulumi.com
|
|
11
|
+
*
|
|
12
|
+
* @param options - The Pulumi plugin user configuration options.
|
|
13
|
+
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
14
|
+
*/
|
|
15
|
+
const plugin = (options = {}) => {
|
|
16
|
+
return [{
|
|
17
|
+
name: "pulumi",
|
|
18
|
+
async config() {
|
|
19
|
+
return { deploy: { pulumi: defu(options, {
|
|
20
|
+
projectName: this.config.name,
|
|
21
|
+
settings: {}
|
|
22
|
+
}) } };
|
|
23
|
+
},
|
|
24
|
+
async configResolved() {
|
|
25
|
+
const organizationName = kebabCase(getOrganizationName(this));
|
|
26
|
+
const workspaceName = kebabCase(getWorkspaceName(this));
|
|
27
|
+
const projectName = kebabCase(this.config.name);
|
|
28
|
+
this.config.pulumi.stackName ??= fullyQualifiedStackName(organizationName || workspaceName || projectName, `${workspaceName && workspaceName !== organizationName && workspaceName !== projectName ? `${workspaceName}-` : ""}${projectName}`, this.config.mode);
|
|
29
|
+
},
|
|
30
|
+
async deploy() {
|
|
31
|
+
this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`);
|
|
32
|
+
this.pulumi ??= await LocalWorkspace.createOrSelectStack({
|
|
33
|
+
...this.config.pulumi,
|
|
34
|
+
program: async () => {
|
|
35
|
+
this.debug("Executing Pulumi program to define infrastructure resources.");
|
|
36
|
+
await this.$$internal.callHook("deployPulumi", {
|
|
37
|
+
sequential: true,
|
|
38
|
+
result: "merge"
|
|
39
|
+
});
|
|
40
|
+
this.debug("Pulumi program execution completed. Resources have been defined.");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
await this.pulumi.workspace.installPlugin("terraform-provider", "v1.0.2");
|
|
44
|
+
if (this.config.pulumi.stackSettings && Object.keys(this.config.pulumi.stackSettings).length > 0) await this.pulumi.workspace.saveStackSettings(this.pulumi.name, this.config.pulumi.stackSettings);
|
|
45
|
+
await this.pulumi.workspace.saveProjectSettings(defu(this.config.pulumi.projectSettings ?? {}, {
|
|
46
|
+
name: this.config.name,
|
|
47
|
+
runtime: { name: "nodejs" },
|
|
48
|
+
description: this.config.description,
|
|
49
|
+
author: this.config.organization
|
|
50
|
+
}));
|
|
51
|
+
this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);
|
|
52
|
+
await this.pulumi.refresh({ onOutput: this.debug.bind(this) });
|
|
53
|
+
if (this.config.pulumi.destroy) await this.pulumi.destroy({ onOutput: this.debug.bind(this) });
|
|
54
|
+
const result = await this.pulumi.up({ onOutput: this.debug.bind(this) });
|
|
55
|
+
this.info(`Successfully deployed ${this.pulumi.name} (v${result.summary.version}): ${result.summary.message}`);
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { plugin as default };
|
|
62
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n fullyQualifiedStackName,\n LocalWorkspace,\n ProjectSettings\n} from \"@pulumi/pulumi/automation\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getOrganizationName, getWorkspaceName } from \"powerlines/plugin-utils\";\nimport { UNSAFE_PulumiPluginContext } from \"./types/_internal\";\nimport { PulumiPluginOptions } from \"./types/plugin\";\n\n/**\n * A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.\n *\n * @see https://www.pulumi.com\n *\n * @param options - The Pulumi plugin user configuration options.\n * @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.\n */\nexport const plugin = <\n TContext extends UNSAFE_PulumiPluginContext = UNSAFE_PulumiPluginContext\n>(\n options: PulumiPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"pulumi\",\n async config() {\n return {\n deploy: {\n pulumi: defu(options, {\n projectName: this.config.name,\n settings: {}\n })\n }\n };\n },\n async configResolved() {\n const organizationName = kebabCase(getOrganizationName(this));\n const workspaceName = kebabCase(getWorkspaceName(this));\n const projectName = kebabCase(this.config.name);\n\n this.config.pulumi.stackName ??= fullyQualifiedStackName(\n organizationName || workspaceName || projectName,\n `${\n workspaceName &&\n workspaceName !== organizationName &&\n workspaceName !== projectName\n ? `${workspaceName}-`\n : \"\"\n }${projectName}`,\n this.config.mode\n );\n },\n async deploy() {\n this.info(\n `Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`\n );\n\n this.pulumi ??= await LocalWorkspace.createOrSelectStack({\n ...(this.config.pulumi as Parameters<\n typeof LocalWorkspace.createOrSelectStack\n >[0]),\n program: async () => {\n this.debug(\n \"Executing Pulumi program to define infrastructure resources.\"\n );\n\n await this.$$internal.callHook(\"deployPulumi\", {\n sequential: true,\n result: \"merge\"\n });\n\n this.debug(\n \"Pulumi program execution completed. Resources have been defined.\"\n );\n }\n });\n await this.pulumi.workspace.installPlugin(\n \"terraform-provider\",\n \"v1.0.2\"\n );\n\n if (\n this.config.pulumi.stackSettings &&\n Object.keys(this.config.pulumi.stackSettings).length > 0\n ) {\n await this.pulumi.workspace.saveStackSettings(\n this.pulumi.name,\n this.config.pulumi.stackSettings\n );\n }\n\n await this.pulumi.workspace.saveProjectSettings(\n defu(this.config.pulumi.projectSettings ?? {}, {\n name: this.config.name,\n runtime: { name: \"nodejs\" },\n description: this.config.description,\n author: this.config.organization\n }) as ProjectSettings\n );\n\n this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);\n\n await this.pulumi.refresh({ onOutput: this.debug.bind(this) });\n\n if (this.config.pulumi.destroy) {\n await this.pulumi.destroy({\n onOutput: this.debug.bind(this)\n });\n }\n\n const result = await this.pulumi.up({\n onOutput: this.debug.bind(this)\n });\n\n this.info(\n `Successfully deployed ${this.pulumi.name} (v${\n result.summary.version\n }): ${result.summary.message}`\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;AAsCA,MAAa,UAGX,UAA+B,EAAE,KACV;AACvB,QAAO,CACL;EACE,MAAM;EACN,MAAM,SAAS;AACb,UAAO,EACL,QAAQ,EACN,QAAQ,KAAK,SAAS;IACpB,aAAa,KAAK,OAAO;IACzB,UAAU,EAAE;IACb,CAAC,EACH,EACF;;EAEH,MAAM,iBAAiB;GACrB,MAAM,mBAAmB,UAAU,oBAAoB,KAAK,CAAC;GAC7D,MAAM,gBAAgB,UAAU,iBAAiB,KAAK,CAAC;GACvD,MAAM,cAAc,UAAU,KAAK,OAAO,KAAK;AAE/C,QAAK,OAAO,OAAO,cAAc,wBAC/B,oBAAoB,iBAAiB,aACrC,GACE,iBACA,kBAAkB,oBAClB,kBAAkB,cACd,GAAG,cAAc,KACjB,KACH,eACH,KAAK,OAAO,KACb;;EAEH,MAAM,SAAS;AACb,QAAK,KACH,wCAAwC,KAAK,OAAO,OAAO,YAC5D;AAED,QAAK,WAAW,MAAM,eAAe,oBAAoB;IACvD,GAAI,KAAK,OAAO;IAGhB,SAAS,YAAY;AACnB,UAAK,MACH,+DACD;AAED,WAAM,KAAK,WAAW,SAAS,gBAAgB;MAC7C,YAAY;MACZ,QAAQ;MACT,CAAC;AAEF,UAAK,MACH,mEACD;;IAEJ,CAAC;AACF,SAAM,KAAK,OAAO,UAAU,cAC1B,sBACA,SACD;AAED,OACE,KAAK,OAAO,OAAO,iBACnB,OAAO,KAAK,KAAK,OAAO,OAAO,cAAc,CAAC,SAAS,EAEvD,OAAM,KAAK,OAAO,UAAU,kBAC1B,KAAK,OAAO,MACZ,KAAK,OAAO,OAAO,cACpB;AAGH,SAAM,KAAK,OAAO,UAAU,oBAC1B,KAAK,KAAK,OAAO,OAAO,mBAAmB,EAAE,EAAE;IAC7C,MAAM,KAAK,OAAO;IAClB,SAAS,EAAE,MAAM,UAAU;IAC3B,aAAa,KAAK,OAAO;IACzB,QAAQ,KAAK,OAAO;IACrB,CAAC,CACH;AAED,QAAK,KAAK,2BAA2B,KAAK,OAAO,OAAO,YAAY;AAEpE,SAAM,KAAK,OAAO,QAAQ,EAAE,UAAU,KAAK,MAAM,KAAK,KAAK,EAAE,CAAC;AAE9D,OAAI,KAAK,OAAO,OAAO,QACrB,OAAM,KAAK,OAAO,QAAQ,EACxB,UAAU,KAAK,MAAM,KAAK,KAAK,EAChC,CAAC;GAGJ,MAAM,SAAS,MAAM,KAAK,OAAO,GAAG,EAClC,UAAU,KAAK,MAAM,KAAK,KAAK,EAChC,CAAC;AAEF,QAAK,KACH,yBAAyB,KAAK,OAAO,KAAK,KACxC,OAAO,QAAQ,QAChB,KAAK,OAAO,QAAQ,UACtB;;EAEJ,CACF"}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginResolvedConfig } from "./plugin.cjs";
|
|
2
|
+
import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
|
|
3
|
+
|
|
4
|
+
//#region src/types/_internal.d.ts
|
|
5
|
+
type UNSAFE_PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PulumiPluginContext<TResolvedConfig> & UNSAFE_PluginContext<TResolvedConfig>;
|
|
6
|
+
declare type __ΩUNSAFE_PulumiPluginContext = any[];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { UNSAFE_PulumiPluginContext, __ΩUNSAFE_PulumiPluginContext };
|
|
9
|
+
//# sourceMappingURL=_internal.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;KAqBY,0BAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,mBAAA,CAAoB,eAAA,IACtB,oBAAA,CAAqB,eAAA;AAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginResolvedConfig } from "./plugin.mjs";
|
|
2
|
+
import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
|
|
3
|
+
|
|
4
|
+
//#region src/types/_internal.d.ts
|
|
5
|
+
type UNSAFE_PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PulumiPluginContext<TResolvedConfig> & UNSAFE_PluginContext<TResolvedConfig>;
|
|
6
|
+
declare type __ΩUNSAFE_PulumiPluginContext = any[];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { UNSAFE_PulumiPluginContext, __ΩUNSAFE_PulumiPluginContext };
|
|
9
|
+
//# sourceMappingURL=_internal.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;KAqBY,0BAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,mBAAA,CAAoB,eAAA,IACtB,oBAAA,CAAqB,eAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
import { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord } from "./pulumi.cjs";
|
|
3
|
+
export { DeployPulumiResult, PulumiOutputRecord, PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩDeployPulumiResult, __ΩPulumiOutputRecord, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
import { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord } from "./pulumi.mjs";
|
|
3
|
+
export { DeployPulumiResult, PulumiOutputRecord, PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩDeployPulumiResult, __ΩPulumiOutputRecord, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
2
|
+
import { InlineProgramArgs, LocalWorkspaceOptions, ProjectSettings, Stack, StackSettings } from "@pulumi/pulumi/automation";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
interface PulumiPluginOptions extends Partial<InlineProgramArgs> {
|
|
6
|
+
/**
|
|
7
|
+
* Additional options for the Pulumi Workspace.
|
|
8
|
+
*/
|
|
9
|
+
options?: LocalWorkspaceOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to destroy the stack during the `destroy` lifecycle phase.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue false
|
|
14
|
+
*/
|
|
15
|
+
destroy?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Additional stack settings.
|
|
18
|
+
*/
|
|
19
|
+
stackSettings?: StackSettings;
|
|
20
|
+
/**
|
|
21
|
+
* Additional project settings.
|
|
22
|
+
*/
|
|
23
|
+
projectSettings?: Partial<ProjectSettings>;
|
|
24
|
+
}
|
|
25
|
+
interface PulumiPluginUserConfig extends UserConfig {
|
|
26
|
+
pulumi?: PulumiPluginOptions;
|
|
27
|
+
}
|
|
28
|
+
interface PulumiPluginResolvedConfig extends ResolvedConfig {
|
|
29
|
+
pulumi: PulumiPluginOptions;
|
|
30
|
+
}
|
|
31
|
+
type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
32
|
+
pulumi: Stack;
|
|
33
|
+
};
|
|
34
|
+
declare type __ΩPulumiPluginOptions = any[];
|
|
35
|
+
declare type __ΩPulumiPluginUserConfig = any[];
|
|
36
|
+
declare type __ΩPulumiPluginResolvedConfig = any[];
|
|
37
|
+
declare type __ΩPulumiPluginContext = any[];
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig };
|
|
40
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UA2BiB,mBAAA,SAA4B,OAAA,CAAQ,iBAAA;;AAArD;;EAIE,OAAA,GAAU,qBAAA;EAJyC;;;;;EAWnD,OAAA;EAXkD;;;EAgBlD,aAAA,GAAgB,aAAA;EAZhB;;;EAiBA,eAAA,GAAkB,OAAA,CAAQ,eAAA;AAAA;AAAA,UAGX,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,UAGM,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,mBAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;EAChB,MAAA,EAAQ,KAAA;AAAA;AAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InlineProgramArgs, LocalWorkspaceOptions, ProjectSettings, Stack, StackSettings } from "@pulumi/pulumi/automation";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
interface PulumiPluginOptions extends Partial<InlineProgramArgs> {
|
|
6
|
+
/**
|
|
7
|
+
* Additional options for the Pulumi Workspace.
|
|
8
|
+
*/
|
|
9
|
+
options?: LocalWorkspaceOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to destroy the stack during the `destroy` lifecycle phase.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue false
|
|
14
|
+
*/
|
|
15
|
+
destroy?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Additional stack settings.
|
|
18
|
+
*/
|
|
19
|
+
stackSettings?: StackSettings;
|
|
20
|
+
/**
|
|
21
|
+
* Additional project settings.
|
|
22
|
+
*/
|
|
23
|
+
projectSettings?: Partial<ProjectSettings>;
|
|
24
|
+
}
|
|
25
|
+
interface PulumiPluginUserConfig extends UserConfig {
|
|
26
|
+
pulumi?: PulumiPluginOptions;
|
|
27
|
+
}
|
|
28
|
+
interface PulumiPluginResolvedConfig extends ResolvedConfig {
|
|
29
|
+
pulumi: PulumiPluginOptions;
|
|
30
|
+
}
|
|
31
|
+
type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
32
|
+
pulumi: Stack;
|
|
33
|
+
};
|
|
34
|
+
declare type __ΩPulumiPluginOptions = any[];
|
|
35
|
+
declare type __ΩPulumiPluginUserConfig = any[];
|
|
36
|
+
declare type __ΩPulumiPluginResolvedConfig = any[];
|
|
37
|
+
declare type __ΩPulumiPluginContext = any[];
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PulumiPluginContext, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginUserConfig, __ΩPulumiPluginContext, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginUserConfig };
|
|
40
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UA2BiB,mBAAA,SAA4B,OAAA,CAAQ,iBAAA;;AAArD;;EAIE,OAAA,GAAU,qBAAA;EAJyC;;;;;EAWnD,OAAA;EAXkD;;;EAgBlD,aAAA,GAAgB,aAAA;EAZhB;;;EAiBA,eAAA,GAAkB,OAAA,CAAQ,eAAA;AAAA;AAAA,UAGX,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,UAGM,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,mBAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;EAChB,MAAA,EAAQ,KAAA;AAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Output } from "@pulumi/pulumi";
|
|
2
|
+
|
|
3
|
+
//#region src/types/pulumi.d.ts
|
|
4
|
+
interface PulumiOutputRecord<T = any> {
|
|
5
|
+
[key: string]: Output<T> | PulumiOutputRecord<T> | PulumiOutputRecord<T>[];
|
|
6
|
+
}
|
|
7
|
+
type DeployPulumiResult = Record<string, any> | undefined | null | void;
|
|
8
|
+
declare type __ΩPulumiOutputRecord = any[];
|
|
9
|
+
declare type __ΩDeployPulumiResult = any[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord };
|
|
12
|
+
//# sourceMappingURL=pulumi.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi.d.cts","names":[],"sources":["../../src/types/pulumi.ts"],"mappings":";;;UAoBiB,kBAAA;EAAA,CACd,GAAA,WAAc,MAAA,CAAO,CAAA,IAAK,kBAAA,CAAmB,CAAA,IAAK,kBAAA,CAAmB,CAAA;AAAA;AAAA,KAG5D,kBAAA,GAAqB,MAAA;AAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Output } from "@pulumi/pulumi";
|
|
2
|
+
|
|
3
|
+
//#region src/types/pulumi.d.ts
|
|
4
|
+
interface PulumiOutputRecord<T = any> {
|
|
5
|
+
[key: string]: Output<T> | PulumiOutputRecord<T> | PulumiOutputRecord<T>[];
|
|
6
|
+
}
|
|
7
|
+
type DeployPulumiResult = Record<string, any> | undefined | null | void;
|
|
8
|
+
declare type __ΩPulumiOutputRecord = any[];
|
|
9
|
+
declare type __ΩDeployPulumiResult = any[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DeployPulumiResult, PulumiOutputRecord, __ΩDeployPulumiResult, __ΩPulumiOutputRecord };
|
|
12
|
+
//# sourceMappingURL=pulumi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi.d.mts","names":[],"sources":["../../src/types/pulumi.ts"],"mappings":";;;UAoBiB,kBAAA;EAAA,CACd,GAAA,WAAc,MAAA,CAAO,CAAA,IAAK,kBAAA,CAAmB,CAAA,IAAK,kBAAA,CAAmB,CAAA;AAAA;AAAA,KAG5D,kBAAA,GAAqB,MAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-pulumi",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to transform source code to be platform agnostic using pulumi.",
|
|
6
6
|
"keywords": ["pulumi", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
"@stryke/type-checks": "^0.5.41",
|
|
127
127
|
"@stryke/types": "^0.11.1",
|
|
128
128
|
"defu": "^6.1.4",
|
|
129
|
-
"powerlines": "^0.42.
|
|
129
|
+
"powerlines": "^0.42.6",
|
|
130
130
|
"typescript": "^5.9.3"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
133
|
+
"@powerlines/plugin-plugin": "^0.12.316",
|
|
134
134
|
"@types/node": "^25.5.0"
|
|
135
135
|
},
|
|
136
136
|
"publishConfig": { "access": "public" },
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "af94c1952c9f2d293dac72a2d0ed3627be8d807d"
|
|
138
138
|
}
|