Get started with Pulumi in a free one hour introductory workshop. Register Now

Random

The Random provider for Pulumi can be used to help introduce random values when dealing with Pulumi resources.

See the full API documentation for complete details of the available Random provider APIs.

Example

const random = require("@pulumi/random")

const username = new random.Pet("my-user-name");
import * as random from "@pulumi/random";

const username = new random.Pet("my-user-name");
import pulumi_random as random

username = random.Pet("my-user-name")
import (
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
    random "github.com/pulumi/pulumi-random/sdk/v2/go/random"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        username, err := random.NewPet(ctx, "my-user-name", &random.PetArgs{})
        if err != nil {
            return err
        }

        return nil
    })
}
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Random;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            var username = new Pet("my-user-name", new PetArgs{});
        });
}

Libraries

The following packages are available in packager managers:

The Random provider is open source and available in the pulumi/pulumi-random repo.