skillfed

pulumi-random

A Pulumi package to safely use randomness in Pulumi programs.

pulumi-random v4.21.1 1.6M downloads/30d#3,691 on PyPI43
Permissive license Apache-2.0 Active released

What it is and what it does

pulumi-random is a Pulumi provider that enables safe, deterministic use of randomness in infrastructure-as-code programs. Unlike calling random functions directly—which would produce different values on every program evaluation and break Pulumi's goal-state model—this provider integrates randomness into Pulumi's resource lifecycle so that generated values remain stable across updates unless explicitly refreshed.

The package exposes resource types like RandomPassword, RandomId, and RandomString that generate random values as first-class Pulumi outputs. These outputs can be passed to other resources (e.g., an RDS password, a resource name suffix) while respecting Pulumi's convergence semantics. It depends on pulumi as its core runtime and uses parver and semver for version handling.

Use it for:

  • Generate random database passwords and pass them to RDS or other managed database resources without re-convergence on every run.
  • Create unique resource names with random suffixes to avoid naming collisions in multi-environment deployments.
  • Produce random IDs for tagging or identifying infrastructure components while maintaining deterministic state.
  • Seed random strings for API keys, tokens, or other secrets that need to be stable across stack updates.
  • Combine randomness with Pulumi's automation API to provision infrastructure with deterministic but unpredictable identifiers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides safe, deterministic randomness for Pulumi infrastructure-as-code programs by generating random resource properties that integrate with Pulumi's state-oriented lifecycle.

Yes. This is an actively maintained, low-friction Pulumi provider with no known vulnerabilities, permissive licensing, and a clear use case for anyone building infrastructure-as-code with Pulumi who needs randomness. Install it if you are using Pulumi and need to safely incorporate random values into your resource definitions.

Install

pulumi-random on PyPI

pip

pip install pulumi-random

uv

uv add pulumi-random

poetry

poetry add pulumi-random

Installing pulumi-random

Before you install

Low install friction with a pure Python wheel. Actively maintained as of 23 days ago with recent commits. Depends on pulumi, parver, semver, and typing-extensions—all standard, lightweight dependencies.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install pulumi_random

import pulumi
import pulumi_random as random

password = random.RandomPassword("db_password", length=16, special=True)
pulumi.export("password", password.result)

Requires Python 3.9 or later and a Pulumi project context to function.

Verify before relying

  • Whether random values persist correctly across Pulumi stack updates and state refreshes in practice.
  • Performance characteristics when generating many random resources in a single program.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — parver, pulumi, semver, typing-extensions
Maintenance actively maintained — 23 days since the last release
Last repo commit
First released
Downloads 1,645,693/month — #3,691 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pulumi_random-4.21.1-py3-none-any.whl

Keywords: pulumi, random

Tags

pulumi random password generatorinfrastructure randomness pulumipulumi random string resourcesafe randomness infrastructure codepulumi random id generatordeterministic random values pulumipulumi random provider
infrastructure-as-codepulumi-providerrandomness

More Build Tools packages