@pulumi/random 4.9.0 → 4.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/random",
3
- "version": "v4.9.0",
3
+ "version": "v4.10.0",
4
4
  "description": "A Pulumi package to safely use randomness in Pulumi programs.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -11,7 +11,7 @@
11
11
  "license": "Apache-2.0",
12
12
  "scripts": {
13
13
  "build": "tsc",
14
- "install": "node scripts/install-pulumi-plugin.js resource random v4.9.0"
14
+ "install": "node scripts/install-pulumi-plugin.js resource random v4.10.0"
15
15
  },
16
16
  "dependencies": {
17
17
  "@pulumi/pulumi": "^3.0.0"
package/package.json.dev CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/random",
3
- "version": "v4.9.0",
3
+ "version": "v4.10.0",
4
4
  "description": "A Pulumi package to safely use randomness in Pulumi programs.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -11,7 +11,7 @@
11
11
  "license": "Apache-2.0",
12
12
  "scripts": {
13
13
  "build": "tsc",
14
- "install": "node scripts/install-pulumi-plugin.js resource random v4.9.0"
14
+ "install": "node scripts/install-pulumi-plugin.js resource random v4.10.0"
15
15
  },
16
16
  "dependencies": {
17
17
  "@pulumi/pulumi": "^3.0.0"
package/randomId.d.ts CHANGED
@@ -15,37 +15,37 @@ import * as pulumi from "@pulumi/pulumi";
15
15
  *
16
16
  * ## Example Usage
17
17
  *
18
+ * The following example shows how to generate a unique name for an AWS EC2
19
+ * instance that changes each time a new AMI id is selected.
20
+ *
18
21
  * ```typescript
19
22
  * import * as pulumi from "@pulumi/pulumi";
20
23
  * import * as aws from "@pulumi/aws";
21
24
  * import * as random from "@pulumi/random";
22
25
  *
23
- * // The following example shows how to generate a unique name for an AWS EC2
24
- * // instance that changes each time a new AMI id is selected.
25
26
  * const serverRandomId = new random.RandomId("serverRandomId", {
27
+ * byteLength: 8,
26
28
  * keepers: {
27
29
  * ami_id: _var.ami_id,
28
30
  * },
29
- * byteLength: 8,
30
31
  * });
31
32
  * const serverInstance = new aws.ec2.Instance("serverInstance", {
33
+ * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
32
34
  * tags: {
33
35
  * Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,
34
36
  * },
35
- * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
36
37
  * });
37
- * // ... (other aws_instance arguments) ...
38
38
  * ```
39
39
  *
40
40
  * ## Import
41
41
  *
42
- * Random IDs can be imported using the b64_url with an optional prefix. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
42
+ * Random Ids can be imported using the `b64_url` with an optional `prefix`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
43
43
  *
44
44
  * ```sh
45
45
  * $ pulumi import random:index/randomId:RandomId server p-9hUg
46
46
  * ```
47
47
  *
48
- * Example with prefix (prefix is separated by a ,)
48
+ * Example with prefix (prefix is separated by a `,`)
49
49
  *
50
50
  * ```sh
51
51
  * $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg
@@ -76,7 +76,8 @@ export declare class RandomId extends pulumi.CustomResource {
76
76
  */
77
77
  readonly b64Url: pulumi.Output<string>;
78
78
  /**
79
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
79
+ * The number of random bytes to produce. The
80
+ * minimum value is 1, which produces eight bits of randomness.
80
81
  */
81
82
  readonly byteLength: pulumi.Output<number>;
82
83
  /**
@@ -88,13 +89,17 @@ export declare class RandomId extends pulumi.CustomResource {
88
89
  */
89
90
  readonly hex: pulumi.Output<string>;
90
91
  /**
91
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
92
+ * Arbitrary map of values that, when changed, will
93
+ * trigger a new id to be generated. See
94
+ * the main provider documentation for more information.
92
95
  */
93
96
  readonly keepers: pulumi.Output<{
94
- [key: string]: string;
97
+ [key: string]: any;
95
98
  } | undefined>;
96
99
  /**
97
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
100
+ * Arbitrary string to prefix the output value with. This
101
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
102
+ * base64 encoded.
98
103
  */
99
104
  readonly prefix: pulumi.Output<string | undefined>;
100
105
  /**
@@ -119,7 +124,8 @@ export interface RandomIdState {
119
124
  */
120
125
  b64Url?: pulumi.Input<string>;
121
126
  /**
122
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
127
+ * The number of random bytes to produce. The
128
+ * minimum value is 1, which produces eight bits of randomness.
123
129
  */
124
130
  byteLength?: pulumi.Input<number>;
125
131
  /**
@@ -131,13 +137,17 @@ export interface RandomIdState {
131
137
  */
132
138
  hex?: pulumi.Input<string>;
133
139
  /**
134
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
140
+ * Arbitrary map of values that, when changed, will
141
+ * trigger a new id to be generated. See
142
+ * the main provider documentation for more information.
135
143
  */
136
144
  keepers?: pulumi.Input<{
137
- [key: string]: pulumi.Input<string>;
145
+ [key: string]: any;
138
146
  }>;
139
147
  /**
140
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
148
+ * Arbitrary string to prefix the output value with. This
149
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
150
+ * base64 encoded.
141
151
  */
142
152
  prefix?: pulumi.Input<string>;
143
153
  }
@@ -146,17 +156,22 @@ export interface RandomIdState {
146
156
  */
147
157
  export interface RandomIdArgs {
148
158
  /**
149
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
159
+ * The number of random bytes to produce. The
160
+ * minimum value is 1, which produces eight bits of randomness.
150
161
  */
151
162
  byteLength: pulumi.Input<number>;
152
163
  /**
153
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
164
+ * Arbitrary map of values that, when changed, will
165
+ * trigger a new id to be generated. See
166
+ * the main provider documentation for more information.
154
167
  */
155
168
  keepers?: pulumi.Input<{
156
- [key: string]: pulumi.Input<string>;
169
+ [key: string]: any;
157
170
  }>;
158
171
  /**
159
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
172
+ * Arbitrary string to prefix the output value with. This
173
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
174
+ * base64 encoded.
160
175
  */
161
176
  prefix?: pulumi.Input<string>;
162
177
  }
package/randomId.js CHANGED
@@ -21,37 +21,37 @@ const utilities = require("./utilities");
21
21
  *
22
22
  * ## Example Usage
23
23
  *
24
+ * The following example shows how to generate a unique name for an AWS EC2
25
+ * instance that changes each time a new AMI id is selected.
26
+ *
24
27
  * ```typescript
25
28
  * import * as pulumi from "@pulumi/pulumi";
26
29
  * import * as aws from "@pulumi/aws";
27
30
  * import * as random from "@pulumi/random";
28
31
  *
29
- * // The following example shows how to generate a unique name for an AWS EC2
30
- * // instance that changes each time a new AMI id is selected.
31
32
  * const serverRandomId = new random.RandomId("serverRandomId", {
33
+ * byteLength: 8,
32
34
  * keepers: {
33
35
  * ami_id: _var.ami_id,
34
36
  * },
35
- * byteLength: 8,
36
37
  * });
37
38
  * const serverInstance = new aws.ec2.Instance("serverInstance", {
39
+ * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
38
40
  * tags: {
39
41
  * Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,
40
42
  * },
41
- * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
42
43
  * });
43
- * // ... (other aws_instance arguments) ...
44
44
  * ```
45
45
  *
46
46
  * ## Import
47
47
  *
48
- * Random IDs can be imported using the b64_url with an optional prefix. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
48
+ * Random Ids can be imported using the `b64_url` with an optional `prefix`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
49
49
  *
50
50
  * ```sh
51
51
  * $ pulumi import random:index/randomId:RandomId server p-9hUg
52
52
  * ```
53
53
  *
54
- * Example with prefix (prefix is separated by a ,)
54
+ * Example with prefix (prefix is separated by a `,`)
55
55
  *
56
56
  * ```sh
57
57
  * $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg
package/randomId.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"randomId.js","sourceRoot":"","sources":["../randomId.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,cAAc;IAC/C;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAqB,EAAE,IAAmC;QACnH,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IAC/D,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,QAAQ,CAAC,YAAY,CAAC;IACzD,CAAC;IAuCD,YAAY,IAAY,EAAE,WAA0C,EAAE,IAAmC;QACrG,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAAwC,CAAC;YACvD,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5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G,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC7C,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC7C,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;YAC1C,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAC7C;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;;AAjGL,4BAkGC;AApFG,gBAAgB;AACO,qBAAY,GAAG,gCAAgC,CAAC"}
@@ -2,38 +2,43 @@ import * as pulumi from "@pulumi/pulumi";
2
2
  /**
3
3
  * The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.
4
4
  *
5
- * This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.
5
+ * This resource can be used in conjunction with resources that have
6
+ * the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with
7
+ * unique names during the brief period where both the old and new resources
8
+ * exist concurrently.
6
9
  *
7
10
  * ## Example Usage
8
11
  *
12
+ * The following example shows how to generate a random priority between 1 and 50000 for
13
+ * a `awsAlbListenerRule` resource:
14
+ *
9
15
  * ```typescript
10
16
  * import * as pulumi from "@pulumi/pulumi";
11
17
  * import * as aws from "@pulumi/aws";
12
18
  * import * as random from "@pulumi/random";
13
19
  *
14
- * // The following example shows how to generate a random priority
15
- * // between 1 and 50000 for a aws_alb_listener_rule resource:
16
20
  * const priority = new random.RandomInteger("priority", {
17
- * min: 1,
18
- * max: 50000,
19
21
  * keepers: {
20
22
  * listener_arn: _var.listener_arn,
21
23
  * },
24
+ * max: 50000,
25
+ * min: 1,
22
26
  * });
23
27
  * const main = new aws.alb.ListenerRule("main", {
24
- * listenerArn: priority.keepers.apply(keepers => keepers?.listenerArn),
25
- * priority: priority.result,
26
28
  * actions: [{
27
- * type: "forward",
28
29
  * targetGroupArn: _var.target_group_arn,
30
+ * type: "forward",
29
31
  * }],
32
+ * listenerArn: _var.listener_arn,
33
+ * priority: priority.result,
30
34
  * });
31
- * // ... (other aws_alb_listener_rule arguments) ...
32
35
  * ```
33
36
  *
37
+ * The result of the above will set a random priority.
38
+ *
34
39
  * ## Import
35
40
  *
36
- * Random integers can be imported using the result, min, and max, with an optional seed. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a ,)
41
+ * Random integers can be imported using the `result`, `min`, and `max`, with an optional `seed`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a `,`)
37
42
  *
38
43
  * ```sh
39
44
  * $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000
@@ -56,10 +61,12 @@ export declare class RandomInteger extends pulumi.CustomResource {
56
61
  */
57
62
  static isInstance(obj: any): obj is RandomInteger;
58
63
  /**
59
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
64
+ * Arbitrary map of values that, when changed, will
65
+ * trigger a new id to be generated. See
66
+ * the main provider documentation for more information.
60
67
  */
61
68
  readonly keepers: pulumi.Output<{
62
- [key: string]: string;
69
+ [key: string]: any;
63
70
  } | undefined>;
64
71
  /**
65
72
  * The maximum inclusive value of the range.
@@ -70,7 +77,7 @@ export declare class RandomInteger extends pulumi.CustomResource {
70
77
  */
71
78
  readonly min: pulumi.Output<number>;
72
79
  /**
73
- * The random integer result.
80
+ * (int) The random Integer result.
74
81
  */
75
82
  readonly result: pulumi.Output<number>;
76
83
  /**
@@ -91,10 +98,12 @@ export declare class RandomInteger extends pulumi.CustomResource {
91
98
  */
92
99
  export interface RandomIntegerState {
93
100
  /**
94
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
101
+ * Arbitrary map of values that, when changed, will
102
+ * trigger a new id to be generated. See
103
+ * the main provider documentation for more information.
95
104
  */
96
105
  keepers?: pulumi.Input<{
97
- [key: string]: pulumi.Input<string>;
106
+ [key: string]: any;
98
107
  }>;
99
108
  /**
100
109
  * The maximum inclusive value of the range.
@@ -105,7 +114,7 @@ export interface RandomIntegerState {
105
114
  */
106
115
  min?: pulumi.Input<number>;
107
116
  /**
108
- * The random integer result.
117
+ * (int) The random Integer result.
109
118
  */
110
119
  result?: pulumi.Input<number>;
111
120
  /**
@@ -118,10 +127,12 @@ export interface RandomIntegerState {
118
127
  */
119
128
  export interface RandomIntegerArgs {
120
129
  /**
121
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
130
+ * Arbitrary map of values that, when changed, will
131
+ * trigger a new id to be generated. See
132
+ * the main provider documentation for more information.
122
133
  */
123
134
  keepers?: pulumi.Input<{
124
- [key: string]: pulumi.Input<string>;
135
+ [key: string]: any;
125
136
  }>;
126
137
  /**
127
138
  * The maximum inclusive value of the range.
package/randomInteger.js CHANGED
@@ -8,38 +8,43 @@ const utilities = require("./utilities");
8
8
  /**
9
9
  * The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.
10
10
  *
11
- * This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.
11
+ * This resource can be used in conjunction with resources that have
12
+ * the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with
13
+ * unique names during the brief period where both the old and new resources
14
+ * exist concurrently.
12
15
  *
13
16
  * ## Example Usage
14
17
  *
18
+ * The following example shows how to generate a random priority between 1 and 50000 for
19
+ * a `awsAlbListenerRule` resource:
20
+ *
15
21
  * ```typescript
16
22
  * import * as pulumi from "@pulumi/pulumi";
17
23
  * import * as aws from "@pulumi/aws";
18
24
  * import * as random from "@pulumi/random";
19
25
  *
20
- * // The following example shows how to generate a random priority
21
- * // between 1 and 50000 for a aws_alb_listener_rule resource:
22
26
  * const priority = new random.RandomInteger("priority", {
23
- * min: 1,
24
- * max: 50000,
25
27
  * keepers: {
26
28
  * listener_arn: _var.listener_arn,
27
29
  * },
30
+ * max: 50000,
31
+ * min: 1,
28
32
  * });
29
33
  * const main = new aws.alb.ListenerRule("main", {
30
- * listenerArn: priority.keepers.apply(keepers => keepers?.listenerArn),
31
- * priority: priority.result,
32
34
  * actions: [{
33
- * type: "forward",
34
35
  * targetGroupArn: _var.target_group_arn,
36
+ * type: "forward",
35
37
  * }],
38
+ * listenerArn: _var.listener_arn,
39
+ * priority: priority.result,
36
40
  * });
37
- * // ... (other aws_alb_listener_rule arguments) ...
38
41
  * ```
39
42
  *
43
+ * The result of the above will set a random priority.
44
+ *
40
45
  * ## Import
41
46
  *
42
- * Random integers can be imported using the result, min, and max, with an optional seed. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a ,)
47
+ * Random integers can be imported using the `result`, `min`, and `max`, with an optional `seed`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a `,`)
43
48
  *
44
49
  * ```sh
45
50
  * $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000
@@ -1 +1 @@
1
- {"version":3,"file":"randomInteger.js","sourceRoot":"","sources":["../randomInteger.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,aAAc,SAAQ,MAAM,CAAC,cAAc;IACpD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,C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