Show / Hide Table of Contents

Class RandomString

The resource random..RandomString generates a random permutation of alphanumeric characters and optionally special characters.

This resource does use a cryptographic random number generator.

Historically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id, for sensitive random values please use random_password.

Example Usage

using Pulumi;
using Random = Pulumi.Random;

class MyStack : Stack
{
public MyStack()
{
    var random = new Random.RandomString("random", new Random.RandomStringArgs
    {
        Length = 16,
        OverrideSpecial = "/@£$$",
        Special = true,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
RandomString
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Random
Assembly: Pulumi.Random.dll
Syntax
public class RandomString : CustomResource

Constructors

View Source

RandomString(String, RandomStringArgs, CustomResourceOptions)

Create a RandomString resource with the given unique name, arguments, and options.

Declaration
public RandomString(string name, RandomStringArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

RandomStringArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Keepers

Arbitrary map of values that, when changed, will trigger a new id to be generated. See the main provider documentation for more information.

Declaration
public Output<ImmutableDictionary<string, object>> Keepers { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

Length

The length of the string desired

Declaration
public Output<int> Length { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Lower

(default true) Include lowercase alphabet characters in random string.

Declaration
public Output<bool?> Lower { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

MinLower

(default 0) Minimum number of lowercase alphabet characters in random string.

Declaration
public Output<int?> MinLower { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MinNumeric

(default 0) Minimum number of numeric characters in random string.

Declaration
public Output<int?> MinNumeric { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MinSpecial

(default 0) Minimum number of special characters in random string.

Declaration
public Output<int?> MinSpecial { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MinUpper

(default 0) Minimum number of uppercase alphabet characters in random string.

Declaration
public Output<int?> MinUpper { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Number

(default true) Include numeric characters in random string.

Declaration
public Output<bool?> Number { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

OverrideSpecial

Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The special argument must still be set to true for any overwritten characters to be used in generation.

Declaration
public Output<string> OverrideSpecial { get; }
Property Value
Type Description
Output<System.String>
View Source

Result

Random string generated.

Declaration
public Output<string> Result { get; }
Property Value
Type Description
Output<System.String>
View Source

Special

(default true) Include special characters in random string. These are !@#$%&amp;*()-_=+[]{}&lt;>:?

Declaration
public Output<bool?> Special { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Upper

(default true) Include uppercase alphabet characters in random string.

Declaration
public Output<bool?> Upper { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>

Methods

View Source

Get(String, Input<String>, RandomStringState, CustomResourceOptions)

Get an existing RandomString resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static RandomString Get(string name, Input<string> id, RandomStringState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

RandomStringState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
RandomString
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.