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,
});
}
}
Inherited Members
Namespace: Pulumi.Random
Assembly: Pulumi.Random.dll
Syntax
public class RandomString : CustomResource
Constructors
View SourceRandomString(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 SourceKeepers
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>> |
Length
The length of the string desired
Declaration
public Output<int> Length { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
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>> |
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>> |
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>> |
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>> |
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>> |
Number
(default true) Include numeric characters in random string.
Declaration
public Output<bool?> Number { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
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> |
Result
Random string generated.
Declaration
public Output<string> Result { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Special
(default true) Include special characters in random
string. These are !@#$%&*()-_=+[]{}<>:?
Declaration
public Output<bool?> Special { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
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 SourceGet(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 |