@pulumi/random 4.0.0-alpha.1618578237 → 4.0.0-alpha.1768025699
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 +23 -23
- package/index.d.ts +24 -7
- package/index.js +44 -28
- package/index.js.map +1 -1
- package/package.json +8 -6
- package/provider.d.ts +14 -0
- package/provider.js +20 -13
- package/provider.js.map +1 -1
- package/randomBytes.d.ts +110 -0
- package/randomBytes.js +88 -0
- package/randomBytes.js.map +1 -0
- package/randomId.d.ts +43 -52
- package/randomId.js +53 -48
- package/randomId.js.map +1 -1
- package/randomInteger.d.ts +36 -43
- package/randomInteger.js +50 -52
- package/randomInteger.js.map +1 -1
- package/randomPassword.d.ts +96 -94
- package/randomPassword.js +51 -61
- package/randomPassword.js.map +1 -1
- package/randomPet.d.ts +33 -49
- package/randomPet.js +34 -45
- package/randomPet.js.map +1 -1
- package/randomShuffle.d.ts +25 -54
- package/randomShuffle.js +30 -36
- package/randomShuffle.js.map +1 -1
- package/randomString.d.ts +92 -121
- package/randomString.js +49 -56
- package/randomString.js.map +1 -1
- package/randomUuid.d.ts +20 -28
- package/randomUuid.js +30 -33
- package/randomUuid.js.map +1 -1
- package/utilities.js +41 -1
- package/utilities.js.map +1 -1
- package/package.json.bak +0 -24
- package/package.json.dev +0 -24
- package/scripts/install-pulumi-plugin.js +0 -21
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://npmjs.com/package/@pulumi/random)
|
|
4
4
|
[](https://badge.fury.io/nu/pulumi.random)
|
|
5
5
|
[](https://pypi.org/project/pulumi-random)
|
|
6
|
-
[](https://pkg.go.dev/github.com/pulumi/pulumi-random/sdk/v4/go)
|
|
7
7
|
[](https://github.com/pulumi/pulumi-random/blob/master/LICENSE)
|
|
8
8
|
|
|
9
9
|
# Random Provider
|
|
@@ -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.
|
|
@@ -59,7 +38,7 @@ To use from Python, install using `pip`:
|
|
|
59
38
|
|
|
60
39
|
To use from Go, use `go get` to grab the latest version of the library
|
|
61
40
|
|
|
62
|
-
$ go get github.com/pulumi/pulumi-random/sdk/
|
|
41
|
+
$ go get github.com/pulumi/pulumi-random/sdk/v4/go/...
|
|
63
42
|
|
|
64
43
|
### .NET
|
|
65
44
|
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
export * from "./provider";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
2
|
+
export { RandomBytesArgs, RandomBytesState } from "./randomBytes";
|
|
3
|
+
export type RandomBytes = import("./randomBytes").RandomBytes;
|
|
4
|
+
export declare const RandomBytes: typeof import("./randomBytes").RandomBytes;
|
|
5
|
+
export { RandomIdArgs, RandomIdState } from "./randomId";
|
|
6
|
+
export type RandomId = import("./randomId").RandomId;
|
|
7
|
+
export declare const RandomId: typeof import("./randomId").RandomId;
|
|
8
|
+
export { RandomIntegerArgs, RandomIntegerState } from "./randomInteger";
|
|
9
|
+
export type RandomInteger = import("./randomInteger").RandomInteger;
|
|
10
|
+
export declare const RandomInteger: typeof import("./randomInteger").RandomInteger;
|
|
11
|
+
export { RandomPasswordArgs, RandomPasswordState } from "./randomPassword";
|
|
12
|
+
export type RandomPassword = import("./randomPassword").RandomPassword;
|
|
13
|
+
export declare const RandomPassword: typeof import("./randomPassword").RandomPassword;
|
|
14
|
+
export { RandomPetArgs, RandomPetState } from "./randomPet";
|
|
15
|
+
export type RandomPet = import("./randomPet").RandomPet;
|
|
16
|
+
export declare const RandomPet: typeof import("./randomPet").RandomPet;
|
|
17
|
+
export { RandomShuffleArgs, RandomShuffleState } from "./randomShuffle";
|
|
18
|
+
export type RandomShuffle = import("./randomShuffle").RandomShuffle;
|
|
19
|
+
export declare const RandomShuffle: typeof import("./randomShuffle").RandomShuffle;
|
|
20
|
+
export { RandomStringArgs, RandomStringState } from "./randomString";
|
|
21
|
+
export type RandomString = import("./randomString").RandomString;
|
|
22
|
+
export declare const RandomString: typeof import("./randomString").RandomString;
|
|
23
|
+
export { RandomUuidArgs, RandomUuidState } from "./randomUuid";
|
|
24
|
+
export type RandomUuid = import("./randomUuid").RandomUuid;
|
|
25
|
+
export declare const RandomUuid: typeof import("./randomUuid").RandomUuid;
|
package/index.js
CHANGED
|
@@ -1,52 +1,69 @@
|
|
|
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
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = 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);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
7
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.RandomUuid = exports.RandomString = exports.RandomShuffle = exports.RandomPet = exports.RandomPassword = exports.RandomInteger = exports.RandomId = exports.RandomBytes = void 0;
|
|
8
20
|
const pulumi = require("@pulumi/pulumi");
|
|
9
21
|
const utilities = require("./utilities");
|
|
10
22
|
// Export members:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
__exportStar(require("./provider"), exports);
|
|
24
|
+
const provider_1 = require("./provider");
|
|
25
|
+
exports.RandomBytes = null;
|
|
26
|
+
utilities.lazyLoad(exports, ["RandomBytes"], () => require("./randomBytes"));
|
|
27
|
+
exports.RandomId = null;
|
|
28
|
+
utilities.lazyLoad(exports, ["RandomId"], () => require("./randomId"));
|
|
29
|
+
exports.RandomInteger = null;
|
|
30
|
+
utilities.lazyLoad(exports, ["RandomInteger"], () => require("./randomInteger"));
|
|
31
|
+
exports.RandomPassword = null;
|
|
32
|
+
utilities.lazyLoad(exports, ["RandomPassword"], () => require("./randomPassword"));
|
|
33
|
+
exports.RandomPet = null;
|
|
34
|
+
utilities.lazyLoad(exports, ["RandomPet"], () => require("./randomPet"));
|
|
35
|
+
exports.RandomShuffle = null;
|
|
36
|
+
utilities.lazyLoad(exports, ["RandomShuffle"], () => require("./randomShuffle"));
|
|
37
|
+
exports.RandomString = null;
|
|
38
|
+
utilities.lazyLoad(exports, ["RandomString"], () => require("./randomString"));
|
|
39
|
+
exports.RandomUuid = null;
|
|
40
|
+
utilities.lazyLoad(exports, ["RandomUuid"], () => require("./randomUuid"));
|
|
27
41
|
const _module = {
|
|
28
42
|
version: utilities.getVersion(),
|
|
29
43
|
construct: (name, type, urn) => {
|
|
30
44
|
switch (type) {
|
|
45
|
+
case "random:index/randomBytes:RandomBytes":
|
|
46
|
+
return new exports.RandomBytes(name, undefined, { urn });
|
|
31
47
|
case "random:index/randomId:RandomId":
|
|
32
|
-
return new
|
|
48
|
+
return new exports.RandomId(name, undefined, { urn });
|
|
33
49
|
case "random:index/randomInteger:RandomInteger":
|
|
34
|
-
return new
|
|
50
|
+
return new exports.RandomInteger(name, undefined, { urn });
|
|
35
51
|
case "random:index/randomPassword:RandomPassword":
|
|
36
|
-
return new
|
|
52
|
+
return new exports.RandomPassword(name, undefined, { urn });
|
|
37
53
|
case "random:index/randomPet:RandomPet":
|
|
38
|
-
return new
|
|
54
|
+
return new exports.RandomPet(name, undefined, { urn });
|
|
39
55
|
case "random:index/randomShuffle:RandomShuffle":
|
|
40
|
-
return new
|
|
56
|
+
return new exports.RandomShuffle(name, undefined, { urn });
|
|
41
57
|
case "random:index/randomString:RandomString":
|
|
42
|
-
return new
|
|
58
|
+
return new exports.RandomString(name, undefined, { urn });
|
|
43
59
|
case "random:index/randomUuid:RandomUuid":
|
|
44
|
-
return new
|
|
60
|
+
return new exports.RandomUuid(name, undefined, { urn });
|
|
45
61
|
default:
|
|
46
62
|
throw new Error(`unknown resource type ${type}`);
|
|
47
63
|
}
|
|
48
64
|
},
|
|
49
65
|
};
|
|
66
|
+
pulumi.runtime.registerResourceModule("random", "index/randomBytes", _module);
|
|
50
67
|
pulumi.runtime.registerResourceModule("random", "index/randomId", _module);
|
|
51
68
|
pulumi.runtime.registerResourceModule("random", "index/randomInteger", _module);
|
|
52
69
|
pulumi.runtime.registerResourceModule("random", "index/randomPassword", _module);
|
|
@@ -54,7 +71,6 @@ pulumi.runtime.registerResourceModule("random", "index/randomPet", _module);
|
|
|
54
71
|
pulumi.runtime.registerResourceModule("random", "index/randomShuffle", _module);
|
|
55
72
|
pulumi.runtime.registerResourceModule("random", "index/randomString", _module);
|
|
56
73
|
pulumi.runtime.registerResourceModule("random", "index/randomUuid", _module);
|
|
57
|
-
const provider_1 = require("./provider");
|
|
58
74
|
pulumi.runtime.registerResourcePackage("random", {
|
|
59
75
|
version: utilities.getVersion(),
|
|
60
76
|
constructProvider: (name, type, urn) => {
|
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;AAEzC,kBAAkB;AAClB,6CAA2B;AAC3B,yCAAsC;AAIzB,QAAA,WAAW,GAA+C,IAAW,CAAC;AACnF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;AAIhE,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;AAI1D,QAAA,aAAa,GAAmD,IAAW,CAAC;AACzF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAIpE,QAAA,cAAc,GAAqD,IAAW,CAAC;AAC5F,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAItE,QAAA,SAAS,GAA2C,IAAW,CAAC;AAC7E,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;AAI5D,QAAA,aAAa,GAAmD,IAAW,CAAC;AACzF,SAAS,CAAC,QAAQ,CAAC,OAA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AyB,EAAE;YACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,mBAAQ,CAAC,IAAI,EAAO,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;CACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/random",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1768025699",
|
|
4
4
|
"description": "A Pulumi package to safely use randomness in Pulumi programs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pulumi",
|
|
@@ -10,16 +10,18 @@
|
|
|
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.0.0-alpha.1618578237+c63c06e8"
|
|
13
|
+
"build": "tsc"
|
|
15
14
|
},
|
|
16
15
|
"dependencies": {
|
|
17
|
-
"@pulumi/pulumi": "^3.
|
|
16
|
+
"@pulumi/pulumi": "^3.142.0"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
|
-
"@types/node": "^
|
|
19
|
+
"@types/node": "^10.0.0",
|
|
20
|
+
"typescript": "^4.3.5"
|
|
21
21
|
},
|
|
22
22
|
"pulumi": {
|
|
23
|
-
"resource": true
|
|
23
|
+
"resource": true,
|
|
24
|
+
"name": "random",
|
|
25
|
+
"version": "4.0.0-alpha.1768025699"
|
|
24
26
|
}
|
|
25
27
|
}
|
package/provider.d.ts
CHANGED
|
@@ -19,9 +19,23 @@ export declare class Provider extends pulumi.ProviderResource {
|
|
|
19
19
|
* @param opts A bag of options that control this resource's behavior.
|
|
20
20
|
*/
|
|
21
21
|
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions);
|
|
22
|
+
/**
|
|
23
|
+
* This function returns a Terraform config object with terraform-namecased keys,to be used with the Terraform Module Provider.
|
|
24
|
+
*/
|
|
25
|
+
terraformConfig(): pulumi.Output<Provider.TerraformConfigResult>;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* The set of arguments for constructing a Provider resource.
|
|
25
29
|
*/
|
|
26
30
|
export interface ProviderArgs {
|
|
27
31
|
}
|
|
32
|
+
export declare namespace Provider {
|
|
33
|
+
/**
|
|
34
|
+
* The results of the Provider.terraformConfig method.
|
|
35
|
+
*/
|
|
36
|
+
interface TerraformConfigResult {
|
|
37
|
+
readonly result: {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
package/provider.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// *** WARNING: this file was generated by
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
3
|
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Provider = void 0;
|
|
5
6
|
const pulumi = require("@pulumi/pulumi");
|
|
6
7
|
const utilities = require("./utilities");
|
|
7
8
|
/**
|
|
@@ -11,6 +12,16 @@ const utilities = require("./utilities");
|
|
|
11
12
|
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
|
|
12
13
|
*/
|
|
13
14
|
class Provider extends pulumi.ProviderResource {
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if the given object is an instance of Provider. This is designed to work even
|
|
17
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
18
|
+
*/
|
|
19
|
+
static isInstance(obj) {
|
|
20
|
+
if (obj === undefined || obj === null) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
|
|
24
|
+
}
|
|
14
25
|
/**
|
|
15
26
|
* Create a Provider resource with the given unique name, arguments, and options.
|
|
16
27
|
*
|
|
@@ -19,24 +30,20 @@ class Provider extends pulumi.ProviderResource {
|
|
|
19
30
|
* @param opts A bag of options that control this resource's behavior.
|
|
20
31
|
*/
|
|
21
32
|
constructor(name, args, opts) {
|
|
22
|
-
let
|
|
33
|
+
let resourceInputs = {};
|
|
23
34
|
opts = opts || {};
|
|
24
35
|
{
|
|
25
36
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
super(Provider.__pulumiType, name, inputs, opts);
|
|
37
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
38
|
+
super(Provider.__pulumiType, name, resourceInputs, opts);
|
|
30
39
|
}
|
|
31
40
|
/**
|
|
32
|
-
*
|
|
33
|
-
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
41
|
+
* This function returns a Terraform config object with terraform-namecased keys,to be used with the Terraform Module Provider.
|
|
34
42
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return obj['__pulumiType'] === Provider.__pulumiType;
|
|
43
|
+
terraformConfig() {
|
|
44
|
+
return pulumi.runtime.call("pulumi:providers:random/terraformConfig", {
|
|
45
|
+
"__self__": this,
|
|
46
|
+
}, this);
|
|
40
47
|
}
|
|
41
48
|
}
|
|
42
49
|
exports.Provider = Provider;
|
package/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;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;IAED;;OAEG;IACH,eAAe;QACX,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE;YAClE,UAAU,EAAE,IAAI;SACnB,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;;AAvCL,4BAwCC;AAvCG,gBAAgB;AACO,qBAAY,GAAG,QAAQ,CAAC"}
|
package/randomBytes.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
/**
|
|
3
|
+
* The resource `random.RandomBytes` generates random bytes that are intended to be used as a secret, or key. Use this in preference to `random.RandomId` when the output is considered sensitive, and should not be displayed in the CLI.
|
|
4
|
+
*
|
|
5
|
+
* This resource *does* use a cryptographic random number generator.
|
|
6
|
+
*
|
|
7
|
+
* ## Example Usage
|
|
8
|
+
*
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
11
|
+
* import * as azurerm from "@pulumi/azurerm";
|
|
12
|
+
* import * as random from "@pulumi/random";
|
|
13
|
+
*
|
|
14
|
+
* const jwtSecret = new random.RandomBytes("jwt_secret", {length: 64});
|
|
15
|
+
* const jwtSecretKeyVaultSecret = new azurerm.index.KeyVaultSecret("jwt_secret", {
|
|
16
|
+
* keyVaultId: "some-azure-key-vault-id",
|
|
17
|
+
* name: "JwtSecret",
|
|
18
|
+
* value: jwtSecret.base64,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* ## Import
|
|
23
|
+
*
|
|
24
|
+
* Random bytes can be imported by specifying the value as base64 string.
|
|
25
|
+
*
|
|
26
|
+
* ```sh
|
|
27
|
+
* $ pulumi import random:index/randomBytes:RandomBytes basic "8/fu3q+2DcgSJ19i0jZ5Cw=="
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare class RandomBytes extends pulumi.CustomResource {
|
|
31
|
+
/**
|
|
32
|
+
* Get an existing RandomBytes resource's state with the given name, ID, and optional extra
|
|
33
|
+
* properties used to qualify the lookup.
|
|
34
|
+
*
|
|
35
|
+
* @param name The _unique_ name of the resulting resource.
|
|
36
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
37
|
+
* @param state Any extra arguments used during the lookup.
|
|
38
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
39
|
+
*/
|
|
40
|
+
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RandomBytesState, opts?: pulumi.CustomResourceOptions): RandomBytes;
|
|
41
|
+
/**
|
|
42
|
+
* Returns true if the given object is an instance of RandomBytes. This is designed to work even
|
|
43
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
44
|
+
*/
|
|
45
|
+
static isInstance(obj: any): obj is RandomBytes;
|
|
46
|
+
/**
|
|
47
|
+
* The generated bytes presented in base64 string format.
|
|
48
|
+
*/
|
|
49
|
+
readonly base64: pulumi.Output<string>;
|
|
50
|
+
/**
|
|
51
|
+
* The generated bytes presented in lowercase hexadecimal string format. The length of the encoded string is exactly twice the `length` parameter.
|
|
52
|
+
*/
|
|
53
|
+
readonly hex: pulumi.Output<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
|
|
56
|
+
*/
|
|
57
|
+
readonly keepers: pulumi.Output<{
|
|
58
|
+
[key: string]: string;
|
|
59
|
+
} | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* The number of bytes requested. The minimum value for length is 1.
|
|
62
|
+
*/
|
|
63
|
+
readonly length: pulumi.Output<number>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a RandomBytes resource with the given unique name, arguments, and options.
|
|
66
|
+
*
|
|
67
|
+
* @param name The _unique_ name of the resource.
|
|
68
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
69
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
70
|
+
*/
|
|
71
|
+
constructor(name: string, args: RandomBytesArgs, opts?: pulumi.CustomResourceOptions);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Input properties used for looking up and filtering RandomBytes resources.
|
|
75
|
+
*/
|
|
76
|
+
export interface RandomBytesState {
|
|
77
|
+
/**
|
|
78
|
+
* The generated bytes presented in base64 string format.
|
|
79
|
+
*/
|
|
80
|
+
base64?: pulumi.Input<string>;
|
|
81
|
+
/**
|
|
82
|
+
* The generated bytes presented in lowercase hexadecimal string format. The length of the encoded string is exactly twice the `length` parameter.
|
|
83
|
+
*/
|
|
84
|
+
hex?: pulumi.Input<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
|
|
87
|
+
*/
|
|
88
|
+
keepers?: pulumi.Input<{
|
|
89
|
+
[key: string]: pulumi.Input<string>;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* The number of bytes requested. The minimum value for length is 1.
|
|
93
|
+
*/
|
|
94
|
+
length?: pulumi.Input<number>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The set of arguments for constructing a RandomBytes resource.
|
|
98
|
+
*/
|
|
99
|
+
export interface RandomBytesArgs {
|
|
100
|
+
/**
|
|
101
|
+
* Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
|
|
102
|
+
*/
|
|
103
|
+
keepers?: pulumi.Input<{
|
|
104
|
+
[key: string]: pulumi.Input<string>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* The number of bytes requested. The minimum value for length is 1.
|
|
108
|
+
*/
|
|
109
|
+
length: pulumi.Input<number>;
|
|
110
|
+
}
|
package/randomBytes.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.RandomBytes = void 0;
|
|
6
|
+
const pulumi = require("@pulumi/pulumi");
|
|
7
|
+
const utilities = require("./utilities");
|
|
8
|
+
/**
|
|
9
|
+
* The resource `random.RandomBytes` generates random bytes that are intended to be used as a secret, or key. Use this in preference to `random.RandomId` when the output is considered sensitive, and should not be displayed in the CLI.
|
|
10
|
+
*
|
|
11
|
+
* This resource *does* use a cryptographic random number generator.
|
|
12
|
+
*
|
|
13
|
+
* ## Example Usage
|
|
14
|
+
*
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
17
|
+
* import * as azurerm from "@pulumi/azurerm";
|
|
18
|
+
* import * as random from "@pulumi/random";
|
|
19
|
+
*
|
|
20
|
+
* const jwtSecret = new random.RandomBytes("jwt_secret", {length: 64});
|
|
21
|
+
* const jwtSecretKeyVaultSecret = new azurerm.index.KeyVaultSecret("jwt_secret", {
|
|
22
|
+
* keyVaultId: "some-azure-key-vault-id",
|
|
23
|
+
* name: "JwtSecret",
|
|
24
|
+
* value: jwtSecret.base64,
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ## Import
|
|
29
|
+
*
|
|
30
|
+
* Random bytes can be imported by specifying the value as base64 string.
|
|
31
|
+
*
|
|
32
|
+
* ```sh
|
|
33
|
+
* $ pulumi import random:index/randomBytes:RandomBytes basic "8/fu3q+2DcgSJ19i0jZ5Cw=="
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
class RandomBytes extends pulumi.CustomResource {
|
|
37
|
+
/**
|
|
38
|
+
* Get an existing RandomBytes resource's state with the given name, ID, and optional extra
|
|
39
|
+
* properties used to qualify the lookup.
|
|
40
|
+
*
|
|
41
|
+
* @param name The _unique_ name of the resulting resource.
|
|
42
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
43
|
+
* @param state Any extra arguments used during the lookup.
|
|
44
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
45
|
+
*/
|
|
46
|
+
static get(name, id, state, opts) {
|
|
47
|
+
return new RandomBytes(name, state, { ...opts, id: id });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns true if the given object is an instance of RandomBytes. This is designed to work even
|
|
51
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
52
|
+
*/
|
|
53
|
+
static isInstance(obj) {
|
|
54
|
+
if (obj === undefined || obj === null) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return obj['__pulumiType'] === RandomBytes.__pulumiType;
|
|
58
|
+
}
|
|
59
|
+
constructor(name, argsOrState, opts) {
|
|
60
|
+
let resourceInputs = {};
|
|
61
|
+
opts = opts || {};
|
|
62
|
+
if (opts.id) {
|
|
63
|
+
const state = argsOrState;
|
|
64
|
+
resourceInputs["base64"] = state?.base64;
|
|
65
|
+
resourceInputs["hex"] = state?.hex;
|
|
66
|
+
resourceInputs["keepers"] = state?.keepers;
|
|
67
|
+
resourceInputs["length"] = state?.length;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const args = argsOrState;
|
|
71
|
+
if (args?.length === undefined && !opts.urn) {
|
|
72
|
+
throw new Error("Missing required property 'length'");
|
|
73
|
+
}
|
|
74
|
+
resourceInputs["keepers"] = args?.keepers;
|
|
75
|
+
resourceInputs["length"] = args?.length;
|
|
76
|
+
resourceInputs["base64"] = undefined /*out*/;
|
|
77
|
+
resourceInputs["hex"] = undefined /*out*/;
|
|
78
|
+
}
|
|
79
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
80
|
+
const secretOpts = { additionalSecretOutputs: ["base64", "hex"] };
|
|
81
|
+
opts = pulumi.mergeOptions(opts, secretOpts);
|
|
82
|
+
super(RandomBytes.__pulumiType, name, resourceInputs, opts);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.RandomBytes = RandomBytes;
|
|
86
|
+
/** @internal */
|
|
87
|
+
RandomBytes.__pulumiType = 'random:index/randomBytes:RandomBytes';
|
|
88
|
+
//# sourceMappingURL=randomBytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randomBytes.js","sourceRoot":"","sources":["../randomBytes.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,WAAY,SAAQ,MAAM,CAAC,cAAc;IAClD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAwB,EAAE,IAAmC;QACtH,OAAO,IAAI,WAAW,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAClE,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,WAA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