New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@pulumi/random

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pulumi/random

A Pulumi package to safely use randomness in Pulumi programs.


Version published
Weekly downloads
489K
decreased by-8.83%
Maintainers
2
Weekly downloads
 
Created

What is @pulumi/random?

@pulumi/random is an npm package that provides utilities for generating random values, such as random strings, random integers, and random passwords. It is particularly useful in infrastructure as code (IaC) scenarios where you need to generate random values for resource names, passwords, or other configurations.

What are @pulumi/random's main functionalities?

Random String

Generates a random string of specified length. In this example, a random string of length 16 is generated without special characters.

const pulumi = require('@pulumi/pulumi');
const random = require('@pulumi/random');

const randomString = new random.RandomString('randomString', {
  length: 16,
  special: false,
});

exports.result = randomString.result;

Random Integer

Generates a random integer within a specified range. In this example, a random integer between 1 and 100 is generated.

const pulumi = require('@pulumi/pulumi');
const random = require('@pulumi/random');

const randomInteger = new random.RandomInteger('randomInteger', {
  min: 1,
  max: 100,
});

exports.result = randomInteger.result;

Random Password

Generates a random password of specified length. In this example, a random password of length 20 is generated with special characters included.

const pulumi = require('@pulumi/pulumi');
const random = require('@pulumi/random');

const randomPassword = new random.RandomPassword('randomPassword', {
  length: 20,
  special: true,
});

exports.result = randomPassword.result;

Other packages similar to @pulumi/random

Keywords

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts