@pulumi/command 0.0.1-alpha.1640827590 → 0.0.1-testwindows.signing
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/README.md +101 -14
- package/index.d.ts +3 -1
- package/index.js +5 -16
- package/index.js.map +1 -1
- package/local/command.d.ts +314 -10
- package/local/command.js +117 -29
- package/local/command.js.map +1 -1
- package/local/index.d.ts +7 -1
- package/local/index.js +15 -7
- package/local/index.js.map +1 -1
- package/local/run.d.ts +391 -0
- package/local/run.js +46 -0
- package/local/run.js.map +1 -0
- package/package.json +16 -4
- package/package.json.dev +15 -3
- package/provider.js +12 -14
- package/provider.js.map +1 -1
- package/remote/command.d.ts +128 -9
- package/remote/command.js +95 -29
- package/remote/command.js.map +1 -1
- package/remote/copyFile.d.ts +13 -1
- package/remote/copyFile.js +34 -27
- package/remote/copyFile.js.map +1 -1
- package/remote/copyToRemote.d.ts +125 -0
- package/remote/copyToRemote.js +134 -0
- package/remote/copyToRemote.js.map +1 -0
- package/remote/index.d.ts +10 -2
- package/remote/index.js +19 -10
- package/remote/index.js.map +1 -1
- package/types/enums/index.d.ts +3 -0
- package/types/enums/index.js +11 -0
- package/types/enums/index.js.map +1 -0
- package/types/enums/local/index.d.ts +19 -0
- package/types/enums/local/index.js +24 -0
- package/types/enums/local/index.js.map +1 -0
- package/types/enums/remote/index.d.ts +19 -0
- package/types/enums/remote/index.js +24 -0
- package/types/enums/remote/index.js.map +1 -0
- package/types/index.d.ts +2 -1
- package/types/index.js +4 -2
- package/types/index.js.map +1 -1
- package/types/input.d.ts +70 -1
- package/types/input.js +13 -3
- package/types/input.js.map +1 -1
- package/types/output.d.ts +70 -1
- package/types/output.js +12 -3
- package/types/output.js.map +1 -1
- package/utilities.d.ts +4 -0
- package/utilities.js +51 -2
- package/utilities.js.map +1 -1
- package/package.json.bak +0 -16
package/local/run.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.runOutput = exports.run = void 0;
|
|
6
|
+
const pulumi = require("@pulumi/pulumi");
|
|
7
|
+
const utilities = require("../utilities");
|
|
8
|
+
/**
|
|
9
|
+
* A local command to be executed.
|
|
10
|
+
* This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
|
|
11
|
+
*/
|
|
12
|
+
function run(args, opts) {
|
|
13
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
|
|
14
|
+
return pulumi.runtime.invoke("command:local:run", {
|
|
15
|
+
"addPreviousOutputInEnv": args.addPreviousOutputInEnv,
|
|
16
|
+
"archivePaths": args.archivePaths,
|
|
17
|
+
"assetPaths": args.assetPaths,
|
|
18
|
+
"command": args.command,
|
|
19
|
+
"dir": args.dir,
|
|
20
|
+
"environment": args.environment,
|
|
21
|
+
"interpreter": args.interpreter,
|
|
22
|
+
"logging": args.logging,
|
|
23
|
+
"stdin": args.stdin,
|
|
24
|
+
}, opts);
|
|
25
|
+
}
|
|
26
|
+
exports.run = run;
|
|
27
|
+
/**
|
|
28
|
+
* A local command to be executed.
|
|
29
|
+
* This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
|
|
30
|
+
*/
|
|
31
|
+
function runOutput(args, opts) {
|
|
32
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
|
|
33
|
+
return pulumi.runtime.invokeOutput("command:local:run", {
|
|
34
|
+
"addPreviousOutputInEnv": args.addPreviousOutputInEnv,
|
|
35
|
+
"archivePaths": args.archivePaths,
|
|
36
|
+
"assetPaths": args.assetPaths,
|
|
37
|
+
"command": args.command,
|
|
38
|
+
"dir": args.dir,
|
|
39
|
+
"environment": args.environment,
|
|
40
|
+
"interpreter": args.interpreter,
|
|
41
|
+
"logging": args.logging,
|
|
42
|
+
"stdin": args.stdin,
|
|
43
|
+
}, opts);
|
|
44
|
+
}
|
|
45
|
+
exports.runOutput = runOutput;
|
|
46
|
+
//# sourceMappingURL=run.js.map
|
package/local/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../local/run.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAIzC,0CAA0C;AAE1C;;;GAGG;AACH,SAAgB,GAAG,CAAC,IAAa,EAAE,IAA2B;IAC1D,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE;QAC9C,wBAAwB,EAAE,IAAI,CAAC,sBAAsB;QACrD,cAAc,EAAE,IAAI,CAAC,YAAY;QACjC,YAAY,EAAE,IAAI,CAAC,UAAU;QAC7B,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,KAAK,EAAE,IAAI,CAAC,GAAG;QACf,aAAa,EAAE,IAAI,CAAC,WAAW;QAC/B,aAAa,EAAE,IAAI,CAAC,WAAW;QAC/B,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,OAAO,EAAE,IAAI,CAAC,KAAK;KACtB,EAAE,IAAI,CAAC,CAAC;AACb,CAAC;AAbD,kBAaC;AAgQD;;;GAGG;AACH,SAAgB,SAAS,CAAC,IAAmB,EAAE,IAAiC;IAC5E,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE;QACpD,wBAAwB,EAAE,IAAI,CAAC,sBAAsB;QACrD,cAAc,EAAE,IAAI,CAAC,YAAY;QACjC,YAAY,EAAE,IAAI,CAAC,UAAU;QAC7B,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,KAAK,EAAE,IAAI,CAAC,GAAG;QACf,aAAa,EAAE,IAAI,CAAC,WAAW;QAC/B,aAAa,EAAE,IAAI,CAAC,WAAW;QAC/B,SAAS,EAAE,IAAI,CAAC,OAAO;QACvB,OAAO,EAAE,IAAI,CAAC,KAAK;KACtB,EAAE,IAAI,CAAC,CAAC;AACb,CAAC;AAbD,8BAaC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/command",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "0.0.1-testwindows.signing",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"pulumi",
|
|
6
|
+
"command",
|
|
7
|
+
"category/utility",
|
|
8
|
+
"kind/native"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://pulumi.com",
|
|
11
|
+
"repository": "https://github.com/pulumi/pulumi-command",
|
|
12
|
+
"license": "Apache-2.0",
|
|
4
13
|
"scripts": {
|
|
5
14
|
"build": "tsc",
|
|
6
|
-
"install": "node scripts/install-pulumi-plugin.js resource command
|
|
15
|
+
"install": "node scripts/install-pulumi-plugin.js resource command 0.0.1-testwindows.signing"
|
|
7
16
|
},
|
|
8
17
|
"dependencies": {
|
|
9
|
-
"@pulumi/pulumi": "^3.
|
|
18
|
+
"@pulumi/pulumi": "^3.136.0"
|
|
10
19
|
},
|
|
11
20
|
"devDependencies": {
|
|
21
|
+
"@types/node": "^14",
|
|
12
22
|
"typescript": "^4.3.5"
|
|
13
23
|
},
|
|
14
24
|
"pulumi": {
|
|
15
|
-
"resource": true
|
|
25
|
+
"resource": true,
|
|
26
|
+
"name": "command",
|
|
27
|
+
"version": "0.0.1-testwindows.signing"
|
|
16
28
|
}
|
|
17
29
|
}
|
package/package.json.dev
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/command",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "0.0.1-testwindows.signing",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"pulumi",
|
|
6
|
+
"command",
|
|
7
|
+
"category/utility",
|
|
8
|
+
"kind/native"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://pulumi.com",
|
|
11
|
+
"repository": "https://github.com/pulumi/pulumi-command",
|
|
12
|
+
"license": "Apache-2.0",
|
|
4
13
|
"scripts": {
|
|
5
14
|
"build": "tsc"
|
|
6
15
|
},
|
|
7
16
|
"dependencies": {
|
|
8
|
-
"@pulumi/pulumi": "^3.
|
|
17
|
+
"@pulumi/pulumi": "^3.136.0"
|
|
9
18
|
},
|
|
10
19
|
"devDependencies": {
|
|
20
|
+
"@types/node": "^14",
|
|
11
21
|
"typescript": "^4.3.5"
|
|
12
22
|
},
|
|
13
23
|
"pulumi": {
|
|
14
|
-
"resource": true
|
|
24
|
+
"resource": true,
|
|
25
|
+
"name": "command",
|
|
26
|
+
"version": "0.0.1-testwindows.signing"
|
|
15
27
|
}
|
|
16
28
|
}
|
package/provider.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// *** WARNING: this file was generated by
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
3
|
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.Provider = void 0;
|
|
6
6
|
const pulumi = require("@pulumi/pulumi");
|
|
7
7
|
const utilities = require("./utilities");
|
|
8
8
|
class Provider extends pulumi.ProviderResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if the given object is an instance of Provider. This is designed to work even
|
|
11
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
12
|
+
*/
|
|
13
|
+
static isInstance(obj) {
|
|
14
|
+
if (obj === undefined || obj === null) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
|
|
18
|
+
}
|
|
9
19
|
/**
|
|
10
20
|
* Create a Provider resource with the given unique name, arguments, and options.
|
|
11
21
|
*
|
|
@@ -18,21 +28,9 @@ class Provider extends pulumi.ProviderResource {
|
|
|
18
28
|
opts = opts || {};
|
|
19
29
|
{
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
|
|
23
|
-
}
|
|
31
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
24
32
|
super(Provider.__pulumiType, name, resourceInputs, opts);
|
|
25
33
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Returns true if the given object is an instance of Provider. This is designed to work even
|
|
28
|
-
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
29
|
-
*/
|
|
30
|
-
static isInstance(obj) {
|
|
31
|
-
if (obj === undefined || obj === null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return obj['__pulumiType'] === Provider.__pulumiType;
|
|
35
|
-
}
|
|
36
34
|
}
|
|
37
35
|
exports.Provider = Provider;
|
|
38
36
|
/** @internal */
|
package/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC,MAAa,QAAS,SAAQ,MAAM,CAAC,gBAAgB;IAIjD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC;IAC/E,CAAC;IAGD;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAmB,EAAE,IAA6B;QACxE,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB;SACC;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;;AA9BL,4BA+BC;AA9BG,gBAAgB;AACO,qBAAY,GAAG,SAAS,CAAC"}
|
package/remote/command.d.ts
CHANGED
|
@@ -1,8 +1,65 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
-
import
|
|
2
|
+
import * as inputs from "../types/input";
|
|
3
|
+
import * as outputs from "../types/output";
|
|
4
|
+
import * as enums from "../types/enums";
|
|
3
5
|
/**
|
|
4
|
-
* A command to run on a remote host.
|
|
5
|
-
*
|
|
6
|
+
* A command to run on a remote host. The connection is established via ssh.
|
|
7
|
+
*
|
|
8
|
+
* ## Example Usage
|
|
9
|
+
*
|
|
10
|
+
* ### A Basic Example
|
|
11
|
+
* This program connects to a server and runs the `hostname` command. The output is then available via the `stdout` property.
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
15
|
+
* import * as command from "@pulumi/command";
|
|
16
|
+
*
|
|
17
|
+
* const config = new pulumi.Config();
|
|
18
|
+
* const server = config.require("server");
|
|
19
|
+
* const userName = config.require("userName");
|
|
20
|
+
* const privateKey = config.require("privateKey");
|
|
21
|
+
*
|
|
22
|
+
* const hostnameCmd = new command.remote.Command("hostnameCmd", {
|
|
23
|
+
* create: "hostname",
|
|
24
|
+
* connection: {
|
|
25
|
+
* host: server,
|
|
26
|
+
* user: userName,
|
|
27
|
+
* privateKey: privateKey,
|
|
28
|
+
* },
|
|
29
|
+
* });
|
|
30
|
+
* export const hostname = hostnameCmd.stdout;
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* ### Triggers
|
|
34
|
+
* This example defines several trigger values of various kinds. Changes to any of them will cause `cmd` to be re-run.
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
38
|
+
* import * as command from "@pulumi/command";
|
|
39
|
+
* import * as random from "@pulumi/random";
|
|
40
|
+
*
|
|
41
|
+
* const str = "foo";
|
|
42
|
+
* const fileAsset = new pulumi.asset.FileAsset("Pulumi.yaml");
|
|
43
|
+
* const rand = new random.RandomString("rand", {length: 5});
|
|
44
|
+
* const localFile = new command.local.Command("localFile", {
|
|
45
|
+
* create: "touch foo.txt",
|
|
46
|
+
* archivePaths: ["*.txt"],
|
|
47
|
+
* });
|
|
48
|
+
* const cmd = new command.remote.Command("cmd", {
|
|
49
|
+
* connection: {
|
|
50
|
+
* host: "insert host here",
|
|
51
|
+
* },
|
|
52
|
+
* create: "echo create > op.txt",
|
|
53
|
+
* delete: "echo delete >> op.txt",
|
|
54
|
+
* triggers: [
|
|
55
|
+
* str,
|
|
56
|
+
* rand.result,
|
|
57
|
+
* fileAsset,
|
|
58
|
+
* localFile.archive,
|
|
59
|
+
* ],
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* ```
|
|
6
63
|
*/
|
|
7
64
|
export declare class Command extends pulumi.CustomResource {
|
|
8
65
|
/**
|
|
@@ -20,33 +77,64 @@ export declare class Command extends pulumi.CustomResource {
|
|
|
20
77
|
*/
|
|
21
78
|
static isInstance(obj: any): obj is Command;
|
|
22
79
|
/**
|
|
23
|
-
*
|
|
80
|
+
* If the previous command's stdout and stderr (as generated by the prior create/update) is
|
|
81
|
+
* injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
|
|
82
|
+
* Defaults to true.
|
|
24
83
|
*/
|
|
25
|
-
readonly
|
|
84
|
+
readonly addPreviousOutputInEnv: pulumi.Output<boolean | undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* The parameters with which to connect to the remote host.
|
|
87
|
+
*/
|
|
88
|
+
readonly connection: pulumi.Output<outputs.remote.Connection>;
|
|
26
89
|
/**
|
|
27
90
|
* The command to run on create.
|
|
28
91
|
*/
|
|
29
92
|
readonly create: pulumi.Output<string | undefined>;
|
|
30
93
|
/**
|
|
31
|
-
* The command to run on delete.
|
|
94
|
+
* The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
|
|
95
|
+
* and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
|
|
96
|
+
* Command resource from previous create or update steps.
|
|
32
97
|
*/
|
|
33
98
|
readonly delete: pulumi.Output<string | undefined>;
|
|
34
99
|
/**
|
|
35
100
|
* Additional environment variables available to the command's process.
|
|
101
|
+
* Note that this only works if the SSH server is configured to accept these variables via AcceptEnv.
|
|
102
|
+
* Alternatively, if a Bash-like shell runs the command on the remote host, you could prefix the command itself
|
|
103
|
+
* with the variables in the form 'VAR=value command'.
|
|
36
104
|
*/
|
|
37
105
|
readonly environment: pulumi.Output<{
|
|
38
106
|
[key: string]: string;
|
|
39
107
|
} | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* If the command's stdout and stderr should be logged. This doesn't affect the capturing of
|
|
110
|
+
* stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
|
|
111
|
+
* outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
|
|
112
|
+
*/
|
|
113
|
+
readonly logging: pulumi.Output<enums.remote.Logging | undefined>;
|
|
40
114
|
/**
|
|
41
115
|
* The standard error of the command's process
|
|
42
116
|
*/
|
|
43
117
|
readonly stderr: pulumi.Output<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Pass a string to the command's process as standard in
|
|
120
|
+
*/
|
|
121
|
+
readonly stdin: pulumi.Output<string | undefined>;
|
|
44
122
|
/**
|
|
45
123
|
* The standard output of the command's process
|
|
46
124
|
*/
|
|
47
125
|
readonly stdout: pulumi.Output<string>;
|
|
48
126
|
/**
|
|
49
|
-
*
|
|
127
|
+
* Trigger a resource replacement on changes to any of these values. The
|
|
128
|
+
* trigger values can be of any type. If a value is different in the current update compared to the
|
|
129
|
+
* previous update, the resource will be replaced, i.e., the "create" command will be re-run.
|
|
130
|
+
* Please see the resource documentation for examples.
|
|
131
|
+
*/
|
|
132
|
+
readonly triggers: pulumi.Output<any[] | undefined>;
|
|
133
|
+
/**
|
|
134
|
+
* The command to run on update, if empty, create will
|
|
135
|
+
* run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
|
|
136
|
+
* are set to the stdout and stderr properties of the Command resource from previous
|
|
137
|
+
* create or update steps.
|
|
50
138
|
*/
|
|
51
139
|
readonly update: pulumi.Output<string | undefined>;
|
|
52
140
|
/**
|
|
@@ -62,6 +150,12 @@ export declare class Command extends pulumi.CustomResource {
|
|
|
62
150
|
* The set of arguments for constructing a Command resource.
|
|
63
151
|
*/
|
|
64
152
|
export interface CommandArgs {
|
|
153
|
+
/**
|
|
154
|
+
* If the previous command's stdout and stderr (as generated by the prior create/update) is
|
|
155
|
+
* injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
|
|
156
|
+
* Defaults to true.
|
|
157
|
+
*/
|
|
158
|
+
addPreviousOutputInEnv?: pulumi.Input<boolean>;
|
|
65
159
|
/**
|
|
66
160
|
* The parameters with which to connect to the remote host.
|
|
67
161
|
*/
|
|
@@ -71,17 +165,42 @@ export interface CommandArgs {
|
|
|
71
165
|
*/
|
|
72
166
|
create?: pulumi.Input<string>;
|
|
73
167
|
/**
|
|
74
|
-
* The command to run on delete.
|
|
168
|
+
* The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
|
|
169
|
+
* and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
|
|
170
|
+
* Command resource from previous create or update steps.
|
|
75
171
|
*/
|
|
76
172
|
delete?: pulumi.Input<string>;
|
|
77
173
|
/**
|
|
78
174
|
* Additional environment variables available to the command's process.
|
|
175
|
+
* Note that this only works if the SSH server is configured to accept these variables via AcceptEnv.
|
|
176
|
+
* Alternatively, if a Bash-like shell runs the command on the remote host, you could prefix the command itself
|
|
177
|
+
* with the variables in the form 'VAR=value command'.
|
|
79
178
|
*/
|
|
80
179
|
environment?: pulumi.Input<{
|
|
81
180
|
[key: string]: pulumi.Input<string>;
|
|
82
181
|
}>;
|
|
83
182
|
/**
|
|
84
|
-
*
|
|
183
|
+
* If the command's stdout and stderr should be logged. This doesn't affect the capturing of
|
|
184
|
+
* stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
|
|
185
|
+
* outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
|
|
186
|
+
*/
|
|
187
|
+
logging?: pulumi.Input<enums.remote.Logging>;
|
|
188
|
+
/**
|
|
189
|
+
* Pass a string to the command's process as standard in
|
|
190
|
+
*/
|
|
191
|
+
stdin?: pulumi.Input<string>;
|
|
192
|
+
/**
|
|
193
|
+
* Trigger a resource replacement on changes to any of these values. The
|
|
194
|
+
* trigger values can be of any type. If a value is different in the current update compared to the
|
|
195
|
+
* previous update, the resource will be replaced, i.e., the "create" command will be re-run.
|
|
196
|
+
* Please see the resource documentation for examples.
|
|
197
|
+
*/
|
|
198
|
+
triggers?: pulumi.Input<any[]>;
|
|
199
|
+
/**
|
|
200
|
+
* The command to run on update, if empty, create will
|
|
201
|
+
* run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
|
|
202
|
+
* are set to the stdout and stderr properties of the Command resource from previous
|
|
203
|
+
* create or update steps.
|
|
85
204
|
*/
|
|
86
205
|
update?: pulumi.Input<string>;
|
|
87
206
|
}
|
package/remote/command.js
CHANGED
|
@@ -1,16 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// *** WARNING: this file was generated by
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
3
|
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.Command = void 0;
|
|
6
6
|
const pulumi = require("@pulumi/pulumi");
|
|
7
|
-
const
|
|
7
|
+
const inputs = require("../types/input");
|
|
8
8
|
const utilities = require("../utilities");
|
|
9
9
|
/**
|
|
10
|
-
* A command to run on a remote host.
|
|
11
|
-
*
|
|
10
|
+
* A command to run on a remote host. The connection is established via ssh.
|
|
11
|
+
*
|
|
12
|
+
* ## Example Usage
|
|
13
|
+
*
|
|
14
|
+
* ### A Basic Example
|
|
15
|
+
* This program connects to a server and runs the `hostname` command. The output is then available via the `stdout` property.
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
19
|
+
* import * as command from "@pulumi/command";
|
|
20
|
+
*
|
|
21
|
+
* const config = new pulumi.Config();
|
|
22
|
+
* const server = config.require("server");
|
|
23
|
+
* const userName = config.require("userName");
|
|
24
|
+
* const privateKey = config.require("privateKey");
|
|
25
|
+
*
|
|
26
|
+
* const hostnameCmd = new command.remote.Command("hostnameCmd", {
|
|
27
|
+
* create: "hostname",
|
|
28
|
+
* connection: {
|
|
29
|
+
* host: server,
|
|
30
|
+
* user: userName,
|
|
31
|
+
* privateKey: privateKey,
|
|
32
|
+
* },
|
|
33
|
+
* });
|
|
34
|
+
* export const hostname = hostnameCmd.stdout;
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ### Triggers
|
|
38
|
+
* This example defines several trigger values of various kinds. Changes to any of them will cause `cmd` to be re-run.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
42
|
+
* import * as command from "@pulumi/command";
|
|
43
|
+
* import * as random from "@pulumi/random";
|
|
44
|
+
*
|
|
45
|
+
* const str = "foo";
|
|
46
|
+
* const fileAsset = new pulumi.asset.FileAsset("Pulumi.yaml");
|
|
47
|
+
* const rand = new random.RandomString("rand", {length: 5});
|
|
48
|
+
* const localFile = new command.local.Command("localFile", {
|
|
49
|
+
* create: "touch foo.txt",
|
|
50
|
+
* archivePaths: ["*.txt"],
|
|
51
|
+
* });
|
|
52
|
+
* const cmd = new command.remote.Command("cmd", {
|
|
53
|
+
* connection: {
|
|
54
|
+
* host: "insert host here",
|
|
55
|
+
* },
|
|
56
|
+
* create: "echo create > op.txt",
|
|
57
|
+
* delete: "echo delete >> op.txt",
|
|
58
|
+
* triggers: [
|
|
59
|
+
* str,
|
|
60
|
+
* rand.result,
|
|
61
|
+
* fileAsset,
|
|
62
|
+
* localFile.archive,
|
|
63
|
+
* ],
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* ```
|
|
12
67
|
*/
|
|
13
68
|
class Command extends pulumi.CustomResource {
|
|
69
|
+
/**
|
|
70
|
+
* Get an existing Command resource's state with the given name, ID, and optional extra
|
|
71
|
+
* properties used to qualify the lookup.
|
|
72
|
+
*
|
|
73
|
+
* @param name The _unique_ name of the resulting resource.
|
|
74
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
75
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
76
|
+
*/
|
|
77
|
+
static get(name, id, opts) {
|
|
78
|
+
return new Command(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns true if the given object is an instance of Command. This is designed to work even
|
|
82
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
83
|
+
*/
|
|
84
|
+
static isInstance(obj) {
|
|
85
|
+
if (obj === undefined || obj === null) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return obj['__pulumiType'] === Command.__pulumiType;
|
|
89
|
+
}
|
|
14
90
|
/**
|
|
15
91
|
* Create a Command resource with the given unique name, arguments, and options.
|
|
16
92
|
*
|
|
@@ -19,55 +95,45 @@ class Command extends pulumi.CustomResource {
|
|
|
19
95
|
* @param opts A bag of options that control this resource's behavior.
|
|
20
96
|
*/
|
|
21
97
|
constructor(name, args, opts) {
|
|
98
|
+
var _a;
|
|
22
99
|
let resourceInputs = {};
|
|
23
100
|
opts = opts || {};
|
|
24
101
|
if (!opts.id) {
|
|
25
102
|
if ((!args || args.connection === undefined) && !opts.urn) {
|
|
26
103
|
throw new Error("Missing required property 'connection'");
|
|
27
104
|
}
|
|
28
|
-
resourceInputs["
|
|
105
|
+
resourceInputs["addPreviousOutputInEnv"] = (_a = (args ? args.addPreviousOutputInEnv : undefined)) !== null && _a !== void 0 ? _a : true;
|
|
106
|
+
resourceInputs["connection"] = (args === null || args === void 0 ? void 0 : args.connection) ? pulumi.secret((args.connection ? pulumi.output(args.connection).apply(inputs.remote.connectionArgsProvideDefaults) : undefined)) : undefined;
|
|
29
107
|
resourceInputs["create"] = args ? args.create : undefined;
|
|
30
108
|
resourceInputs["delete"] = args ? args.delete : undefined;
|
|
31
109
|
resourceInputs["environment"] = args ? args.environment : undefined;
|
|
110
|
+
resourceInputs["logging"] = args ? args.logging : undefined;
|
|
111
|
+
resourceInputs["stdin"] = args ? args.stdin : undefined;
|
|
112
|
+
resourceInputs["triggers"] = args ? args.triggers : undefined;
|
|
32
113
|
resourceInputs["update"] = args ? args.update : undefined;
|
|
33
114
|
resourceInputs["stderr"] = undefined /*out*/;
|
|
34
115
|
resourceInputs["stdout"] = undefined /*out*/;
|
|
35
116
|
}
|
|
36
117
|
else {
|
|
118
|
+
resourceInputs["addPreviousOutputInEnv"] = undefined /*out*/;
|
|
37
119
|
resourceInputs["connection"] = undefined /*out*/;
|
|
38
120
|
resourceInputs["create"] = undefined /*out*/;
|
|
39
121
|
resourceInputs["delete"] = undefined /*out*/;
|
|
40
122
|
resourceInputs["environment"] = undefined /*out*/;
|
|
123
|
+
resourceInputs["logging"] = undefined /*out*/;
|
|
41
124
|
resourceInputs["stderr"] = undefined /*out*/;
|
|
125
|
+
resourceInputs["stdin"] = undefined /*out*/;
|
|
42
126
|
resourceInputs["stdout"] = undefined /*out*/;
|
|
127
|
+
resourceInputs["triggers"] = undefined /*out*/;
|
|
43
128
|
resourceInputs["update"] = undefined /*out*/;
|
|
44
129
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
130
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
131
|
+
const secretOpts = { additionalSecretOutputs: ["connection"] };
|
|
132
|
+
opts = pulumi.mergeOptions(opts, secretOpts);
|
|
133
|
+
const replaceOnChanges = { replaceOnChanges: ["triggers[*]"] };
|
|
134
|
+
opts = pulumi.mergeOptions(opts, replaceOnChanges);
|
|
48
135
|
super(Command.__pulumiType, name, resourceInputs, opts);
|
|
49
136
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Get an existing Command resource's state with the given name, ID, and optional extra
|
|
52
|
-
* properties used to qualify the lookup.
|
|
53
|
-
*
|
|
54
|
-
* @param name The _unique_ name of the resulting resource.
|
|
55
|
-
* @param id The _unique_ provider ID of the resource to lookup.
|
|
56
|
-
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
57
|
-
*/
|
|
58
|
-
static get(name, id, opts) {
|
|
59
|
-
return new Command(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Returns true if the given object is an instance of Command. This is designed to work even
|
|
63
|
-
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
64
|
-
*/
|
|
65
|
-
static isInstance(obj) {
|
|
66
|
-
if (obj === undefined || obj === null) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
return obj['__pulumiType'] === Command.__pulumiType;
|
|
70
|
-
}
|
|
71
137
|
}
|
|
72
138
|
exports.Command = Command;
|
|
73
139
|
/** @internal */
|
package/remote/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../remote/command.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../remote/command.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAGzC,0CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAa,OAAQ,SAAQ,MAAM,CAAC,cAAc;IAC9C;;;;;;;OAOG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,IAAmC;QAC5F,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,SAAgB,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IACpE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC;IACxD,CAAC;IA8DD;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAiB,EAAE,IAAmC;;QAC5E,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YACV,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;aAC7D;YACD,cAAc,CAAC,wBAAwB,CAAC,GAAG,MAAA,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAA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CAAC;;AAnIL,0BAoIC;AAvHG,gBAAgB;AACO,oBAAY,GAAG,wBAAwB,CAAC"}
|
package/remote/copyFile.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
-
import
|
|
2
|
+
import * as inputs from "../types/input";
|
|
3
|
+
import * as outputs from "../types/output";
|
|
3
4
|
/**
|
|
4
5
|
* Copy a local file to a remote host.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated This resource is deprecated and will be removed in a future release. Please use the `CopyToRemote` resource instead.
|
|
5
8
|
*/
|
|
6
9
|
export declare class CopyFile extends pulumi.CustomResource {
|
|
7
10
|
/**
|
|
@@ -30,6 +33,10 @@ export declare class CopyFile extends pulumi.CustomResource {
|
|
|
30
33
|
* The destination path in the remote host.
|
|
31
34
|
*/
|
|
32
35
|
readonly remotePath: pulumi.Output<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Trigger replacements on changes to this input.
|
|
38
|
+
*/
|
|
39
|
+
readonly triggers: pulumi.Output<any[] | undefined>;
|
|
33
40
|
/**
|
|
34
41
|
* Create a CopyFile resource with the given unique name, arguments, and options.
|
|
35
42
|
*
|
|
@@ -37,6 +44,7 @@ export declare class CopyFile extends pulumi.CustomResource {
|
|
|
37
44
|
* @param args The arguments to use to populate this resource's properties.
|
|
38
45
|
* @param opts A bag of options that control this resource's behavior.
|
|
39
46
|
*/
|
|
47
|
+
/** @deprecated This resource is deprecated and will be removed in a future release. Please use the `CopyToRemote` resource instead. */
|
|
40
48
|
constructor(name: string, args: CopyFileArgs, opts?: pulumi.CustomResourceOptions);
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
@@ -55,4 +63,8 @@ export interface CopyFileArgs {
|
|
|
55
63
|
* The destination path in the remote host.
|
|
56
64
|
*/
|
|
57
65
|
remotePath: pulumi.Input<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Trigger replacements on changes to this input.
|
|
68
|
+
*/
|
|
69
|
+
triggers?: pulumi.Input<any[]>;
|
|
58
70
|
}
|