@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.
Files changed (51) hide show
  1. package/README.md +101 -14
  2. package/index.d.ts +3 -1
  3. package/index.js +5 -16
  4. package/index.js.map +1 -1
  5. package/local/command.d.ts +314 -10
  6. package/local/command.js +117 -29
  7. package/local/command.js.map +1 -1
  8. package/local/index.d.ts +7 -1
  9. package/local/index.js +15 -7
  10. package/local/index.js.map +1 -1
  11. package/local/run.d.ts +391 -0
  12. package/local/run.js +46 -0
  13. package/local/run.js.map +1 -0
  14. package/package.json +16 -4
  15. package/package.json.dev +15 -3
  16. package/provider.js +12 -14
  17. package/provider.js.map +1 -1
  18. package/remote/command.d.ts +128 -9
  19. package/remote/command.js +95 -29
  20. package/remote/command.js.map +1 -1
  21. package/remote/copyFile.d.ts +13 -1
  22. package/remote/copyFile.js +34 -27
  23. package/remote/copyFile.js.map +1 -1
  24. package/remote/copyToRemote.d.ts +125 -0
  25. package/remote/copyToRemote.js +134 -0
  26. package/remote/copyToRemote.js.map +1 -0
  27. package/remote/index.d.ts +10 -2
  28. package/remote/index.js +19 -10
  29. package/remote/index.js.map +1 -1
  30. package/types/enums/index.d.ts +3 -0
  31. package/types/enums/index.js +11 -0
  32. package/types/enums/index.js.map +1 -0
  33. package/types/enums/local/index.d.ts +19 -0
  34. package/types/enums/local/index.js +24 -0
  35. package/types/enums/local/index.js.map +1 -0
  36. package/types/enums/remote/index.d.ts +19 -0
  37. package/types/enums/remote/index.js +24 -0
  38. package/types/enums/remote/index.js.map +1 -0
  39. package/types/index.d.ts +2 -1
  40. package/types/index.js +4 -2
  41. package/types/index.js.map +1 -1
  42. package/types/input.d.ts +70 -1
  43. package/types/input.js +13 -3
  44. package/types/input.js.map +1 -1
  45. package/types/output.d.ts +70 -1
  46. package/types/output.js +12 -3
  47. package/types/output.js.map +1 -1
  48. package/utilities.d.ts +4 -0
  49. package/utilities.js +51 -2
  50. package/utilities.js.map +1 -1
  51. package/package.json.bak +0 -16
package/local/command.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // *** WARNING: this file was generated by pulumigen. ***
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;
@@ -7,12 +7,104 @@ const pulumi = require("@pulumi/pulumi");
7
7
  const utilities = require("../utilities");
8
8
  /**
9
9
  * A local command to be executed.
10
- * This command can be inserted into the life cycles of other resources using the
11
- * `dependsOn` or `parent` resource options. A command is considered to have
12
- * failed when it finished with a non-zero exit code. This will fail the CRUD step
13
- * of the `Command` resource.
10
+ *
11
+ * This command can be inserted into the life cycles of other resources using the `dependsOn` or `parent` resource options. A command is considered to have failed when it finished with a non-zero exit code. This will fail the CRUD step of the `Command` resource.
12
+ *
13
+ * ## Example Usage
14
+ *
15
+ * ### Basic Example
16
+ *
17
+ * This example shows the simplest use case, simply running a command on `create` in the Pulumi lifecycle.
18
+ *
19
+ * ```typescript
20
+ * import { local } from "@pulumi/command";
21
+ *
22
+ * const random = new local.Command("random", {
23
+ * create: "openssl rand -hex 16",
24
+ * });
25
+ *
26
+ * export const output = random.stdout;
27
+ * ```
28
+ *
29
+ * ### Invoking a Lambda during Pulumi Deployment
30
+ *
31
+ * This example show using a local command to invoke an AWS Lambda once it's deployed. The Lambda invocation could also depend on other resources.
32
+ *
33
+ * ```typescript
34
+ * import * as aws from "@pulumi/aws";
35
+ * import { local } from "@pulumi/command";
36
+ * import { getStack } from "@pulumi/pulumi";
37
+ *
38
+ * const f = new aws.lambda.CallbackFunction("f", {
39
+ * publish: true,
40
+ * callback: async (ev: any) => {
41
+ * return `Stack ${ev.stackName} is deployed!`;
42
+ * }
43
+ * });
44
+ *
45
+ * const invoke = new local.Command("execf", {
46
+ * create: `aws lambda invoke --function-name "$FN" --payload '{"stackName": "${getStack()}"}' --cli-binary-format raw-in-base64-out out.txt >/dev/null && cat out.txt | tr -d '"' && rm out.txt`,
47
+ * environment: {
48
+ * FN: f.qualifiedArn,
49
+ * AWS_REGION: aws.config.region!,
50
+ * AWS_PAGER: "",
51
+ * },
52
+ * }, { dependsOn: f })
53
+ *
54
+ * export const output = invoke.stdout;
55
+ * ```
56
+ *
57
+ * ### Using Triggers
58
+ *
59
+ * This example defines several trigger values of various kinds. Changes to any of them will cause `cmd` to be re-run.
60
+ *
61
+ * ```typescript
62
+ * import * as pulumi from "@pulumi/pulumi";
63
+ * import * as command from "@pulumi/command";
64
+ * import * as random from "@pulumi/random";
65
+ *
66
+ * const str = "foo";
67
+ * const fileAsset = new pulumi.asset.FileAsset("Pulumi.yaml");
68
+ * const rand = new random.RandomString("rand", {length: 5});
69
+ * const localFile = new command.local.Command("localFile", {
70
+ * create: "touch foo.txt",
71
+ * archivePaths: ["*.txt"],
72
+ * });
73
+ *
74
+ * const cmd = new command.local.Command("cmd", {
75
+ * create: "echo create > op.txt",
76
+ * delete: "echo delete >> op.txt",
77
+ * triggers: [
78
+ * str,
79
+ * rand.result,
80
+ * fileAsset,
81
+ * localFile.archive,
82
+ * ],
83
+ * });
84
+ * ```
14
85
  */
