https://github.com/pulumi/pulumi-random
A Pulumi provider that safely enables randomness for resources
https://github.com/pulumi/pulumi-random
Last synced: 2 months ago
JSON representation
A Pulumi provider that safely enables randomness for resources
- Host: GitHub
- URL: https://github.com/pulumi/pulumi-random
- Owner: pulumi
- License: apache-2.0
- Created: 2018-10-25T23:26:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-09T11:57:08.000Z (8 months ago)
- Last Synced: 2024-10-09T20:33:26.722Z (8 months ago)
- Language: Go
- Homepage:
- Size: 4.42 MB
- Stars: 38
- Watchers: 25
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG_OLD.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/pulumi/pulumi-random/actions)
[](https://slack.pulumi.com)
[](https://npmjs.com/package/@pulumi/random)
[](https://badge.fury.io/nu/pulumi.random)
[](https://pypi.org/project/pulumi-random)
[](https://pkg.go.dev/github.com/pulumi/pulumi-random/sdk/v4/go)
[](https://github.com/pulumi/pulumi-random/blob/master/LICENSE)# Random Provider
The random provider allows the safe use of randomness in a Pulumi program. This allows you to generate resource
properties, such as names, that contain randomness in a way that works with Pulumi's goal state oriented approach.
Using randomness as usual would not work well with Pulumi, because by definition, each time the program is evaluated,
a new random state would be produced, necessitating re-convergence on the goal state. This provider understands
how to work with the Pulumi resource lifecycle to accomplish randomness safely and in a way that works as desired.## Installing
This package is available in many languages in the standard packaging formats.
### Node.js (Java/TypeScript)
To use from JavaScript or TypeScript in Node.js, install using either `npm`:
$ npm install @pulumi/random
or `yarn`:
$ yarn add @pulumi/random
### Python
To use from Python, install using `pip`:
$ pip install pulumi_random
### Go
To use from Go, use `go get` to grab the latest version of the library
$ go get github.com/pulumi/pulumi-random/sdk/v4/go/...
### .NET
To use from .NET, install using `dotnet add package`:
$ dotnet add package Pulumi.Random
## Example
For example, to generate a random password, allocate a `RandomPassword` resource
and then use its `result` output property (of type `Output`) to pass
to another resource.```typescript
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as random from "@pulumi/random";const password = new random.RandomPassword("password", {
length: 16,
overrideSpecial: "_%@",
special: true,
});
const example = new aws.rds.Instance("example", {
password: password.result,
});
```## Reference
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).