@pulumi/random 4.13.2 → 4.13.3
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 +21 -21
- package/package.json +2 -3
- package/package.json.bak +1 -2
- package/provider.js +1 -1
- package/provider.js.map +1 -1
- package/randomPassword.d.ts +5 -53
- package/randomPassword.js +3 -51
- package/randomPassword.js.map +1 -1
- package/randomString.d.ts +4 -50
- package/randomString.js +4 -50
- package/randomString.js.map +1 -1
- package/package.json.dev +0 -27
- package/scripts/install-pulumi-plugin.js +0 -21
package/README.md
CHANGED
|
@@ -14,27 +14,6 @@ Using randomness as usual would not work well with Pulumi, because by definition
|
|
|
14
14
|
a new random state would be produced, necessitating re-convergence on the goal state. This provider understands
|
|
15
15
|
how to work with the Pulumi resource lifecycle to accomplish randomness safely and in a way that works as desired.
|
|
16
16
|
|
|
17
|
-
## Example
|
|
18
|
-
|
|
19
|
-
For example, to generate a random password, allocate a `RandomPassword` resource
|
|
20
|
-
and then use its `result` output property (of type `Output<string>`) to pass
|
|
21
|
-
to another resource.
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import * as pulumi from "@pulumi/pulumi";
|
|
25
|
-
import * as aws from "@pulumi/aws";
|
|
26
|
-
import * as random from "@pulumi/random";
|
|
27
|
-
|
|
28
|
-
const password = new random.RandomPassword("password", {
|
|
29
|
-
length: 16,
|
|
30
|
-
overrideSpecial: "_%@",
|
|
31
|
-
special: true,
|
|
32
|
-
});
|
|
33
|
-
const example = new aws.rds.Instance("example", {
|
|
34
|
-
password: password.result,
|
|
35
|
-
});
|
|
36
|
-
```
|
|
37
|
-
|
|
38
17
|
## Installing
|
|
39
18
|
|
|
40
19
|
This package is available in many languages in the standard packaging formats.
|
|
@@ -67,6 +46,27 @@ To use from .NET, install using `dotnet add package`:
|
|
|
67
46
|
|
|
68
47
|
$ dotnet add package Pulumi.Random
|
|
69
48
|
|
|
49
|
+
## Example
|
|
50
|
+
|
|
51
|
+
For example, to generate a random password, allocate a `RandomPassword` resource
|
|
52
|
+
and then use its `result` output property (of type `Output<string>`) to pass
|
|
53
|
+
to another resource.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
57
|
+
import * as aws from "@pulumi/aws";
|
|
58
|
+
import * as random from "@pulumi/random";
|
|
59
|
+
|
|
60
|
+
const password = new random.RandomPassword("password", {
|
|
61
|
+
length: 16,
|
|
62
|
+
overrideSpecial: "_%@",
|
|
63
|
+
special: true,
|
|
64
|
+
});
|
|
65
|
+
const example = new aws.rds.Instance("example", {
|
|
66
|
+
password: password.result,
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
70
|
## Reference
|
|
71
71
|
|
|
72
72
|
For further information, please visit [the random provider docs](https://www.pulumi.com/docs/intro/cloud-providers/random) or for detailed reference documentation, please visit [the API docs](https://www.pulumi.com/docs/reference/pkg/random).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/random",
|
|
3
|
-
"version": "v4.13.
|
|
3
|
+
"version": "v4.13.3",
|
|
4
4
|
"description": "A Pulumi package to safely use randomness in Pulumi programs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pulumi",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"repository": "https://github.com/pulumi/pulumi-random",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "tsc"
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource random v4.13.2"
|
|
13
|
+
"build": "tsc"
|
|
15
14
|
},
|
|
16
15
|
"dependencies": {
|
|
17
16
|
"@pulumi/pulumi": "^3.0.0"
|
package/package.json.bak
CHANGED
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"repository": "https://github.com/pulumi/pulumi-random",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "tsc"
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource random ${VERSION}"
|
|
13
|
+
"build": "tsc"
|
|
15
14
|
},
|
|
16
15
|
"dependencies": {
|
|
17
16
|
"@pulumi/pulumi": "^3.0.0"
|
package/provider.js
CHANGED
|
@@ -20,7 +20,7 @@ class Provider extends pulumi.ProviderResource {
|
|
|
20
20
|
if (obj === undefined || obj === null) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
|
-
return obj['__pulumiType'] === Provider.__pulumiType;
|
|
23
|
+
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Create a Provider resource with the given unique name, arguments, and options.
|
package/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;GAKG;AACH,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,QAAQ,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;GAKG;AACH,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,QAAQ,CAAC"}
|
package/randomPassword.d.ts
CHANGED
|
@@ -27,61 +27,13 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
27
27
|
*
|
|
28
28
|
* ## Import
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* You can import external passwords into your Pulumi programs as follows:
|
|
31
31
|
*
|
|
32
32
|
* ```sh
|
|
33
|
-
* $
|
|
33
|
+
* $ import random:index/randomPassword:RandomPassword newPassword supersecret
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* terraform
|
|
39
|
-
*
|
|
40
|
-
* resource "random_password" "password" {
|
|
41
|
-
*
|
|
42
|
-
* length = 14
|
|
43
|
-
*
|
|
44
|
-
* lower
|
|
45
|
-
*
|
|
46
|
-
* = true
|
|
47
|
-
*
|
|
48
|
-
* } 2. Attribute values that match the imported ID and omit the attributes with defaults:
|
|
49
|
-
*
|
|
50
|
-
* terraform
|
|
51
|
-
*
|
|
52
|
-
* resource "random_password" "password" {
|
|
53
|
-
*
|
|
54
|
-
* length = 14
|
|
55
|
-
*
|
|
56
|
-
* } 3. `ignore_changes` specifying the attributes to ignore:
|
|
57
|
-
*
|
|
58
|
-
* terraform
|
|
59
|
-
*
|
|
60
|
-
* resource "random_password" "password" {
|
|
61
|
-
*
|
|
62
|
-
* length = 16
|
|
63
|
-
*
|
|
64
|
-
* lower
|
|
65
|
-
*
|
|
66
|
-
* = false
|
|
67
|
-
*
|
|
68
|
-
* lifecycle {
|
|
69
|
-
*
|
|
70
|
-
* ignore_changes = [
|
|
71
|
-
*
|
|
72
|
-
* length,
|
|
73
|
-
*
|
|
74
|
-
* lower,
|
|
75
|
-
*
|
|
76
|
-
* ]
|
|
77
|
-
*
|
|
78
|
-
* }
|
|
79
|
-
*
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* **NOTE** `ignore_changes` is only required until the resource is recreated after import,
|
|
83
|
-
*
|
|
84
|
-
* after which it will use the configuration values specified.
|
|
36
|
+
* This command will encode the `supersecret` token in Pulumi state and generate a code suggestion to include a new RandomPassword resource in your Pulumi program. Include the suggested code and do a `pulumi up`. Your secret password is now securely stored in Pulumi, and you can reference it in your Pulumi program as `newPassword.result`.
|
|
85
37
|
*/
|
|
86
38
|
export declare class RandomPassword extends pulumi.CustomResource {
|
|
87
39
|
/**
|
|
@@ -100,7 +52,7 @@ export declare class RandomPassword extends pulumi.CustomResource {
|
|
|
100
52
|
*/
|
|
101
53
|
static isInstance(obj: any): obj is RandomPassword;
|
|
102
54
|
/**
|
|
103
|
-
* A bcrypt hash of the generated random string.
|
|
55
|
+
* A bcrypt hash of the generated random string. **NOTE**: If the generated random string is greater than 72 bytes in length, `bcryptHash` will contain a hash of the first 72 bytes.
|
|
104
56
|
*/
|
|
105
57
|
readonly bcryptHash: pulumi.Output<string>;
|
|
106
58
|
/**
|
|
@@ -173,7 +125,7 @@ export declare class RandomPassword extends pulumi.CustomResource {
|
|
|
173
125
|
*/
|
|
174
126
|
export interface RandomPasswordState {
|
|
175
127
|
/**
|
|
176
|
-
* A bcrypt hash of the generated random string.
|
|
128
|
+
* A bcrypt hash of the generated random string. **NOTE**: If the generated random string is greater than 72 bytes in length, `bcryptHash` will contain a hash of the first 72 bytes.
|
|
177
129
|
*/
|
|
178
130
|
bcryptHash?: pulumi.Input<string>;
|
|
179
131
|
/**
|
package/randomPassword.js
CHANGED
|
@@ -33,61 +33,13 @@ const utilities = require("./utilities");
|
|
|
33
33
|
*
|
|
34
34
|
* ## Import
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* You can import external passwords into your Pulumi programs as follows:
|
|
37
37
|
*
|
|
38
38
|
* ```sh
|
|
39
|
-
* $
|
|
39
|
+
* $ import random:index/randomPassword:RandomPassword newPassword supersecret
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* terraform
|
|
45
|
-
*
|
|
46
|
-
* resource "random_password" "password" {
|
|
47
|
-
*
|
|
48
|
-
* length = 14
|
|
49
|
-
*
|
|
50
|
-
* lower
|
|
51
|
-
*
|
|
52
|
-
* = true
|
|
53
|
-
*
|
|
54
|
-
* } 2. Attribute values that match the imported ID and omit the attributes with defaults:
|
|
55
|
-
*
|
|
56
|
-
* terraform
|
|
57
|
-
*
|
|
58
|
-
* resource "random_password" "password" {
|
|
59
|
-
*
|
|
60
|
-
* length = 14
|
|
61
|
-
*
|
|
62
|
-
* } 3. `ignore_changes` specifying the attributes to ignore:
|
|
63
|
-
*
|
|
64
|
-
* terraform
|
|
65
|
-
*
|
|
66
|
-
* resource "random_password" "password" {
|
|
67
|
-
*
|
|
68
|
-
* length = 16
|
|
69
|
-
*
|
|
70
|
-
* lower
|
|
71
|
-
*
|
|
72
|
-
* = false
|
|
73
|
-
*
|
|
74
|
-
* lifecycle {
|
|
75
|
-
*
|
|
76
|
-
* ignore_changes = [
|
|
77
|
-
*
|
|
78
|
-
* length,
|
|
79
|
-
*
|
|
80
|
-
* lower,
|
|
81
|
-
*
|
|
82
|
-
* ]
|
|
83
|
-
*
|
|
84
|
-
* }
|
|
85
|
-
*
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* **NOTE** `ignore_changes` is only required until the resource is recreated after import,
|
|
89
|
-
*
|
|
90
|
-
* after which it will use the configuration values specified.
|
|
42
|
+
* This command will encode the `supersecret` token in Pulumi state and generate a code suggestion to include a new RandomPassword resource in your Pulumi program. Include the suggested code and do a `pulumi up`. Your secret password is now securely stored in Pulumi, and you can reference it in your Pulumi program as `newPassword.result`.
|
|
91
43
|
*/
|
|
92
44
|
class RandomPassword extends pulumi.CustomResource {
|
|
93
45
|
/**
|
package/randomPassword.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomPassword.js","sourceRoot":"","sources":["../randomPassword.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"randomPassword.js","sourceRoot":"","sources":["../randomPassword.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAa,cAAe,SAAQ,MAAM,CAAC,cAAc;IACrD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAA2B,EAAE,IAAmC;QACzH,OAAO,IAAI,cAAc,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IACrE,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,cAAc,CAAC,YAAY,CAAC;IAC/D,CAAC;IAqED,YAAY,IAAY,EAAE,WAAsD,EAAE,IAAmC;QACjH,IAAI,cAAc,GAAkB,E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AgB;AACO,2BAAY,GAAG,4CAA4C,CAAC"}
|
package/randomString.d.ts
CHANGED
|
@@ -21,61 +21,15 @@ import * as pulumi from "@pulumi/pulumi";
|
|
|
21
21
|
*
|
|
22
22
|
* ## Import
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* You can import external strings into your Pulumi programs as RandomString resources as follows:
|
|
25
25
|
*
|
|
26
26
|
* ```sh
|
|
27
|
-
* $
|
|
27
|
+
* $ import random:index/randomString:RandomString newString myspecialdata
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* This command will encode the `myspecialdata` token in Pulumi state and generate a code suggestion to include a new RandomString resource in your Pulumi program. Include the suggested code and do a `pulumi up`. Your data is now stored in Pulumi, and you can reference it in your Pulumi program as `newString.result`.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* resource "random_string" "test" {
|
|
35
|
-
*
|
|
36
|
-
* length = 4
|
|
37
|
-
*
|
|
38
|
-
* lower
|
|
39
|
-
*
|
|
40
|
-
* = true
|
|
41
|
-
*
|
|
42
|
-
* } 2. Attribute values that match the imported ID and omit the attributes with defaults:
|
|
43
|
-
*
|
|
44
|
-
* terraform
|
|
45
|
-
*
|
|
46
|
-
* resource "random_string" "test" {
|
|
47
|
-
*
|
|
48
|
-
* length = 4
|
|
49
|
-
*
|
|
50
|
-
* } 3. `ignore_changes` specifying the attributes to ignore:
|
|
51
|
-
*
|
|
52
|
-
* terraform
|
|
53
|
-
*
|
|
54
|
-
* resource "random_string" "test" {
|
|
55
|
-
*
|
|
56
|
-
* length = 16
|
|
57
|
-
*
|
|
58
|
-
* lower
|
|
59
|
-
*
|
|
60
|
-
* = false
|
|
61
|
-
*
|
|
62
|
-
* lifecycle {
|
|
63
|
-
*
|
|
64
|
-
* ignore_changes = [
|
|
65
|
-
*
|
|
66
|
-
* length,
|
|
67
|
-
*
|
|
68
|
-
* lower,
|
|
69
|
-
*
|
|
70
|
-
* ]
|
|
71
|
-
*
|
|
72
|
-
* }
|
|
73
|
-
*
|
|
74
|
-
* }
|
|
75
|
-
*
|
|
76
|
-
* **NOTE** `ignore_changes` is only required until the resource is recreated after import,
|
|
77
|
-
*
|
|
78
|
-
* after which it will use the configuration values specified.
|
|
32
|
+
* If the data needs to be stored securily as a secret, consider using the RandomPassword resource instead.
|
|
79
33
|
*/
|
|
80
34
|
export declare class RandomString extends pulumi.CustomResource {
|
|
81
35
|
/**
|
package/randomString.js
CHANGED
|
@@ -27,61 +27,15 @@ const utilities = require("./utilities");
|
|
|
27
27
|
*
|
|
28
28
|
* ## Import
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* You can import external strings into your Pulumi programs as RandomString resources as follows:
|
|
31
31
|
*
|
|
32
32
|
* ```sh
|
|
33
|
-
* $
|
|
33
|
+
* $ import random:index/randomString:RandomString newString myspecialdata
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* This command will encode the `myspecialdata` token in Pulumi state and generate a code suggestion to include a new RandomString resource in your Pulumi program. Include the suggested code and do a `pulumi up`. Your data is now stored in Pulumi, and you can reference it in your Pulumi program as `newString.result`.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* resource "random_string" "test" {
|
|
41
|
-
*
|
|
42
|
-
* length = 4
|
|
43
|
-
*
|
|
44
|
-
* lower
|
|
45
|
-
*
|
|
46
|
-
* = true
|
|
47
|
-
*
|
|
48
|
-
* } 2. Attribute values that match the imported ID and omit the attributes with defaults:
|
|
49
|
-
*
|
|
50
|
-
* terraform
|
|
51
|
-
*
|
|
52
|
-
* resource "random_string" "test" {
|
|
53
|
-
*
|
|
54
|
-
* length = 4
|
|
55
|
-
*
|
|
56
|
-
* } 3. `ignore_changes` specifying the attributes to ignore:
|
|
57
|
-
*
|
|
58
|
-
* terraform
|
|
59
|
-
*
|
|
60
|
-
* resource "random_string" "test" {
|
|
61
|
-
*
|
|
62
|
-
* length = 16
|
|
63
|
-
*
|
|
64
|
-
* lower
|
|
65
|
-
*
|
|
66
|
-
* = false
|
|
67
|
-
*
|
|
68
|
-
* lifecycle {
|
|
69
|
-
*
|
|
70
|
-
* ignore_changes = [
|
|
71
|
-
*
|
|
72
|
-
* length,
|
|
73
|
-
*
|
|
74
|
-
* lower,
|
|
75
|
-
*
|
|
76
|
-
* ]
|
|
77
|
-
*
|
|
78
|
-
* }
|
|
79
|
-
*
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* **NOTE** `ignore_changes` is only required until the resource is recreated after import,
|
|
83
|
-
*
|
|
84
|
-
* after which it will use the configuration values specified.
|
|
38
|
+
* If the data needs to be stored securily as a secret, consider using the RandomPassword resource instead.
|
|
85
39
|
*/
|
|
86
40
|
class RandomString extends pulumi.CustomResource {
|
|
87
41
|
/**
|
package/randomString.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomString.js","sourceRoot":"","sources":["../randomString.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"randomString.js","sourceRoot":"","sources":["../randomString.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,YAAa,SAAQ,MAAM,CAAC,cAAc;IACnD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAyB,EAAE,IAAmC;QACvH,OAAO,IAAI,YAAY,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IACnE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK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version": "v4.13.2",
|
|
4
|
-
"description": "A Pulumi package to safely use randomness in Pulumi programs.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"pulumi",
|
|
7
|
-
"random"
|
|
8
|
-
],
|
|
9
|
-
"homepage": "https://pulumi.io",
|
|
10
|
-
"repository": "https://github.com/pulumi/pulumi-random",
|
|
11
|
-
"license": "Apache-2.0",
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc",
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource random v4.13.2"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@pulumi/pulumi": "^3.0.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/node": "^10.0.0",
|
|
21
|
-
"typescript": "^4.3.5"
|
|
22
|
-
},
|
|
23
|
-
"pulumi": {
|
|
24
|
-
"resource": true,
|
|
25
|
-
"name": "random"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var childProcess = require("child_process");
|
|
3
|
-
|
|
4
|
-
var args = process.argv.slice(2);
|
|
5
|
-
var res = childProcess.spawnSync("pulumi", ["plugin", "install"].concat(args), {
|
|
6
|
-
stdio: ["ignore", "inherit", "inherit"]
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
if (res.error && res.error.code === "ENOENT") {
|
|
10
|
-
console.error("\nThere was an error installing the resource provider plugin. " +
|
|
11
|
-
"It looks like `pulumi` is not installed on your system. " +
|
|
12
|
-
"Please visit https://pulumi.com/ to install the Pulumi CLI.\n" +
|
|
13
|
-
"You may try manually installing the plugin by running " +
|
|
14
|
-
"`pulumi plugin install " + args.join(" ") + "`");
|
|
15
|
-
} else if (res.error || res.status !== 0) {
|
|
16
|
-
console.error("\nThere was an error installing the resource provider plugin. " +
|
|
17
|
-
"You may try to manually installing the plugin by running " +
|
|
18
|
-
"`pulumi plugin install " + args.join(" ") + "`");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
process.exit(0);
|