15
86
  class Command extends pulumi.CustomResource {
87
+ /**
88
+ * Get an existing Command resource's state with the given name, ID, and optional extra
89
+ * properties used to qualify the lookup.
90
+ *
91
+ * @param name The _unique_ name of the resulting resource.
92
+ * @param id The _unique_ provider ID of the resource to lookup.
93
+ * @param opts Optional settings to control the behavior of the CustomResource.
94
+ */
95
+ static get(name, id, opts) {
96
+ return new Command(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
97
+ }
98
+ /**
99
+ * Returns true if the given object is an instance of Command. This is designed to work even
100
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
101
+ */
102
+ static isInstance(obj) {
103
+ if (obj === undefined || obj === null) {
104
+ return false;
105
+ }
106
+ return obj['__pulumiType'] === Command.__pulumiType;
107
+ }
16
108
  /**
17
109
  * Create a Command resource with the given unique name, arguments, and options.
18
110
  *
@@ -21,54 +113,50 @@ class Command extends pulumi.CustomResource {
21
113
  * @param opts A bag of options that control this resource's behavior.
22
114
  */
23
115
  constructor(name, args, opts) {
116
+ var _a;
24
117
  let resourceInputs = {};
25
118
  opts = opts || {};
26
119
  if (!opts.id) {
120
+ resourceInputs["addPreviousOutputInEnv"] = (_a = (args ? args.addPreviousOutputInEnv : undefined)) !== null && _a !== void 0 ? _a : true;
121
+ resourceInputs["archivePaths"] = args ? args.archivePaths : undefined;
122
+ resourceInputs["assetPaths"] = args ? args.assetPaths : undefined;
27
123
  resourceInputs["create"] = args ? args.create : undefined;
28
124
  resourceInputs["delete"] = args ? args.delete : undefined;
29
125
  resourceInputs["dir"] = args ? args.dir : undefined;
30
126
  resourceInputs["environment"] = args ? args.environment : undefined;
31
127
  resourceInputs["interpreter"] = args ? args.interpreter : undefined;
128
+ resourceInputs["logging"] = args ? args.logging : undefined;
129
+ resourceInputs["stdin"] = args ? args.stdin : undefined;
130
+ resourceInputs["triggers"] = args ? args.triggers : undefined;
32
131
  resourceInputs["update"] = args ? args.update : undefined;
132
+ resourceInputs["archive"] = undefined /*out*/;
133
+ resourceInputs["assets"] = undefined /*out*/;
33
134
  resourceInputs["stderr"] = undefined /*out*/;
34
135
  resourceInputs["stdout"] = undefined /*out*/;
35
136
  }
36
137
  else {
138
+ resourceInputs["addPreviousOutputInEnv"] = undefined /*out*/;
139
+ resourceInputs["archive"] = undefined /*out*/;
140
+ resourceInputs["archivePaths"] = undefined /*out*/;
141
+ resourceInputs["assetPaths"] = undefined /*out*/;
142
+ resourceInputs["assets"] = undefined /*out*/;
37
143
  resourceInputs["create"] = undefined /*out*/;
38
144
  resourceInputs["delete"] = undefined /*out*/;
39
145
  resourceInputs["dir"] = undefined /*out*/;
40
146
  resourceInputs["environment"] = undefined /*out*/;
41
147
  resourceInputs["interpreter"] = undefined /*out*/;
148
+ resourceInputs["logging"] = undefined /*out*/;
42
149
  resourceInputs["stderr"] = undefined /*out*/;
150
+ resourceInputs["stdin"] = undefined /*out*/;
43
151
  resourceInputs["stdout"] = undefined /*out*/;
152
+ resourceInputs["triggers"] = undefined /*out*/;
44
153
  resourceInputs["update"] = undefined /*out*/;
45
154
  }
46
- if (!opts.version) {
47
- opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
48
- }
155
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
156
+ const replaceOnChanges = { replaceOnChanges: ["triggers[*]"] };
157
+ opts = pulumi.mergeOptions(opts, replaceOnChanges);
49
158
  super(Command.__pulumiType, name, resourceInputs, opts);
50
159
  }
51
- /**
52
- * Get an existing Command resource's state with the given name, ID, and optional extra
53
- * properties used to qualify the lookup.
54
- *
55
- * @param name The _unique_ name of the resulting resource.
56
- * @param id The _unique_ provider ID of the resource to lookup.
57
- * @param opts Optional settings to control the behavior of the CustomResource.
58
- */
59
- static get(name, id, opts) {
60
- return new Command(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
61
- }
62
- /**
63
- * Returns true if the given object is an instance of Command. This is designed to work even
64
- * when multiple copies of the Pulumi SDK have been loaded into the same process.
65
- */
66
- static isInstance(obj) {
67
- if (obj === undefined || obj === null) {
68
- return false;
69
- }
70
- return obj['__pulumiType'] === Command.__pulumiType;
71
- }
72
160
  }
73
161
  exports.Command = Command;
74
162
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../local/command.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,iFAAiF;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAE1C;;;;;;GAMG;AACH,MAAa,OAAQ,SAAQ,MAAM,CAAC,cAAc;IA8D9C;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAkB,EAAE,IAAmC;QAC7E,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAA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c,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC7C,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC1C,cAAc,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAClD,cAAc,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAClD,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC9C,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC7C,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC5C,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC7C,cAAc,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC/C,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAChD;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,gBAAgB,GAAG,EAAE,gBAAgB,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/D,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACnD,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;;AAtOL,0BAuOC;AA1NG,gBAAgB;AACO,oBAAY,GAAG,uBAAuB,CAAC"}
package/local/index.d.ts CHANGED
@@ -1 +1,7 @@
1
- export * from "./command";
1
+ export { CommandArgs } from "./command";
2
+ export type Command = import("./command").Command;
3
+ export declare const Command: typeof import("./command").Command;
4
+ export { RunArgs, RunResult, RunOutputArgs } from "./run";
5
+ export declare const run: typeof import("./run").run;
6
+ export declare const runOutput: typeof import("./run").runOutput;
7
+ export * from "../types/enums/local";
package/local/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
- // *** WARNING: this file was generated by pulumigen. ***
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
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
5
  if (k2 === undefined) k2 = k;
6
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
7
11
  }) : (function(o, m, k, k2) {
8
12
  if (k2 === undefined) k2 = k;
9
13
  o[k2] = m[k];
@@ -12,18 +16,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
16
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13
17
  };
14
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.runOutput = exports.run = exports.Command = void 0;
15
20
  const pulumi = require("@pulumi/pulumi");
16
21
  const utilities = require("../utilities");
17
- // Export members:
18
- __exportStar(require("./command"), exports);
19
- // Import resources to register:
20
- const command_1 = require("./command");
22
+ exports.Command = null;
23
+ utilities.lazyLoad(exports, ["Command"], () => require("./command"));
24
+ exports.run = null;
25
+ exports.runOutput = null;
26
+ utilities.lazyLoad(exports, ["run", "runOutput"], () => require("./run"));
27
+ // Export enums:
28
+ __exportStar(require("../types/enums/local"), exports);
21
29
  const _module = {
22
30
  version: utilities.getVersion(),
23
31
  construct: (name, type, urn) => {
24
32
  switch (type) {
25
33
  case "command:local:Command":
26
- return new command_1.Command(name, undefined, { urn });
34
+ return new exports.Command(name, undefined, { urn });
27
35
  default:
28
36
  throw new Error(`unknown resource type ${type}`);
29
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../local/index.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,iFAAiF;;;;;;;;;;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAE1C,kBAAkB;AAClB,4CAA0B;AAE1B,gCAAgC;AAChC,uCAAoC;AAEpC,MAAM,OAAO,GAAG;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE;IAC/B,SAAS,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,GAAW,EAAmB,EAAE;QACpE,QAAQ,IAAI,EAAE;YACV,KAAK,uBAAuB;gBACxB,OAAO,IAAI,iBAAO,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACrD;gBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;SACxD;IACL,CAAC;CACJ,CAAC;AACF,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../local/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAK7B,QAAA,OAAO,GAAuC,IAAW,CAAC;AACvE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;AAGxD,QAAA,GAAG,GAA+B,IAAW,CAAC;AAC9C,QAAA,SAAS,GAAqC,IAAW,CAAC;AACvE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAGzE,gBAAgB;AAChB,uDAAqC;AAErC,MAAM,OAAO,GAAG;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE;IAC/B,SAAS,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,GAAW,EAAmB,EAAE;QACpE,QAAQ,IAAI,EAAE;YACV,KAAK,uBAAuB;gBACxB,OAAO,IAAI,eAAO,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YACrD;gBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;SACxD;IACL,CAAC;CACJ,CAAC;AACF,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA"}
package/local/run.d.ts ADDED
@@ -0,0 +1,391 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as enums from "../types/enums";
3
+ /**
4
+ * A local command to be executed.
5
+ * This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
6
+ */
7
+ export declare function run(args: RunArgs, opts?: pulumi.InvokeOptions): Promise<RunResult>;
8
+ export interface RunArgs {
9
+ /**
10
+ * If the previous command's stdout and stderr (as generated by the prior create/update) is
11
+ * injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
12
+ * Defaults to true.
13
+ */
14
+ addPreviousOutputInEnv?: boolean;
15
+ /**
16
+ * A list of path globs to return as a single archive asset after the command completes.
17
+ *
18
+ * When specifying glob patterns the following rules apply:
19
+ * - We only include files not directories for assets and archives.
20
+ * - Path separators are `/` on all platforms - including Windows.
21
+ * - Patterns starting with `!` are 'exclude' rules.
22
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
23
+ * - `*` matches anything except `/`
24
+ * - `**` matches anything, _including_ `/`
25
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
26
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
27
+ *
28
+ * #### Example
29
+ *
30
+ * Given the rules:
31
+ * ```yaml
32
+ * - "assets/**"
33
+ * - "src/**.js"
34
+ * - "!**secret.*"
35
+ * ```
36
+ *
37
+ * When evaluating against this folder:
38
+ *
39
+ * ```yaml
40
+ * - assets/
41
+ * - logos/
42
+ * - logo.svg
43
+ * - src/
44
+ * - index.js
45
+ * - secret.js
46
+ * ```
47
+ *
48
+ * The following paths will be returned:
49
+ *
50
+ * ```yaml
51
+ * - assets/logos/logo.svg
52
+ * - src/index.js
53
+ * ```
54
+ */
55
+ archivePaths?: string[];
56
+ /**
57
+ * A list of path globs to read after the command completes.
58
+ *
59
+ * When specifying glob patterns the following rules apply:
60
+ * - We only include files not directories for assets and archives.
61
+ * - Path separators are `/` on all platforms - including Windows.
62
+ * - Patterns starting with `!` are 'exclude' rules.
63
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
64
+ * - `*` matches anything except `/`
65
+ * - `**` matches anything, _including_ `/`
66
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
67
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
68
+ *
69
+ * #### Example
70
+ *
71
+ * Given the rules:
72
+ * ```yaml
73
+ * - "assets/**"
74
+ * - "src/**.js"
75
+ * - "!**secret.*"
76
+ * ```
77
+ *
78
+ * When evaluating against this folder:
79
+ *
80
+ * ```yaml
81
+ * - assets/
82
+ * - logos/
83
+ * - logo.svg
84
+ * - src/
85
+ * - index.js
86
+ * - secret.js
87
+ * ```
88
+ *
89
+ * The following paths will be returned:
90
+ *
91
+ * ```yaml
92
+ * - assets/logos/logo.svg
93
+ * - src/index.js
94
+ * ```
95
+ */
96
+ assetPaths?: string[];
97
+ /**
98
+ * The command to run.
99
+ */
100
+ command: string;
101
+ /**
102
+ * The directory from which to run the command from. If `dir` does not exist, then
103
+ * `Command` will fail.
104
+ */
105
+ dir?: string;
106
+ /**
107
+ * Additional environment variables available to the command's process.
108
+ */
109
+ environment?: {
110
+ [key: string]: string;
111
+ };
112
+ /**
113
+ * The program and arguments to run the command.
114
+ * On Linux and macOS, defaults to: `["/bin/sh", "-c"]`. On Windows, defaults to: `["cmd", "/C"]`
115
+ */
116
+ interpreter?: string[];
117
+ /**
118
+ * If the command's stdout and stderr should be logged. This doesn't affect the capturing of
119
+ * stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
120
+ * outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
121
+ */
122
+ logging?: enums.local.Logging;
123
+ /**
124
+ * Pass a string to the command's process as standard in
125
+ */
126
+ stdin?: string;
127
+ }
128
+ export interface RunResult {
129
+ /**
130
+ * If the previous command's stdout and stderr (as generated by the prior create/update) is
131
+ * injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
132
+ * Defaults to true.
133
+ */
134
+ readonly addPreviousOutputInEnv?: boolean;
135
+ /**
136
+ * An archive asset containing files found after running the command.
137
+ */
138
+ readonly archive?: pulumi.asset.Archive;
139
+ /**
140
+ * A list of path globs to return as a single archive asset after the command completes.
141
+ *
142
+ * When specifying glob patterns the following rules apply:
143
+ * - We only include files not directories for assets and archives.
144
+ * - Path separators are `/` on all platforms - including Windows.
145
+ * - Patterns starting with `!` are 'exclude' rules.
146
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
147
+ * - `*` matches anything except `/`
148
+ * - `**` matches anything, _including_ `/`
149
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
150
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
151
+ *
152
+ * #### Example
153
+ *
154
+ * Given the rules:
155
+ * ```yaml
156
+ * - "assets/**"
157
+ * - "src/**.js"
158
+ * - "!**secret.*"
159
+ * ```
160
+ *
161
+ * When evaluating against this folder:
162
+ *
163
+ * ```yaml
164
+ * - assets/
165
+ * - logos/
166
+ * - logo.svg
167
+ * - src/
168
+ * - index.js
169
+ * - secret.js
170
+ * ```
171
+ *
172
+ * The following paths will be returned:
173
+ *
174
+ * ```yaml
175
+ * - assets/logos/logo.svg
176
+ * - src/index.js
177
+ * ```
178
+ */
179
+ readonly archivePaths?: string[];
180
+ /**
181
+ * A list of path globs to read after the command completes.
182
+ *
183
+ * When specifying glob patterns the following rules apply:
184
+ * - We only include files not directories for assets and archives.
185
+ * - Path separators are `/` on all platforms - including Windows.
186
+ * - Patterns starting with `!` are 'exclude' rules.
187
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
188
+ * - `*` matches anything except `/`
189
+ * - `**` matches anything, _including_ `/`
190
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
191
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
192
+ *
193
+ * #### Example
194
+ *
195
+ * Given the rules:
196
+ * ```yaml
197
+ * - "assets/**"
198
+ * - "src/**.js"
199
+ * - "!**secret.*"
200
+ * ```
201
+ *
202
+ * When evaluating against this folder:
203
+ *
204
+ * ```yaml
205
+ * - assets/
206
+ * - logos/
207
+ * - logo.svg
208
+ * - src/
209
+ * - index.js
210
+ * - secret.js
211
+ * ```
212
+ *
213
+ * The following paths will be returned:
214
+ *
215
+ * ```yaml
216
+ * - assets/logos/logo.svg
217
+ * - src/index.js
218
+ * ```
219
+ */
220
+ readonly assetPaths?: string[];
221
+ /**
222
+ * A map of assets found after running the command.
223
+ * The key is the relative path from the command dir
224
+ */
225
+ readonly assets?: {
226
+ [key: string]: pulumi.asset.Asset | pulumi.asset.Archive;
227
+ };
228
+ /**
229
+ * The command to run.
230
+ */
231
+ readonly command: string;
232
+ /**
233
+ * The directory from which to run the command from. If `dir` does not exist, then
234
+ * `Command` will fail.
235
+ */
236
+ readonly dir?: string;
237
+ /**
238
+ * Additional environment variables available to the command's process.
239
+ */
240
+ readonly environment?: {
241
+ [key: string]: string;
242
+ };
243
+ /**
244
+ * The program and arguments to run the command.
245
+ * On Linux and macOS, defaults to: `["/bin/sh", "-c"]`. On Windows, defaults to: `["cmd", "/C"]`
246
+ */
247
+ readonly interpreter?: string[];
248
+ /**
249
+ * If the command's stdout and stderr should be logged. This doesn't affect the capturing of
250
+ * stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
251
+ * outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
252
+ */
253
+ readonly logging?: enums.local.Logging;
254
+ /**
255
+ * The standard error of the command's process
256
+ */
257
+ readonly stderr: string;
258
+ /**
259
+ * Pass a string to the command's process as standard in
260
+ */
261
+ readonly stdin?: string;
262
+ /**
263
+ * The standard output of the command's process
264
+ */
265
+ readonly stdout: string;
266
+ }
267
+ /**
268
+ * A local command to be executed.
269
+ * This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
270
+ */
271
+ export declare function runOutput(args: RunOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<RunResult>;
272
+ export interface RunOutputArgs {
273
+ /**
274
+ * If the previous command's stdout and stderr (as generated by the prior create/update) is
275
+ * injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
276
+ * Defaults to true.
277
+ */
278
+ addPreviousOutputInEnv?: pulumi.Input<boolean>;
279
+ /**
280
+ * A list of path globs to return as a single archive asset after the command completes.
281
+ *
282
+ * When specifying glob patterns the following rules apply:
283
+ * - We only include files not directories for assets and archives.
284
+ * - Path separators are `/` on all platforms - including Windows.
285
+ * - Patterns starting with `!` are 'exclude' rules.
286
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
287
+ * - `*` matches anything except `/`
288
+ * - `**` matches anything, _including_ `/`
289
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
290
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
291
+ *
292
+ * #### Example
293
+ *
294
+ * Given the rules:
295
+ * ```yaml
296
+ * - "assets/**"
297
+ * - "src/**.js"
298
+ * - "!**secret.*"
299
+ * ```
300
+ *
301
+ * When evaluating against this folder:
302
+ *
303
+ * ```yaml
304
+ * - assets/
305
+ * - logos/
306
+ * - logo.svg
307
+ * - src/
308
+ * - index.js
309
+ * - secret.js
310
+ * ```
311
+ *
312
+ * The following paths will be returned:
313
+ *
314
+ * ```yaml
315
+ * - assets/logos/logo.svg
316
+ * - src/index.js
317
+ * ```
318
+ */
319
+ archivePaths?: pulumi.Input<pulumi.Input<string>[]>;
320
+ /**
321
+ * A list of path globs to read after the command completes.
322
+ *
323
+ * When specifying glob patterns the following rules apply:
324
+ * - We only include files not directories for assets and archives.
325
+ * - Path separators are `/` on all platforms - including Windows.
326
+ * - Patterns starting with `!` are 'exclude' rules.
327
+ * - Rules are evaluated in order, so exclude rules should be after inclusion rules.
328
+ * - `*` matches anything except `/`
329
+ * - `**` matches anything, _including_ `/`
330
+ * - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
331
+ * - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
332
+ *
333
+ * #### Example
334
+ *
335
+ * Given the rules:
336
+ * ```yaml
337
+ * - "assets/**"
338
+ * - "src/**.js"
339
+ * - "!**secret.*"
340
+ * ```
341
+ *
342
+ * When evaluating against this folder:
343
+ *
344
+ * ```yaml
345
+ * - assets/
346
+ * - logos/
347
+ * - logo.svg
348
+ * - src/
349
+ * - index.js
350
+ * - secret.js
351
+ * ```
352
+ *
353
+ * The following paths will be returned:
354
+ *
355
+ * ```yaml
356
+ * - assets/logos/logo.svg
357
+ * - src/index.js
358
+ * ```
359
+ */
360
+ assetPaths?: pulumi.Input<pulumi.Input<string>[]>;
361
+ /**
362
+ * The command to run.
363
+ */
364
+ command: pulumi.Input<string>;
365
+ /**
366
+ * The directory from which to run the command from. If `dir` does not exist, then
367
+ * `Command` will fail.
368
+ */
369
+ dir?: pulumi.Input<string>;
370
+ /**
371
+ * Additional environment variables available to the command's process.
372
+ */
373
+ environment?: pulumi.Input<{
374
+ [key: string]: pulumi.Input<string>;
375
+ }>;
376
+ /**
377
+ * The program and arguments to run the command.
378
+ * On Linux and macOS, defaults to: `["/bin/sh", "-c"]`. On Windows, defaults to: `["cmd", "/C"]`
379
+ */
380
+ interpreter?: pulumi.Input<pulumi.Input<string>[]>;
381
+ /**
382
+ * If the command's stdout and stderr should be logged. This doesn't affect the capturing of
383
+ * stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
384
+ * outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
385
+ */
386
+ logging?: pulumi.Input<enums.local.Logging>;
387
+ /**
388
+ * Pass a string to the command's process as standard in
389
+ */
390
+ stdin?: pulumi.Input<string>;
391
+ }