@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/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
[](https://github.com/pulumi/pulumi-command/actions)
|
|
2
|
+
[](https://slack.pulumi.com)
|
|
3
|
+
[](https://www.npmjs.com/package/@pulumi/command)
|
|
4
|
+
[](https://pypi.org/project/pulumi-command)
|
|
5
|
+
[](https://badge.fury.io/nu/pulumi.command)
|
|
6
|
+
[](https://pkg.go.dev/github.com/pulumi/pulumi-command/sdk/go)
|
|
7
|
+
[](https://github.com/pulumi/pulumi-command/blob/master/LICENSE)
|
|
8
|
+
|
|
1
9
|
# Pulumi Command Provider (preview)
|
|
2
10
|
|
|
3
11
|
The Pulumi Command Provider enables you to execute commands and scripts either locally or remotely as part of the Pulumi resource model. Resources in the command package support running scripts on `create` and `destroy` operations, supporting stateful local and remote command execution.
|
|
@@ -12,7 +20,7 @@ There are many scenarios where the Command package can be useful:
|
|
|
12
20
|
|
|
13
21
|
Some users may have experience with Terraform "provisioners", and the Command package offers support for similar scenarios. However, the Command package is provided as independent resources which can be combined with other resources in many interesting ways. This has many strengths, but also some differences, such as the fact that a Command resource failing does not cause a resource it is operating on to fail.
|
|
14
22
|
|
|
15
|
-
You can use the Command package from a Pulumi program written in any Pulumi language: C#, Go, JavaScript/TypeScript, and
|
|
23
|
+
You can use the Command package from a Pulumi program written in any Pulumi language: C#, Go, JavaScript/TypeScript, Python, and YAML.
|
|
16
24
|
You'll need to [install and configure the Pulumi CLI](https://pulumi.com/docs/get-started/install) if you haven't already.
|
|
17
25
|
|
|
18
26
|
|
|
@@ -38,14 +46,14 @@ export const output = random.stdout;
|
|
|
38
46
|
package main
|
|
39
47
|
|
|
40
48
|
import (
|
|
41
|
-
"github.com/pulumi/pulumi-command/sdk/
|
|
49
|
+
"github.com/pulumi/pulumi-command/sdk/go/command/local"
|
|
42
50
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
|
43
51
|
)
|
|
44
52
|
|
|
45
53
|
func main() {
|
|
46
54
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
|
47
55
|
|
|
48
|
-
random, err := local.NewCommand(ctx, "my-bucket", &local.
|
|
56
|
+
random, err := local.NewCommand(ctx, "my-bucket", &local.CommandInput{
|
|
49
57
|
Create: pulumi.String("openssl rand -hex 16"),
|
|
50
58
|
})
|
|
51
59
|
if err != nil {
|
|
@@ -108,7 +116,7 @@ const server = new aws.ec2.Instance("server", {
|
|
|
108
116
|
|
|
109
117
|
// Now set up a connection to the instance and run some provisioning operations on the instance.
|
|
110
118
|
|
|
111
|
-
const connection: types.input.remote.
|
|
119
|
+
const connection: types.input.remote.ConnectionInput = {
|
|
112
120
|
host: server.publicIp,
|
|
113
121
|
user: "ec2-user",
|
|
114
122
|
privateKey: privateKey,
|
|
@@ -181,7 +189,7 @@ export const output = rand.stdout;
|
|
|
181
189
|
|
|
182
190
|
### Using `local.Command `with CURL to manage external REST API
|
|
183
191
|
|
|
184
|
-
This example uses `local.Command` to create a simple resource provider for managing GitHub labels, by invoking `curl` commands on `create` and `delete` commands against the GitHub REST API.
|
|
192
|
+
This example uses `local.Command` to create a simple resource provider for managing GitHub labels, by invoking `curl` commands on `create` and `delete` commands against the GitHub REST API. A similar approach could be applied to build other simple providers against any REST API directly from within Pulumi programs in any language. This approach is somewhat limited by the fact that `local.Command` does not yet support `diff`/`read`. Support for [Read](https://github.com/pulumi/pulumi-command/issues/432) and [Diff](https://github.com/pulumi/pulumi-command/issues/433) may be added in the future.
|
|
185
193
|
|
|
186
194
|
This example also shows how `local.Command` can be used as an implementation detail inside a nicer abstraction, like the `GitHubLabel` component defined below.
|
|
187
195
|
|
|
@@ -255,32 +263,111 @@ curl \
|
|
|
255
263
|
|
|
256
264
|
### Graceful cleanup of workloads in a Kubernetes cluster
|
|
257
265
|
|
|
258
|
-
There are cases where it's important to run some cleanup operation before destroying a resource
|
|
266
|
+
There are cases where it's important to run some cleanup operation before destroying a resource such as when destroying the resource does not properly handle orderly cleanup. For example, destroying an EKS Cluster will not ensure that all Kubernetes object finalizers are run, which may lead to leaking external resources managed by those Kubernetes resources. This example shows how we can use a `delete`-only `Command` to ensure some cleanup is run within a cluster before destroying it.
|
|
267
|
+
|
|
268
|
+
```yaml
|
|
269
|
+
resources:
|
|
270
|
+
cluster:
|
|
271
|
+
type: eks:Cluster
|
|
272
|
+
|
|
273
|
+
cleanupKubernetesNamespaces:
|
|
274
|
+
# We could also use `RemoteCommand` to run this from
|
|
275
|
+
# within a node in the cluster.
|
|
276
|
+
type: command:local:Command
|
|
277
|
+
properties:
|
|
278
|
+
# This will run before the cluster is destroyed.
|
|
279
|
+
# Everything else will need to depend on this resource
|
|
280
|
+
# to ensure this cleanup doesn't happen too early.
|
|
281
|
+
delete: |
|
|
282
|
+
kubectl --kubeconfig <(echo "$KUBECONFIG_DATA") delete namespace nginx
|
|
283
|
+
# Process substitution "<()" doesn't work in the default interpreter sh.
|
|
284
|
+
interpreter: ["/bin/bash", "-c"]
|
|
285
|
+
environment:
|
|
286
|
+
KUBECONFIG_DATA: "${cluster.kubeconfigJson}"
|
|
287
|
+
```
|
|
259
288
|
|
|
260
289
|
```ts
|
|
261
|
-
import
|
|
290
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
291
|
+
import * as command from "@pulumi/command";
|
|
262
292
|
import * as eks from "@pulumi/eks";
|
|
263
|
-
import * as random from "@pulumi/random";
|
|
264
|
-
import { interpolate } from "@pulumi/pulumi";
|
|
265
293
|
|
|
266
294
|
const cluster = new eks.Cluster("cluster", {});
|
|
267
295
|
|
|
268
296
|
// We could also use `RemoteCommand` to run this from within a node in the cluster
|
|
269
|
-
const cleanupKubernetesNamespaces = new local.Command("cleanupKubernetesNamespaces", {
|
|
297
|
+
const cleanupKubernetesNamespaces = new command.local.Command("cleanupKubernetesNamespaces", {
|
|
270
298
|
// This will run before the cluster is destroyed. Everything else will need to
|
|
271
299
|
// depend on this resource to ensure this cleanup doesn't happen too early.
|
|
272
|
-
delete: "kubectl delete
|
|
300
|
+
"delete": "kubectl --kubeconfig <(echo \"$KUBECONFIG_DATA\") delete namespace nginx\n",
|
|
301
|
+
// Process substitution "<()" doesn't work in the default interpreter sh.
|
|
302
|
+
interpreter: [
|
|
303
|
+
"/bin/bash",
|
|
304
|
+
"-c",
|
|
305
|
+
],
|
|
273
306
|
environment: {
|
|
274
|
-
|
|
307
|
+
KUBECONFIG_DATA: cluster.kubeconfigJson,
|
|
275
308
|
},
|
|
276
309
|
});
|
|
277
310
|
```
|
|
278
311
|
|
|
312
|
+
### Working with Assets and Paths
|
|
313
|
+
|
|
314
|
+
When a local command creates assets as part of its execution, these can be captured by specifying `assetPaths` or `archivePaths`.
|
|
315
|
+
|
|
316
|
+
```typescript
|
|
317
|
+
const lambdaBuild = local.runOutput({
|
|
318
|
+
dir: "../my-function",
|
|
319
|
+
command: `yarn && yarn build`,
|
|
320
|
+
archivePaths: ["dist/**"],
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
new aws.lambda.Function("my-function", {
|
|
324
|
+
code: lambdaBuild.archive,
|
|
325
|
+
// ...
|
|
326
|
+
});
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
When using the `assetPaths` and `archivePaths`, they take a list of 'globs'.
|
|
330
|
+
- We only include files not directories for assets and archives.
|
|
331
|
+
- Path separators are `/` on all platforms - including Windows.
|
|
332
|
+
- Patterns starting with `!` are 'exclude' rules.
|
|
333
|
+
- Rules are evaluated in order, so exclude rules should be after inclusion rules.
|
|
334
|
+
- `*` matches anything except `/`
|
|
335
|
+
- `**` matches anything, _including_ `/`
|
|
336
|
+
- All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
|
|
337
|
+
- For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
|
|
338
|
+
|
|
339
|
+
#### Asset Paths Example
|
|
340
|
+
|
|
341
|
+
Given the rules:
|
|
342
|
+
```yaml
|
|
343
|
+
- "assets/**"
|
|
344
|
+
- "src/**.js"
|
|
345
|
+
- "!**secret.*"
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
When evaluating against this folder:
|
|
349
|
+
|
|
350
|
+
```yaml
|
|
351
|
+
- assets/
|
|
352
|
+
- logos/
|
|
353
|
+
- logo.svg
|
|
354
|
+
- src/
|
|
355
|
+
- index.js
|
|
356
|
+
- secret.js
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The following paths will be returned:
|
|
360
|
+
|
|
361
|
+
```yaml
|
|
362
|
+
- assets/logos/logo.svg
|
|
363
|
+
- src/index.js
|
|
364
|
+
```
|
|
365
|
+
|
|
279
366
|
## Building
|
|
280
367
|
|
|
281
368
|
### Dependencies
|
|
282
369
|
|
|
283
|
-
- Go 1.
|
|
370
|
+
- Go 1.17
|
|
284
371
|
- NodeJS 10.X.X or later
|
|
285
372
|
- Python 3.6 or later
|
|
286
373
|
- .NET Core 3.1
|
|
@@ -298,7 +385,7 @@ $ make build
|
|
|
298
385
|
$ make install
|
|
299
386
|
```
|
|
300
387
|
|
|
301
|
-
Add the `bin` folder to your `$PATH` or copy the `bin/pulumi-resource-
|
|
388
|
+
Add the `bin` folder to your `$PATH` or copy the `bin/pulumi-resource-command` file to another location in your `$PATH`.
|
|
302
389
|
|
|
303
390
|
### Running an example
|
|
304
391
|
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ProviderArgs } from "./provider";
|
|
2
|
+
export type Provider = import("./provider").Provider;
|
|
3
|
+
export declare const Provider: typeof import("./provider").Provider;
|
|
2
4
|
import * as local from "./local";
|
|
3
5
|
import * as remote from "./remote";
|
|
4
6
|
import * as types from "./types";
|
package/index.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7
|
-
}) : (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
o[k2] = m[k];
|
|
10
|
-
}));
|
|
11
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
12
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
13
|
-
};
|
|
14
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.types = exports.remote = exports.local = void 0;
|
|
5
|
+
exports.types = exports.remote = exports.local = exports.Provider = void 0;
|
|
16
6
|
const pulumi = require("@pulumi/pulumi");
|
|
17
7
|
const utilities = require("./utilities");
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
exports.Provider = null;
|
|
9
|
+
utilities.lazyLoad(exports, ["Provider"], () => require("./provider"));
|
|
20
10
|
// Export sub-modules:
|
|
21
11
|
const local = require("./local");
|
|
22
12
|
exports.local = local;
|
|
@@ -24,14 +14,13 @@ const remote = require("./remote");
|
|
|
24
14
|
exports.remote = remote;
|
|
25
15
|
const types = require("./types");
|
|
26
16
|
exports.types = types;
|
|
27
|
-
const provider_1 = require("./provider");
|
|
28
17
|
pulumi.runtime.registerResourcePackage("command", {
|
|
29
18
|
version: utilities.getVersion(),
|
|
30
19
|
constructProvider: (name, type, urn) => {
|
|
31
20
|
if (type !== "pulumi:providers:command") {
|
|
32
21
|
throw new Error(`unknown provider type ${type}`);
|
|
33
22
|
}
|
|
34
|
-
return new
|
|
23
|
+
return new exports.Provider(name, undefined, { urn });
|
|
35
24
|
},
|
|
36
25
|
});
|
|
37
26
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAK5B,QAAA,QAAQ,GAAyC,IAAW,CAAC;AAC1E,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;AAGvE,sBAAsB;AACtB,iCAAiC;AAK7B,sBAAK;AAJT,mCAAmC;AAK/B,wBAAM;AAJV,iCAAiC;AAK7B,sBAAK;AAET,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE;IAC9C,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,GAAW,EAA2B,EAAE;QACpF,IAAI,IAAI,KAAK,0BAA0B,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,gBAAQ,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;CACJ,CAAC,CAAC"}
|
package/local/command.d.ts
CHANGED
|
@@ -1,10 +1,82 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as enums from "../types/enums";
|
|
2
3
|
/**
|
|
3
4
|
* A local command to be executed.
|
|
4
|
-
*
|
|
5
|
-
* `dependsOn` or `parent` resource options. A command is considered to have
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* ## Example Usage
|
|
9
|
+
*
|
|
10
|
+
* ### Basic Example
|
|
11
|
+
*
|
|
12
|
+
* This example shows the simplest use case, simply running a command on `create` in the Pulumi lifecycle.
|
|
13
|
+
*
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { local } from "@pulumi/command";
|
|
16
|
+
*
|
|
17
|
+
* const random = new local.Command("random", {
|
|
18
|
+
* create: "openssl rand -hex 16",
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* export const output = random.stdout;
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ### Invoking a Lambda during Pulumi Deployment
|
|
25
|
+
*
|
|
26
|
+
* 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.
|
|
27
|
+
*
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import * as aws from "@pulumi/aws";
|
|
30
|
+
* import { local } from "@pulumi/command";
|
|
31
|
+
* import { getStack } from "@pulumi/pulumi";
|
|
32
|
+
*
|
|
33
|
+
* const f = new aws.lambda.CallbackFunction("f", {
|
|
34
|
+
* publish: true,
|
|
35
|
+
* callback: async (ev: any) => {
|
|
36
|
+
* return `Stack ${ev.stackName} is deployed!`;
|
|
37
|
+
* }
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const invoke = new local.Command("execf", {
|
|
41
|
+
* 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`,
|
|
42
|
+
* environment: {
|
|
43
|
+
* FN: f.qualifiedArn,
|
|
44
|
+
* AWS_REGION: aws.config.region!,
|
|
45
|
+
* AWS_PAGER: "",
|
|
46
|
+
* },
|
|
47
|
+
* }, { dependsOn: f })
|
|
48
|
+
*
|
|
49
|
+
* export const output = invoke.stdout;
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* ### Using Triggers
|
|
53
|
+
*
|
|
54
|
+
* This example defines several trigger values of various kinds. Changes to any of them will cause `cmd` to be re-run.
|
|
55
|
+
*
|
|
56
|
+
* ```typescript
|
|
57
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
58
|
+
* import * as command from "@pulumi/command";
|
|
59
|
+
* import * as random from "@pulumi/random";
|
|
60
|
+
*
|
|
61
|
+
* const str = "foo";
|
|
62
|
+
* const fileAsset = new pulumi.asset.FileAsset("Pulumi.yaml");
|
|
63
|
+
* const rand = new random.RandomString("rand", {length: 5});
|
|
64
|
+
* const localFile = new command.local.Command("localFile", {
|
|
65
|
+
* create: "touch foo.txt",
|
|
66
|
+
* archivePaths: ["*.txt"],
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* const cmd = new command.local.Command("cmd", {
|
|
70
|
+
* create: "echo create > op.txt",
|
|
71
|
+
* delete: "echo delete >> op.txt",
|
|
72
|
+
* triggers: [
|
|
73
|
+
* str,
|
|
74
|
+
* rand.result,
|
|
75
|
+
* fileAsset,
|
|
76
|
+
* localFile.archive,
|
|
77
|
+
* ],
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
8
80
|
*/
|
|
9
81
|
export declare class Command extends pulumi.CustomResource {
|
|
10
82
|
/**
|
|
@@ -21,12 +93,113 @@ export declare class Command extends pulumi.CustomResource {
|
|
|
21
93
|
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
22
94
|
*/
|
|
23
95
|
static isInstance(obj: any): obj is Command;
|
|
96
|
+
/**
|
|
97
|
+
* If the previous command's stdout and stderr (as generated by the prior create/update) is
|
|
98
|
+
* injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
|
|
99
|
+
* Defaults to true.
|
|
100
|
+
*/
|
|
101
|
+
readonly addPreviousOutputInEnv: pulumi.Output<boolean | undefined>;
|
|
102
|
+
/**
|
|
103
|
+
* An archive asset containing files found after running the command.
|
|
104
|
+
*/
|
|
105
|
+
readonly archive: pulumi.Output<pulumi.asset.Archive | undefined>;
|
|
106
|
+
/**
|
|
107
|
+
* A list of path globs to return as a single archive asset after the command completes.
|
|
108
|
+
*
|
|
109
|
+
* When specifying glob patterns the following rules apply:
|
|
110
|
+
* - We only include files not directories for assets and archives.
|
|
111
|
+
* - Path separators are `/` on all platforms - including Windows.
|
|
112
|
+
* - Patterns starting with `!` are 'exclude' rules.
|
|
113
|
+
* - Rules are evaluated in order, so exclude rules should be after inclusion rules.
|
|
114
|
+
* - `*` matches anything except `/`
|
|
115
|
+
* - `**` matches anything, _including_ `/`
|
|
116
|
+
* - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
|
|
117
|
+
* - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
|
|
118
|
+
*
|
|
119
|
+
* #### Example
|
|
120
|
+
*
|
|
121
|
+
* Given the rules:
|
|
122
|
+
* ```yaml
|
|
123
|
+
* - "assets/**"
|
|
124
|
+
* - "src/**.js"
|
|
125
|
+
* - "!**secret.*"
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* When evaluating against this folder:
|
|
129
|
+
*
|
|
130
|
+
* ```yaml
|
|
131
|
+
* - assets/
|
|
132
|
+
* - logos/
|
|
133
|
+
* - logo.svg
|
|
134
|
+
* - src/
|
|
135
|
+
* - index.js
|
|
136
|
+
* - secret.js
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* The following paths will be returned:
|
|
140
|
+
*
|
|
141
|
+
* ```yaml
|
|
142
|
+
* - assets/logos/logo.svg
|
|
143
|
+
* - src/index.js
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
readonly archivePaths: pulumi.Output<string[] | undefined>;
|
|
147
|
+
/**
|
|
148
|
+
* A list of path globs to read after the command completes.
|
|
149
|
+
*
|
|
150
|
+
* When specifying glob patterns the following rules apply:
|
|
151
|
+
* - We only include files not directories for assets and archives.
|
|
152
|
+
* - Path separators are `/` on all platforms - including Windows.
|
|
153
|
+
* - Patterns starting with `!` are 'exclude' rules.
|
|
154
|
+
* - Rules are evaluated in order, so exclude rules should be after inclusion rules.
|
|
155
|
+
* - `*` matches anything except `/`
|
|
156
|
+
* - `**` matches anything, _including_ `/`
|
|
157
|
+
* - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
|
|
158
|
+
* - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
|
|
159
|
+
*
|
|
160
|
+
* #### Example
|
|
161
|
+
*
|
|
162
|
+
* Given the rules:
|
|
163
|
+
* ```yaml
|
|
164
|
+
* - "assets/**"
|
|
165
|
+
* - "src/**.js"
|
|
166
|
+
* - "!**secret.*"
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* When evaluating against this folder:
|
|
170
|
+
*
|
|
171
|
+
* ```yaml
|
|
172
|
+
* - assets/
|
|
173
|
+
* - logos/
|
|
174
|
+
* - logo.svg
|
|
175
|
+
* - src/
|
|
176
|
+
* - index.js
|
|
177
|
+
* - secret.js
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* The following paths will be returned:
|
|
181
|
+
*
|
|
182
|
+
* ```yaml
|
|
183
|
+
* - assets/logos/logo.svg
|
|
184
|
+
* - src/index.js
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
readonly assetPaths: pulumi.Output<string[] | undefined>;
|
|
188
|
+
/**
|
|
189
|
+
* A map of assets found after running the command.
|
|
190
|
+
* The key is the relative path from the command dir
|
|
191
|
+
*/
|
|
192
|
+
readonly assets: pulumi.Output<{
|
|
193
|
+
[key: string]: pulumi.asset.Asset | pulumi.asset.Archive;
|
|
194
|
+
} | undefined>;
|
|
24
195
|
/**
|
|
25
196
|
* The command to run on create.
|
|
26
197
|
*/
|
|
27
198
|
readonly create: pulumi.Output<string | undefined>;
|
|
28
199
|
/**
|
|
29
|
-
* The command to run on delete.
|
|
200
|
+
* The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
|
|
201
|
+
* and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
|
|
202
|
+
* Command resource from previous create or update steps.
|
|
30
203
|
*/
|
|
31
204
|
readonly delete: pulumi.Output<string | undefined>;
|
|
32
205
|
/**
|
|
@@ -42,19 +215,39 @@ export declare class Command extends pulumi.CustomResource {
|
|
|
42
215
|
} | undefined>;
|
|
43
216
|
/**
|
|
44
217
|
* The program and arguments to run the command.
|
|
45
|
-
*
|
|
218
|
+
* On Linux and macOS, defaults to: `["/bin/sh", "-c"]`. On Windows, defaults to: `["cmd", "/C"]`
|
|
46
219
|
*/
|
|
47
220
|
readonly interpreter: pulumi.Output<string[] | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* If the command's stdout and stderr should be logged. This doesn't affect the capturing of
|
|
223
|
+
* stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
|
|
224
|
+
* outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
|
|
225
|
+
*/
|
|
226
|
+
readonly logging: pulumi.Output<enums.local.Logging | undefined>;
|
|
48
227
|
/**
|
|
49
228
|
* The standard error of the command's process
|
|
50
229
|
*/
|
|
51
230
|
readonly stderr: pulumi.Output<string>;
|
|
231
|
+
/**
|
|
232
|
+
* Pass a string to the command's process as standard in
|
|
233
|
+
*/
|
|
234
|
+
readonly stdin: pulumi.Output<string | undefined>;
|
|
52
235
|
/**
|
|
53
236
|
* The standard output of the command's process
|
|
54
237
|
*/
|
|
55
238
|
readonly stdout: pulumi.Output<string>;
|
|
56
239
|
/**
|
|
57
|
-
*
|
|
240
|
+
* Trigger a resource replacement on changes to any of these values. The
|
|
241
|
+
* trigger values can be of any type. If a value is different in the current update compared to the
|
|
242
|
+
* previous update, the resource will be replaced, i.e., the "create" command will be re-run.
|
|
243
|
+
* Please see the resource documentation for examples.
|
|
244
|
+
*/
|
|
245
|
+
readonly triggers: pulumi.Output<any[] | undefined>;
|
|
246
|
+
/**
|
|
247
|
+
* The command to run on update, if empty, create will
|
|
248
|
+
* run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
|
|
249
|
+
* are set to the stdout and stderr properties of the Command resource from previous
|
|
250
|
+
* create or update steps.
|
|
58
251
|
*/
|
|
59
252
|
readonly update: pulumi.Output<string | undefined>;
|
|
60
253
|
/**
|
|
@@ -70,16 +263,107 @@ export declare class Command extends pulumi.CustomResource {
|
|
|
70
263
|
* The set of arguments for constructing a Command resource.
|
|
71
264
|
*/
|
|
72
265
|
export interface CommandArgs {
|
|
266
|
+
/**
|
|
267
|
+
* If the previous command's stdout and stderr (as generated by the prior create/update) is
|
|
268
|
+
* injected into the environment of the next run as PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR.
|
|
269
|
+
* Defaults to true.
|
|
270
|
+
*/
|
|
271
|
+
addPreviousOutputInEnv?: pulumi.Input<boolean>;
|
|
272
|
+
/**
|
|
273
|
+
* A list of path globs to return as a single archive asset after the command completes.
|
|
274
|
+
*
|
|
275
|
+
* When specifying glob patterns the following rules apply:
|
|
276
|
+
* - We only include files not directories for assets and archives.
|
|
277
|
+
* - Path separators are `/` on all platforms - including Windows.
|
|
278
|
+
* - Patterns starting with `!` are 'exclude' rules.
|
|
279
|
+
* - Rules are evaluated in order, so exclude rules should be after inclusion rules.
|
|
280
|
+
* - `*` matches anything except `/`
|
|
281
|
+
* - `**` matches anything, _including_ `/`
|
|
282
|
+
* - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
|
|
283
|
+
* - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
|
|
284
|
+
*
|
|
285
|
+
* #### Example
|
|
286
|
+
*
|
|
287
|
+
* Given the rules:
|
|
288
|
+
* ```yaml
|
|
289
|
+
* - "assets/**"
|
|
290
|
+
* - "src/**.js"
|
|
291
|
+
* - "!**secret.*"
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* When evaluating against this folder:
|
|
295
|
+
*
|
|
296
|
+
* ```yaml
|
|
297
|
+
* - assets/
|
|
298
|
+
* - logos/
|
|
299
|
+
* - logo.svg
|
|
300
|
+
* - src/
|
|
301
|
+
* - index.js
|
|
302
|
+
* - secret.js
|
|
303
|
+
* ```
|
|
304
|
+
*
|
|
305
|
+
* The following paths will be returned:
|
|
306
|
+
*
|
|
307
|
+
* ```yaml
|
|
308
|
+
* - assets/logos/logo.svg
|
|
309
|
+
* - src/index.js
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
312
|
+
archivePaths?: pulumi.Input<pulumi.Input<string>[]>;
|
|
313
|
+
/**
|
|
314
|
+
* A list of path globs to read after the command completes.
|
|
315
|
+
*
|
|
316
|
+
* When specifying glob patterns the following rules apply:
|
|
317
|
+
* - We only include files not directories for assets and archives.
|
|
318
|
+
* - Path separators are `/` on all platforms - including Windows.
|
|
319
|
+
* - Patterns starting with `!` are 'exclude' rules.
|
|
320
|
+
* - Rules are evaluated in order, so exclude rules should be after inclusion rules.
|
|
321
|
+
* - `*` matches anything except `/`
|
|
322
|
+
* - `**` matches anything, _including_ `/`
|
|
323
|
+
* - All returned paths are relative to the working directory (without leading `./`) e.g. `file.text` or `subfolder/file.txt`.
|
|
324
|
+
* - For full details of the globbing syntax, see [github.com/gobwas/glob](https://github.com/gobwas/glob)
|
|
325
|
+
*
|
|
326
|
+
* #### Example
|
|
327
|
+
*
|
|
328
|
+
* Given the rules:
|
|
329
|
+
* ```yaml
|
|
330
|
+
* - "assets/**"
|
|
331
|
+
* - "src/**.js"
|
|
332
|
+
* - "!**secret.*"
|
|
333
|
+
* ```
|
|
334
|
+
*
|
|
335
|
+
* When evaluating against this folder:
|
|
336
|
+
*
|
|
337
|
+
* ```yaml
|
|
338
|
+
* - assets/
|
|
339
|
+
* - logos/
|
|
340
|
+
* - logo.svg
|
|
341
|
+
* - src/
|
|
342
|
+
* - index.js
|
|
343
|
+
* - secret.js
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* The following paths will be returned:
|
|
347
|
+
*
|
|
348
|
+
* ```yaml
|
|
349
|
+
* - assets/logos/logo.svg
|
|
350
|
+
* - src/index.js
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
assetPaths?: pulumi.Input<pulumi.Input<string>[]>;
|
|
73
354
|
/**
|
|
74
355
|
* The command to run on create.
|
|
75
356
|
*/
|
|
76
357
|
create?: pulumi.Input<string>;
|
|
77
358
|
/**
|
|
78
|
-
* The command to run on delete.
|
|
359
|
+
* The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
|
|
360
|
+
* and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
|
|
361
|
+
* Command resource from previous create or update steps.
|
|
79
362
|
*/
|
|
80
363
|
delete?: pulumi.Input<string>;
|
|
81
364
|
/**
|
|
82
|
-
* The
|
|
365
|
+
* The directory from which to run the command from. If `dir` does not exist, then
|
|
366
|
+
* `Command` will fail.
|
|
83
367
|
*/
|
|
84
368
|
dir?: pulumi.Input<string>;
|
|
85
369
|
/**
|
|
@@ -94,7 +378,27 @@ export interface CommandArgs {
|
|
|
94
378
|
*/
|
|
95
379
|
interpreter?: pulumi.Input<pulumi.Input<string>[]>;
|
|
96
380
|
/**
|
|
97
|
-
*
|
|
381
|
+
* If the command's stdout and stderr should be logged. This doesn't affect the capturing of
|
|
382
|
+
* stdout and stderr as outputs. If there might be secrets in the output, you can disable logging here and mark the
|
|
383
|
+
* outputs as secret via 'additionalSecretOutputs'. Defaults to logging both stdout and stderr.
|
|
384
|
+
*/
|
|
385
|
+
logging?: pulumi.Input<enums.local.Logging>;
|
|
386
|
+
/**
|
|
387
|
+
* Pass a string to the command's process as standard in
|
|
388
|
+
*/
|
|
389
|
+
stdin?: pulumi.Input<string>;
|
|
390
|
+
/**
|
|
391
|
+
* Trigger a resource replacement on changes to any of these values. The
|
|
392
|
+
* trigger values can be of any type. If a value is different in the current update compared to the
|
|
393
|
+
* previous update, the resource will be replaced, i.e., the "create" command will be re-run.
|
|
394
|
+
* Please see the resource documentation for examples.
|
|
395
|
+
*/
|
|
396
|
+
triggers?: pulumi.Input<any[]>;
|
|
397
|
+
/**
|
|
398
|
+
* The command to run on update, if empty, create will
|
|
399
|
+
* run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
|
|
400
|
+
* are set to the stdout and stderr properties of the Command resource from previous
|
|
401
|
+
* create or update steps.
|
|
98
402
|
*/
|
|
99
403
|
update?: pulumi.Input<string>;
|
|
100
404
|
}
|