random

package
v4.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 35

Documentation

Overview

A Pulumi package to safely use randomness in Pulumi programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	pulumi.ProviderResourceState
}

The provider type for the random package. By default, resources use package-wide configuration settings, however an explicit `Provider` instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.

func NewProvider

func NewProvider(ctx *pulumi.Context,
	name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error)

NewProvider registers a new resource with the given unique name, arguments, and options.

func (*Provider) ElementType

func (*Provider) ElementType() reflect.Type

func (*Provider) ToProviderOutput

func (i *Provider) ToProviderOutput() ProviderOutput

func (*Provider) ToProviderOutputWithContext

func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type ProviderArgs

type ProviderArgs struct {
}

The set of arguments for constructing a Provider resource.

func (ProviderArgs) ElementType

func (ProviderArgs) ElementType() reflect.Type

type ProviderInput

type ProviderInput interface {
	pulumi.Input

	ToProviderOutput() ProviderOutput
	ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}

type ProviderOutput

type ProviderOutput struct{ *pulumi.OutputState }

func (ProviderOutput) ElementType

func (ProviderOutput) ElementType() reflect.Type

func (ProviderOutput) ToProviderOutput

func (o ProviderOutput) ToProviderOutput() ProviderOutput

func (ProviderOutput) ToProviderOutputWithContext

func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type RandomBytes added in v4.15.0

type RandomBytes struct {
	pulumi.CustomResourceState

	// The generated bytes presented in base64 string format.
	Base64 pulumi.StringOutput `pulumi:"base64"`
	// The generated bytes presented in lowercase hexadecimal string format. The length of the encoded string is exactly twice the `length` parameter.
	Hex pulumi.StringOutput `pulumi:"hex"`
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The number of bytes requested. The minimum value for length is 1.
	Length pulumi.IntOutput `pulumi:"length"`
}

The resource `RandomBytes` generates random bytes that are intended to be used as a secret, or key. Use this in preference to `RandomId` when the output is considered sensitive, and should not be displayed in the CLI.

This resource *does* use a cryptographic random number generator.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		jwtSecretRandomBytes, err := random.NewRandomBytes(ctx, "jwtSecretRandomBytes", &random.RandomBytesArgs{
			Length: pulumi.Int(64),
		})
		if err != nil {
			return err
		}
		_, err = keyvault.NewSecret(ctx, "jwtSecretSecret", &keyvault.SecretArgs{
			KeyVaultId: pulumi.String("some-azure-key-vault-id"),
			Value:      jwtSecretRandomBytes.Base64,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

Random bytes can be imported by specifying the value as base64 string.

```sh $ pulumi import random:index/randomBytes:RandomBytes basic "8/fu3q+2DcgSJ19i0jZ5Cw==" ```

func GetRandomBytes added in v4.15.0

func GetRandomBytes(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomBytesState, opts ...pulumi.ResourceOption) (*RandomBytes, error)

GetRandomBytes gets an existing RandomBytes resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomBytes added in v4.15.0

func NewRandomBytes(ctx *pulumi.Context,
	name string, args *RandomBytesArgs, opts ...pulumi.ResourceOption) (*RandomBytes, error)

NewRandomBytes registers a new resource with the given unique name, arguments, and options.

func (*RandomBytes) ElementType added in v4.15.0

func (*RandomBytes) ElementType() reflect.Type

func (*RandomBytes) ToRandomBytesOutput added in v4.15.0

func (i *RandomBytes) ToRandomBytesOutput() RandomBytesOutput

func (*RandomBytes) ToRandomBytesOutputWithContext added in v4.15.0

func (i *RandomBytes) ToRandomBytesOutputWithContext(ctx context.Context) RandomBytesOutput

type RandomBytesArgs added in v4.15.0

type RandomBytesArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The number of bytes requested. The minimum value for length is 1.
	Length pulumi.IntInput
}

The set of arguments for constructing a RandomBytes resource.

func (RandomBytesArgs) ElementType added in v4.15.0

func (RandomBytesArgs) ElementType() reflect.Type

type RandomBytesArray added in v4.15.0

type RandomBytesArray []RandomBytesInput

func (RandomBytesArray) ElementType added in v4.15.0

func (RandomBytesArray) ElementType() reflect.Type

func (RandomBytesArray) ToRandomBytesArrayOutput added in v4.15.0

func (i RandomBytesArray) ToRandomBytesArrayOutput() RandomBytesArrayOutput

func (RandomBytesArray) ToRandomBytesArrayOutputWithContext added in v4.15.0

func (i RandomBytesArray) ToRandomBytesArrayOutputWithContext(ctx context.Context) RandomBytesArrayOutput

type RandomBytesArrayInput added in v4.15.0

type RandomBytesArrayInput interface {
	pulumi.Input

	ToRandomBytesArrayOutput() RandomBytesArrayOutput
	ToRandomBytesArrayOutputWithContext(context.Context) RandomBytesArrayOutput
}

RandomBytesArrayInput is an input type that accepts RandomBytesArray and RandomBytesArrayOutput values. You can construct a concrete instance of `RandomBytesArrayInput` via:

RandomBytesArray{ RandomBytesArgs{...} }

type RandomBytesArrayOutput added in v4.15.0

type RandomBytesArrayOutput struct{ *pulumi.OutputState }

func (RandomBytesArrayOutput) ElementType added in v4.15.0

func (RandomBytesArrayOutput) ElementType() reflect.Type

func (RandomBytesArrayOutput) Index added in v4.15.0

func (RandomBytesArrayOutput) ToRandomBytesArrayOutput added in v4.15.0

func (o RandomBytesArrayOutput) ToRandomBytesArrayOutput() RandomBytesArrayOutput

func (RandomBytesArrayOutput) ToRandomBytesArrayOutputWithContext added in v4.15.0

func (o RandomBytesArrayOutput) ToRandomBytesArrayOutputWithContext(ctx context.Context) RandomBytesArrayOutput

type RandomBytesInput added in v4.15.0

type RandomBytesInput interface {
	pulumi.Input

	ToRandomBytesOutput() RandomBytesOutput
	ToRandomBytesOutputWithContext(ctx context.Context) RandomBytesOutput
}

type RandomBytesMap added in v4.15.0

type RandomBytesMap map[string]RandomBytesInput

func (RandomBytesMap) ElementType added in v4.15.0

func (RandomBytesMap) ElementType() reflect.Type

func (RandomBytesMap) ToRandomBytesMapOutput added in v4.15.0

func (i RandomBytesMap) ToRandomBytesMapOutput() RandomBytesMapOutput

func (RandomBytesMap) ToRandomBytesMapOutputWithContext added in v4.15.0

func (i RandomBytesMap) ToRandomBytesMapOutputWithContext(ctx context.Context) RandomBytesMapOutput

type RandomBytesMapInput added in v4.15.0

type RandomBytesMapInput interface {
	pulumi.Input

	ToRandomBytesMapOutput() RandomBytesMapOutput
	ToRandomBytesMapOutputWithContext(context.Context) RandomBytesMapOutput
}

RandomBytesMapInput is an input type that accepts RandomBytesMap and RandomBytesMapOutput values. You can construct a concrete instance of `RandomBytesMapInput` via:

RandomBytesMap{ "key": RandomBytesArgs{...} }

type RandomBytesMapOutput added in v4.15.0

type RandomBytesMapOutput struct{ *pulumi.OutputState }

func (RandomBytesMapOutput) ElementType added in v4.15.0

func (RandomBytesMapOutput) ElementType() reflect.Type

func (RandomBytesMapOutput) MapIndex added in v4.15.0

func (RandomBytesMapOutput) ToRandomBytesMapOutput added in v4.15.0

func (o RandomBytesMapOutput) ToRandomBytesMapOutput() RandomBytesMapOutput

func (RandomBytesMapOutput) ToRandomBytesMapOutputWithContext added in v4.15.0

func (o RandomBytesMapOutput) ToRandomBytesMapOutputWithContext(ctx context.Context) RandomBytesMapOutput

type RandomBytesOutput added in v4.15.0

type RandomBytesOutput struct{ *pulumi.OutputState }

func (RandomBytesOutput) Base64 added in v4.15.0

The generated bytes presented in base64 string format.

func (RandomBytesOutput) ElementType added in v4.15.0

func (RandomBytesOutput) ElementType() reflect.Type

func (RandomBytesOutput) Hex added in v4.15.0

The generated bytes presented in lowercase hexadecimal string format. The length of the encoded string is exactly twice the `length` parameter.

func (RandomBytesOutput) Keepers added in v4.15.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomBytesOutput) Length added in v4.15.0

func (o RandomBytesOutput) Length() pulumi.IntOutput

The number of bytes requested. The minimum value for length is 1.

func (RandomBytesOutput) ToRandomBytesOutput added in v4.15.0

func (o RandomBytesOutput) ToRandomBytesOutput() RandomBytesOutput

func (RandomBytesOutput) ToRandomBytesOutputWithContext added in v4.15.0

func (o RandomBytesOutput) ToRandomBytesOutputWithContext(ctx context.Context) RandomBytesOutput

type RandomBytesState added in v4.15.0

type RandomBytesState struct {
	// The generated bytes presented in base64 string format.
	Base64 pulumi.StringPtrInput
	// The generated bytes presented in lowercase hexadecimal string format. The length of the encoded string is exactly twice the `length` parameter.
	Hex pulumi.StringPtrInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The number of bytes requested. The minimum value for length is 1.
	Length pulumi.IntPtrInput
}

func (RandomBytesState) ElementType added in v4.15.0

func (RandomBytesState) ElementType() reflect.Type

type RandomId

type RandomId struct {
	pulumi.CustomResourceState

	// The generated id presented in base64 without additional transformations.
	B64Std pulumi.StringOutput `pulumi:"b64Std"`
	// The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.
	B64Url pulumi.StringOutput `pulumi:"b64Url"`
	// The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
	ByteLength pulumi.IntOutput `pulumi:"byteLength"`
	// The generated id presented in non-padded decimal digits.
	Dec pulumi.StringOutput `pulumi:"dec"`
	// The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.
	Hex pulumi.StringOutput `pulumi:"hex"`
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
	Prefix pulumi.StringPtrOutput `pulumi:"prefix"`
}

The resource `RandomId` generates random numbers that are intended to be used as unique identifiers for other resources. If the output is considered sensitive, and should not be displayed in the CLI, use `RandomBytes` instead.

This resource *does* use a cryptographic random number generator in order to minimize the chance of collisions, making the results of this resource when a 16-byte identifier is requested of equivalent uniqueness to a type-4 UUID.

This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"fmt"

"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// The following example shows how to generate a unique name for an AWS EC2
		// instance that changes each time a new AMI id is selected.
		serverRandomId, err := random.NewRandomId(ctx, "serverRandomId", &random.RandomIdArgs{
			Keepers: pulumi.StringMap{
				"ami_id": pulumi.Any(_var.Ami_id),
			},
			ByteLength: pulumi.Int(8),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewInstance(ctx, "serverInstance", &ec2.InstanceArgs{
			Tags: pulumi.StringMap{
				"Name": serverRandomId.Hex.ApplyT(func(hex string) (string, error) {
					return fmt.Sprintf("web-server %v", hex), nil
				}).(pulumi.StringOutput),
			},
			Ami: serverRandomId.Keepers.ApplyT(func(keepers interface{}) (*string, error) {
				return &keepers.AmiId, nil
			}).(pulumi.StringPtrOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

Random IDs can be imported using the b64_url with an optional prefix. This

can be used to replace a config value with a value interpolated from the

random provider without experiencing diffs.

Example with no prefix:

```sh $ pulumi import random:index/randomId:RandomId server p-9hUg ```

Example with prefix (prefix is separated by a ,):

```sh $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg ```

func GetRandomId

func GetRandomId(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomIdState, opts ...pulumi.ResourceOption) (*RandomId, error)

GetRandomId gets an existing RandomId resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomId

func NewRandomId(ctx *pulumi.Context,
	name string, args *RandomIdArgs, opts ...pulumi.ResourceOption) (*RandomId, error)

NewRandomId registers a new resource with the given unique name, arguments, and options.

func (*RandomId) ElementType

func (*RandomId) ElementType() reflect.Type

func (*RandomId) ToRandomIdOutput

func (i *RandomId) ToRandomIdOutput() RandomIdOutput

func (*RandomId) ToRandomIdOutputWithContext

func (i *RandomId) ToRandomIdOutputWithContext(ctx context.Context) RandomIdOutput

type RandomIdArgs

type RandomIdArgs struct {
	// The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
	ByteLength pulumi.IntInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
	Prefix pulumi.StringPtrInput
}

The set of arguments for constructing a RandomId resource.

func (RandomIdArgs) ElementType

func (RandomIdArgs) ElementType() reflect.Type

type RandomIdArray

type RandomIdArray []RandomIdInput

func (RandomIdArray) ElementType

func (RandomIdArray) ElementType() reflect.Type

func (RandomIdArray) ToRandomIdArrayOutput

func (i RandomIdArray) ToRandomIdArrayOutput() RandomIdArrayOutput

func (RandomIdArray) ToRandomIdArrayOutputWithContext

func (i RandomIdArray) ToRandomIdArrayOutputWithContext(ctx context.Context) RandomIdArrayOutput

type RandomIdArrayInput

type RandomIdArrayInput interface {
	pulumi.Input

	ToRandomIdArrayOutput() RandomIdArrayOutput
	ToRandomIdArrayOutputWithContext(context.Context) RandomIdArrayOutput
}

RandomIdArrayInput is an input type that accepts RandomIdArray and RandomIdArrayOutput values. You can construct a concrete instance of `RandomIdArrayInput` via:

RandomIdArray{ RandomIdArgs{...} }

type RandomIdArrayOutput

type RandomIdArrayOutput struct{ *pulumi.OutputState }

func (RandomIdArrayOutput) ElementType

func (RandomIdArrayOutput) ElementType() reflect.Type

func (RandomIdArrayOutput) Index

func (RandomIdArrayOutput) ToRandomIdArrayOutput

func (o RandomIdArrayOutput) ToRandomIdArrayOutput() RandomIdArrayOutput

func (RandomIdArrayOutput) ToRandomIdArrayOutputWithContext

func (o RandomIdArrayOutput) ToRandomIdArrayOutputWithContext(ctx context.Context) RandomIdArrayOutput

type RandomIdInput

type RandomIdInput interface {
	pulumi.Input

	ToRandomIdOutput() RandomIdOutput
	ToRandomIdOutputWithContext(ctx context.Context) RandomIdOutput
}

type RandomIdMap

type RandomIdMap map[string]RandomIdInput

func (RandomIdMap) ElementType

func (RandomIdMap) ElementType() reflect.Type

func (RandomIdMap) ToRandomIdMapOutput

func (i RandomIdMap) ToRandomIdMapOutput() RandomIdMapOutput

func (RandomIdMap) ToRandomIdMapOutputWithContext

func (i RandomIdMap) ToRandomIdMapOutputWithContext(ctx context.Context) RandomIdMapOutput

type RandomIdMapInput

type RandomIdMapInput interface {
	pulumi.Input

	ToRandomIdMapOutput() RandomIdMapOutput
	ToRandomIdMapOutputWithContext(context.Context) RandomIdMapOutput
}

RandomIdMapInput is an input type that accepts RandomIdMap and RandomIdMapOutput values. You can construct a concrete instance of `RandomIdMapInput` via:

RandomIdMap{ "key": RandomIdArgs{...} }

type RandomIdMapOutput

type RandomIdMapOutput struct{ *pulumi.OutputState }

func (RandomIdMapOutput) ElementType

func (RandomIdMapOutput) ElementType() reflect.Type

func (RandomIdMapOutput) MapIndex

func (RandomIdMapOutput) ToRandomIdMapOutput

func (o RandomIdMapOutput) ToRandomIdMapOutput() RandomIdMapOutput

func (RandomIdMapOutput) ToRandomIdMapOutputWithContext

func (o RandomIdMapOutput) ToRandomIdMapOutputWithContext(ctx context.Context) RandomIdMapOutput

type RandomIdOutput

type RandomIdOutput struct{ *pulumi.OutputState }

func (RandomIdOutput) B64Std added in v4.6.0

func (o RandomIdOutput) B64Std() pulumi.StringOutput

The generated id presented in base64 without additional transformations.

func (RandomIdOutput) B64Url added in v4.6.0

func (o RandomIdOutput) B64Url() pulumi.StringOutput

The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.

func (RandomIdOutput) ByteLength added in v4.6.0

func (o RandomIdOutput) ByteLength() pulumi.IntOutput

The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.

func (RandomIdOutput) Dec added in v4.6.0

The generated id presented in non-padded decimal digits.

func (RandomIdOutput) ElementType

func (RandomIdOutput) ElementType() reflect.Type

func (RandomIdOutput) Hex added in v4.6.0

The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.

func (RandomIdOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomIdOutput) Prefix added in v4.6.0

Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.

func (RandomIdOutput) ToRandomIdOutput

func (o RandomIdOutput) ToRandomIdOutput() RandomIdOutput

func (RandomIdOutput) ToRandomIdOutputWithContext

func (o RandomIdOutput) ToRandomIdOutputWithContext(ctx context.Context) RandomIdOutput

type RandomIdState

type RandomIdState struct {
	// The generated id presented in base64 without additional transformations.
	B64Std pulumi.StringPtrInput
	// The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.
	B64Url pulumi.StringPtrInput
	// The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
	ByteLength pulumi.IntPtrInput
	// The generated id presented in non-padded decimal digits.
	Dec pulumi.StringPtrInput
	// The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.
	Hex pulumi.StringPtrInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.
	Prefix pulumi.StringPtrInput
}

func (RandomIdState) ElementType

func (RandomIdState) ElementType() reflect.Type

type RandomInteger

type RandomInteger struct {
	pulumi.CustomResourceState

	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The maximum inclusive value of the range.
	Max pulumi.IntOutput `pulumi:"max"`
	// The minimum inclusive value of the range.
	Min pulumi.IntOutput `pulumi:"min"`
	// The random integer result.
	Result pulumi.IntOutput `pulumi:"result"`
	// A custom seed to always produce the same value.
	Seed pulumi.StringPtrOutput `pulumi:"seed"`
}

The resource `RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.

This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/alb"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// The following example shows how to generate a random priority
		// between 1 and 50000 for a aws_alb_listener_rule resource:
		priority, err := random.NewRandomInteger(ctx, "priority", &random.RandomIntegerArgs{
			Min: pulumi.Int(1),
			Max: pulumi.Int(50000),
			Keepers: pulumi.StringMap{
				"listener_arn": pulumi.Any(_var.Listener_arn),
			},
		})
		if err != nil {
			return err
		}
		_, err = alb.NewListenerRule(ctx, "main", &alb.ListenerRuleArgs{
			ListenerArn: priority.Keepers.ApplyT(func(keepers interface{}) (*string, error) {
				return &keepers.ListenerArn, nil
			}).(pulumi.StringPtrOutput),
			Priority: priority.Result,
			Actions: alb.ListenerRuleActionArray{
				&alb.ListenerRuleActionArgs{
					Type:           pulumi.String("forward"),
					TargetGroupArn: pulumi.Any(_var.Target_group_arn),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

Random integers can be imported using the result, min, and max, with an

optional seed. This can be used to replace a config value with a value

interpolated from the random provider without experiencing diffs.

Example (values are separated by a ,):

```sh $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000 ```

func GetRandomInteger

func GetRandomInteger(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomIntegerState, opts ...pulumi.ResourceOption) (*RandomInteger, error)

GetRandomInteger gets an existing RandomInteger resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomInteger

func NewRandomInteger(ctx *pulumi.Context,
	name string, args *RandomIntegerArgs, opts ...pulumi.ResourceOption) (*RandomInteger, error)

NewRandomInteger registers a new resource with the given unique name, arguments, and options.

func (*RandomInteger) ElementType

func (*RandomInteger) ElementType() reflect.Type

func (*RandomInteger) ToRandomIntegerOutput

func (i *RandomInteger) ToRandomIntegerOutput() RandomIntegerOutput

func (*RandomInteger) ToRandomIntegerOutputWithContext

func (i *RandomInteger) ToRandomIntegerOutputWithContext(ctx context.Context) RandomIntegerOutput

type RandomIntegerArgs

type RandomIntegerArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The maximum inclusive value of the range.
	Max pulumi.IntInput
	// The minimum inclusive value of the range.
	Min pulumi.IntInput
	// A custom seed to always produce the same value.
	Seed pulumi.StringPtrInput
}

The set of arguments for constructing a RandomInteger resource.

func (RandomIntegerArgs) ElementType

func (RandomIntegerArgs) ElementType() reflect.Type

type RandomIntegerArray

type RandomIntegerArray []RandomIntegerInput

func (RandomIntegerArray) ElementType

func (RandomIntegerArray) ElementType() reflect.Type

func (RandomIntegerArray) ToRandomIntegerArrayOutput

func (i RandomIntegerArray) ToRandomIntegerArrayOutput() RandomIntegerArrayOutput

func (RandomIntegerArray) ToRandomIntegerArrayOutputWithContext

func (i RandomIntegerArray) ToRandomIntegerArrayOutputWithContext(ctx context.Context) RandomIntegerArrayOutput

type RandomIntegerArrayInput

type RandomIntegerArrayInput interface {
	pulumi.Input

	ToRandomIntegerArrayOutput() RandomIntegerArrayOutput
	ToRandomIntegerArrayOutputWithContext(context.Context) RandomIntegerArrayOutput
}

RandomIntegerArrayInput is an input type that accepts RandomIntegerArray and RandomIntegerArrayOutput values. You can construct a concrete instance of `RandomIntegerArrayInput` via:

RandomIntegerArray{ RandomIntegerArgs{...} }

type RandomIntegerArrayOutput

type RandomIntegerArrayOutput struct{ *pulumi.OutputState }

func (RandomIntegerArrayOutput) ElementType

func (RandomIntegerArrayOutput) ElementType() reflect.Type

func (RandomIntegerArrayOutput) Index

func (RandomIntegerArrayOutput) ToRandomIntegerArrayOutput

func (o RandomIntegerArrayOutput) ToRandomIntegerArrayOutput() RandomIntegerArrayOutput

func (RandomIntegerArrayOutput) ToRandomIntegerArrayOutputWithContext

func (o RandomIntegerArrayOutput) ToRandomIntegerArrayOutputWithContext(ctx context.Context) RandomIntegerArrayOutput

type RandomIntegerInput

type RandomIntegerInput interface {
	pulumi.Input

	ToRandomIntegerOutput() RandomIntegerOutput
	ToRandomIntegerOutputWithContext(ctx context.Context) RandomIntegerOutput
}

type RandomIntegerMap

type RandomIntegerMap map[string]RandomIntegerInput

func (RandomIntegerMap) ElementType

func (RandomIntegerMap) ElementType() reflect.Type

func (RandomIntegerMap) ToRandomIntegerMapOutput

func (i RandomIntegerMap) ToRandomIntegerMapOutput() RandomIntegerMapOutput

func (RandomIntegerMap) ToRandomIntegerMapOutputWithContext

func (i RandomIntegerMap) ToRandomIntegerMapOutputWithContext(ctx context.Context) RandomIntegerMapOutput

type RandomIntegerMapInput

type RandomIntegerMapInput interface {
	pulumi.Input

	ToRandomIntegerMapOutput() RandomIntegerMapOutput
	ToRandomIntegerMapOutputWithContext(context.Context) RandomIntegerMapOutput
}

RandomIntegerMapInput is an input type that accepts RandomIntegerMap and RandomIntegerMapOutput values. You can construct a concrete instance of `RandomIntegerMapInput` via:

RandomIntegerMap{ "key": RandomIntegerArgs{...} }

type RandomIntegerMapOutput

type RandomIntegerMapOutput struct{ *pulumi.OutputState }

func (RandomIntegerMapOutput) ElementType

func (RandomIntegerMapOutput) ElementType() reflect.Type

func (RandomIntegerMapOutput) MapIndex

func (RandomIntegerMapOutput) ToRandomIntegerMapOutput

func (o RandomIntegerMapOutput) ToRandomIntegerMapOutput() RandomIntegerMapOutput

func (RandomIntegerMapOutput) ToRandomIntegerMapOutputWithContext

func (o RandomIntegerMapOutput) ToRandomIntegerMapOutputWithContext(ctx context.Context) RandomIntegerMapOutput

type RandomIntegerOutput

type RandomIntegerOutput struct{ *pulumi.OutputState }

func (RandomIntegerOutput) ElementType

func (RandomIntegerOutput) ElementType() reflect.Type

func (RandomIntegerOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomIntegerOutput) Max added in v4.6.0

The maximum inclusive value of the range.

func (RandomIntegerOutput) Min added in v4.6.0

The minimum inclusive value of the range.

func (RandomIntegerOutput) Result added in v4.6.0

The random integer result.

func (RandomIntegerOutput) Seed added in v4.6.0

A custom seed to always produce the same value.

func (RandomIntegerOutput) ToRandomIntegerOutput

func (o RandomIntegerOutput) ToRandomIntegerOutput() RandomIntegerOutput

func (RandomIntegerOutput) ToRandomIntegerOutputWithContext

func (o RandomIntegerOutput) ToRandomIntegerOutputWithContext(ctx context.Context) RandomIntegerOutput

type RandomIntegerState

type RandomIntegerState struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The maximum inclusive value of the range.
	Max pulumi.IntPtrInput
	// The minimum inclusive value of the range.
	Min pulumi.IntPtrInput
	// The random integer result.
	Result pulumi.IntPtrInput
	// A custom seed to always produce the same value.
	Seed pulumi.StringPtrInput
}

func (RandomIntegerState) ElementType

func (RandomIntegerState) ElementType() reflect.Type

type RandomPassword

type RandomPassword struct {
	pulumi.CustomResourceState

	// A bcrypt hash of the generated random string. **NOTE**: If the generated random string is greater than 72 bytes in length, `bcryptHash` will contain a hash of the first 72 bytes.
	BcryptHash pulumi.StringOutput `pulumi:"bcryptHash"`
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntOutput `pulumi:"length"`
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolOutput `pulumi:"lower"`
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntOutput `pulumi:"minLower"`
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntOutput `pulumi:"minNumeric"`
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntOutput `pulumi:"minSpecial"`
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntOutput `pulumi:"minUpper"`
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolOutput `pulumi:"number"`
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolOutput `pulumi:"numeric"`
	// 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.
	OverrideSpecial pulumi.StringPtrOutput `pulumi:"overrideSpecial"`
	// The generated random string.
	Result pulumi.StringOutput `pulumi:"result"`
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolOutput `pulumi:"special"`
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolOutput `pulumi:"upper"`
}

Identical to random_string.

This resource *does* use a cryptographic random number generator.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/rds"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		password, err := random.NewRandomPassword(ctx, "password", &random.RandomPasswordArgs{
			Length:          pulumi.Int(16),
			Special:         pulumi.Bool(true),
			OverrideSpecial: pulumi.String("!#$%&*()-_=+[]{}<>:?"),
		})
		if err != nil {
			return err
		}
		_, err = rds.NewInstance(ctx, "example", &rds.InstanceArgs{
			InstanceClass:    pulumi.String(rds.InstanceType_T3_Micro),
			AllocatedStorage: pulumi.Int(64),
			Engine:           pulumi.String("mysql"),
			Username:         pulumi.String("someone"),
			Password:         password.Result,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

You can import external passwords into your Pulumi programs as follows:

func GetRandomPassword

func GetRandomPassword(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomPasswordState, opts ...pulumi.ResourceOption) (*RandomPassword, error)

GetRandomPassword gets an existing RandomPassword resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomPassword

func NewRandomPassword(ctx *pulumi.Context,
	name string, args *RandomPasswordArgs, opts ...pulumi.ResourceOption) (*RandomPassword, error)

NewRandomPassword registers a new resource with the given unique name, arguments, and options.

func (*RandomPassword) ElementType

func (*RandomPassword) ElementType() reflect.Type

func (*RandomPassword) ToRandomPasswordOutput

func (i *RandomPassword) ToRandomPasswordOutput() RandomPasswordOutput

func (*RandomPassword) ToRandomPasswordOutputWithContext

func (i *RandomPassword) ToRandomPasswordOutputWithContext(ctx context.Context) RandomPasswordOutput

type RandomPasswordArgs

type RandomPasswordArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntInput
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolPtrInput
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntPtrInput
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntPtrInput
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntPtrInput
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntPtrInput
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolPtrInput
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolPtrInput
	// 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.
	OverrideSpecial pulumi.StringPtrInput
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolPtrInput
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolPtrInput
}

The set of arguments for constructing a RandomPassword resource.

func (RandomPasswordArgs) ElementType

func (RandomPasswordArgs) ElementType() reflect.Type

type RandomPasswordArray

type RandomPasswordArray []RandomPasswordInput

func (RandomPasswordArray) ElementType

func (RandomPasswordArray) ElementType() reflect.Type

func (RandomPasswordArray) ToRandomPasswordArrayOutput

func (i RandomPasswordArray) ToRandomPasswordArrayOutput() RandomPasswordArrayOutput

func (RandomPasswordArray) ToRandomPasswordArrayOutputWithContext

func (i RandomPasswordArray) ToRandomPasswordArrayOutputWithContext(ctx context.Context) RandomPasswordArrayOutput

type RandomPasswordArrayInput

type RandomPasswordArrayInput interface {
	pulumi.Input

	ToRandomPasswordArrayOutput() RandomPasswordArrayOutput
	ToRandomPasswordArrayOutputWithContext(context.Context) RandomPasswordArrayOutput
}

RandomPasswordArrayInput is an input type that accepts RandomPasswordArray and RandomPasswordArrayOutput values. You can construct a concrete instance of `RandomPasswordArrayInput` via:

RandomPasswordArray{ RandomPasswordArgs{...} }

type RandomPasswordArrayOutput

type RandomPasswordArrayOutput struct{ *pulumi.OutputState }

func (RandomPasswordArrayOutput) ElementType

func (RandomPasswordArrayOutput) ElementType() reflect.Type

func (RandomPasswordArrayOutput) Index

func (RandomPasswordArrayOutput) ToRandomPasswordArrayOutput

func (o RandomPasswordArrayOutput) ToRandomPasswordArrayOutput() RandomPasswordArrayOutput

func (RandomPasswordArrayOutput) ToRandomPasswordArrayOutputWithContext

func (o RandomPasswordArrayOutput) ToRandomPasswordArrayOutputWithContext(ctx context.Context) RandomPasswordArrayOutput

type RandomPasswordInput

type RandomPasswordInput interface {
	pulumi.Input

	ToRandomPasswordOutput() RandomPasswordOutput
	ToRandomPasswordOutputWithContext(ctx context.Context) RandomPasswordOutput
}

type RandomPasswordMap

type RandomPasswordMap map[string]RandomPasswordInput

func (RandomPasswordMap) ElementType

func (RandomPasswordMap) ElementType() reflect.Type

func (RandomPasswordMap) ToRandomPasswordMapOutput

func (i RandomPasswordMap) ToRandomPasswordMapOutput() RandomPasswordMapOutput

func (RandomPasswordMap) ToRandomPasswordMapOutputWithContext

func (i RandomPasswordMap) ToRandomPasswordMapOutputWithContext(ctx context.Context) RandomPasswordMapOutput

type RandomPasswordMapInput

type RandomPasswordMapInput interface {
	pulumi.Input

	ToRandomPasswordMapOutput() RandomPasswordMapOutput
	ToRandomPasswordMapOutputWithContext(context.Context) RandomPasswordMapOutput
}

RandomPasswordMapInput is an input type that accepts RandomPasswordMap and RandomPasswordMapOutput values. You can construct a concrete instance of `RandomPasswordMapInput` via:

RandomPasswordMap{ "key": RandomPasswordArgs{...} }

type RandomPasswordMapOutput

type RandomPasswordMapOutput struct{ *pulumi.OutputState }

func (RandomPasswordMapOutput) ElementType

func (RandomPasswordMapOutput) ElementType() reflect.Type

func (RandomPasswordMapOutput) MapIndex

func (RandomPasswordMapOutput) ToRandomPasswordMapOutput

func (o RandomPasswordMapOutput) ToRandomPasswordMapOutput() RandomPasswordMapOutput

func (RandomPasswordMapOutput) ToRandomPasswordMapOutputWithContext

func (o RandomPasswordMapOutput) ToRandomPasswordMapOutputWithContext(ctx context.Context) RandomPasswordMapOutput

type RandomPasswordOutput

type RandomPasswordOutput struct{ *pulumi.OutputState }

func (RandomPasswordOutput) BcryptHash added in v4.7.0

func (o RandomPasswordOutput) BcryptHash() pulumi.StringOutput

A bcrypt hash of the generated random string. **NOTE**: If the generated random string is greater than 72 bytes in length, `bcryptHash` will contain a hash of the first 72 bytes.

func (RandomPasswordOutput) ElementType

func (RandomPasswordOutput) ElementType() reflect.Type

func (RandomPasswordOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomPasswordOutput) Length added in v4.6.0

The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).

func (RandomPasswordOutput) Lower added in v4.6.0

Include lowercase alphabet characters in the result. Default value is `true`.

func (RandomPasswordOutput) MinLower added in v4.6.0

func (o RandomPasswordOutput) MinLower() pulumi.IntOutput

Minimum number of lowercase alphabet characters in the result. Default value is `0`.

func (RandomPasswordOutput) MinNumeric added in v4.6.0

func (o RandomPasswordOutput) MinNumeric() pulumi.IntOutput

Minimum number of numeric characters in the result. Default value is `0`.

func (RandomPasswordOutput) MinSpecial added in v4.6.0

func (o RandomPasswordOutput) MinSpecial() pulumi.IntOutput

Minimum number of special characters in the result. Default value is `0`.

func (RandomPasswordOutput) MinUpper added in v4.6.0

func (o RandomPasswordOutput) MinUpper() pulumi.IntOutput

Minimum number of uppercase alphabet characters in the result. Default value is `0`.

func (RandomPasswordOutput) Number deprecated added in v4.6.0

Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.

Deprecated: **NOTE**: This is deprecated, use `numeric` instead.

func (RandomPasswordOutput) Numeric added in v4.9.0

Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.

func (RandomPasswordOutput) OverrideSpecial added in v4.6.0

func (o RandomPasswordOutput) OverrideSpecial() pulumi.StringPtrOutput

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.

func (RandomPasswordOutput) Result added in v4.6.0

The generated random string.

func (RandomPasswordOutput) Special added in v4.6.0

Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.

func (RandomPasswordOutput) ToRandomPasswordOutput

func (o RandomPasswordOutput) ToRandomPasswordOutput() RandomPasswordOutput

func (RandomPasswordOutput) ToRandomPasswordOutputWithContext

func (o RandomPasswordOutput) ToRandomPasswordOutputWithContext(ctx context.Context) RandomPasswordOutput

func (RandomPasswordOutput) Upper added in v4.6.0

Include uppercase alphabet characters in the result. Default value is `true`.

type RandomPasswordState

type RandomPasswordState struct {
	// A bcrypt hash of the generated random string. **NOTE**: If the generated random string is greater than 72 bytes in length, `bcryptHash` will contain a hash of the first 72 bytes.
	BcryptHash pulumi.StringPtrInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntPtrInput
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolPtrInput
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntPtrInput
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntPtrInput
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntPtrInput
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntPtrInput
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolPtrInput
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolPtrInput
	// 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.
	OverrideSpecial pulumi.StringPtrInput
	// The generated random string.
	Result pulumi.StringPtrInput
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolPtrInput
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolPtrInput
}

func (RandomPasswordState) ElementType

func (RandomPasswordState) ElementType() reflect.Type

type RandomPet

type RandomPet struct {
	pulumi.CustomResourceState

	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The length (in words) of the pet name. Defaults to 2
	Length pulumi.IntOutput `pulumi:"length"`
	// A string to prefix the name with.
	Prefix pulumi.StringPtrOutput `pulumi:"prefix"`
	// The character to separate words in the pet name. Defaults to "-"
	Separator pulumi.StringOutput `pulumi:"separator"`
}

The resource `RandomPet` generates random pet names that are intended to be used as unique identifiers for other resources.

This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"fmt"

"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// The following example shows how to generate a unique pet name
		// for an AWS EC2 instance that changes each time a new AMI id is
		// selected.
		serverRandomPet, err := random.NewRandomPet(ctx, "serverRandomPet", &random.RandomPetArgs{
			Keepers: pulumi.StringMap{
				"ami_id": pulumi.Any(_var.Ami_id),
			},
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewInstance(ctx, "serverInstance", &ec2.InstanceArgs{
			Tags: pulumi.StringMap{
				"Name": serverRandomPet.ID().ApplyT(func(id string) (string, error) {
					return fmt.Sprintf("web-server-%v", id), nil
				}).(pulumi.StringOutput),
			},
			Ami: serverRandomPet.Keepers.ApplyT(func(keepers interface{}) (*string, error) {
				return &keepers.AmiId, nil
			}).(pulumi.StringPtrOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

func GetRandomPet

func GetRandomPet(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomPetState, opts ...pulumi.ResourceOption) (*RandomPet, error)

GetRandomPet gets an existing RandomPet resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomPet

func NewRandomPet(ctx *pulumi.Context,
	name string, args *RandomPetArgs, opts ...pulumi.ResourceOption) (*RandomPet, error)

NewRandomPet registers a new resource with the given unique name, arguments, and options.

func (*RandomPet) ElementType

func (*RandomPet) ElementType() reflect.Type

func (*RandomPet) ToRandomPetOutput

func (i *RandomPet) ToRandomPetOutput() RandomPetOutput

func (*RandomPet) ToRandomPetOutputWithContext

func (i *RandomPet) ToRandomPetOutputWithContext(ctx context.Context) RandomPetOutput

type RandomPetArgs

type RandomPetArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length (in words) of the pet name. Defaults to 2
	Length pulumi.IntPtrInput
	// A string to prefix the name with.
	Prefix pulumi.StringPtrInput
	// The character to separate words in the pet name. Defaults to "-"
	Separator pulumi.StringPtrInput
}

The set of arguments for constructing a RandomPet resource.

func (RandomPetArgs) ElementType

func (RandomPetArgs) ElementType() reflect.Type

type RandomPetArray

type RandomPetArray []RandomPetInput

func (RandomPetArray) ElementType

func (RandomPetArray) ElementType() reflect.Type

func (RandomPetArray) ToRandomPetArrayOutput

func (i RandomPetArray) ToRandomPetArrayOutput() RandomPetArrayOutput

func (RandomPetArray) ToRandomPetArrayOutputWithContext

func (i RandomPetArray) ToRandomPetArrayOutputWithContext(ctx context.Context) RandomPetArrayOutput

type RandomPetArrayInput

type RandomPetArrayInput interface {
	pulumi.Input

	ToRandomPetArrayOutput() RandomPetArrayOutput
	ToRandomPetArrayOutputWithContext(context.Context) RandomPetArrayOutput
}

RandomPetArrayInput is an input type that accepts RandomPetArray and RandomPetArrayOutput values. You can construct a concrete instance of `RandomPetArrayInput` via:

RandomPetArray{ RandomPetArgs{...} }

type RandomPetArrayOutput

type RandomPetArrayOutput struct{ *pulumi.OutputState }

func (RandomPetArrayOutput) ElementType

func (RandomPetArrayOutput) ElementType() reflect.Type

func (RandomPetArrayOutput) Index

func (RandomPetArrayOutput) ToRandomPetArrayOutput

func (o RandomPetArrayOutput) ToRandomPetArrayOutput() RandomPetArrayOutput

func (RandomPetArrayOutput) ToRandomPetArrayOutputWithContext

func (o RandomPetArrayOutput) ToRandomPetArrayOutputWithContext(ctx context.Context) RandomPetArrayOutput

type RandomPetInput

type RandomPetInput interface {
	pulumi.Input

	ToRandomPetOutput() RandomPetOutput
	ToRandomPetOutputWithContext(ctx context.Context) RandomPetOutput
}

type RandomPetMap

type RandomPetMap map[string]RandomPetInput

func (RandomPetMap) ElementType

func (RandomPetMap) ElementType() reflect.Type

func (RandomPetMap) ToRandomPetMapOutput

func (i RandomPetMap) ToRandomPetMapOutput() RandomPetMapOutput

func (RandomPetMap) ToRandomPetMapOutputWithContext

func (i RandomPetMap) ToRandomPetMapOutputWithContext(ctx context.Context) RandomPetMapOutput

type RandomPetMapInput

type RandomPetMapInput interface {
	pulumi.Input

	ToRandomPetMapOutput() RandomPetMapOutput
	ToRandomPetMapOutputWithContext(context.Context) RandomPetMapOutput
}

RandomPetMapInput is an input type that accepts RandomPetMap and RandomPetMapOutput values. You can construct a concrete instance of `RandomPetMapInput` via:

RandomPetMap{ "key": RandomPetArgs{...} }

type RandomPetMapOutput

type RandomPetMapOutput struct{ *pulumi.OutputState }

func (RandomPetMapOutput) ElementType

func (RandomPetMapOutput) ElementType() reflect.Type

func (RandomPetMapOutput) MapIndex

func (RandomPetMapOutput) ToRandomPetMapOutput

func (o RandomPetMapOutput) ToRandomPetMapOutput() RandomPetMapOutput

func (RandomPetMapOutput) ToRandomPetMapOutputWithContext

func (o RandomPetMapOutput) ToRandomPetMapOutputWithContext(ctx context.Context) RandomPetMapOutput

type RandomPetOutput

type RandomPetOutput struct{ *pulumi.OutputState }

func (RandomPetOutput) ElementType

func (RandomPetOutput) ElementType() reflect.Type

func (RandomPetOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomPetOutput) Length added in v4.6.0

func (o RandomPetOutput) Length() pulumi.IntOutput

The length (in words) of the pet name. Defaults to 2

func (RandomPetOutput) Prefix added in v4.6.0

A string to prefix the name with.

func (RandomPetOutput) Separator added in v4.6.0

func (o RandomPetOutput) Separator() pulumi.StringOutput

The character to separate words in the pet name. Defaults to "-"

func (RandomPetOutput) ToRandomPetOutput

func (o RandomPetOutput) ToRandomPetOutput() RandomPetOutput

func (RandomPetOutput) ToRandomPetOutputWithContext

func (o RandomPetOutput) ToRandomPetOutputWithContext(ctx context.Context) RandomPetOutput

type RandomPetState

type RandomPetState struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length (in words) of the pet name. Defaults to 2
	Length pulumi.IntPtrInput
	// A string to prefix the name with.
	Prefix pulumi.StringPtrInput
	// The character to separate words in the pet name. Defaults to "-"
	Separator pulumi.StringPtrInput
}

func (RandomPetState) ElementType

func (RandomPetState) ElementType() reflect.Type

type RandomShuffle

type RandomShuffle struct {
	pulumi.CustomResourceState

	// The list of strings to shuffle.
	Inputs pulumi.StringArrayOutput `pulumi:"inputs"`
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.
	ResultCount pulumi.IntPtrOutput `pulumi:"resultCount"`
	// Random permutation of the list of strings given in `input`. The number of elements is determined by `result_count` if
	// set, or the number of elements in `input`.
	Results pulumi.StringArrayOutput `pulumi:"results"`
	// Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.
	Seed pulumi.StringPtrOutput `pulumi:"seed"`
}

The resource `RandomShuffle` generates a random permutation of a list of strings given as an argument.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/elb"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		az, err := random.NewRandomShuffle(ctx, "az", &random.RandomShuffleArgs{
			Inputs: pulumi.StringArray{
				pulumi.String("us-west-1a"),
				pulumi.String("us-west-1c"),
				pulumi.String("us-west-1d"),
				pulumi.String("us-west-1e"),
			},
			ResultCount: pulumi.Int(2),
		})
		if err != nil {
			return err
		}
		_, err = elb.NewLoadBalancer(ctx, "example", &elb.LoadBalancerArgs{
			AvailabilityZones: az.Results,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

func GetRandomShuffle

func GetRandomShuffle(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomShuffleState, opts ...pulumi.ResourceOption) (*RandomShuffle, error)

GetRandomShuffle gets an existing RandomShuffle resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomShuffle

func NewRandomShuffle(ctx *pulumi.Context,
	name string, args *RandomShuffleArgs, opts ...pulumi.ResourceOption) (*RandomShuffle, error)

NewRandomShuffle registers a new resource with the given unique name, arguments, and options.

func (*RandomShuffle) ElementType

func (*RandomShuffle) ElementType() reflect.Type

func (*RandomShuffle) ToRandomShuffleOutput

func (i *RandomShuffle) ToRandomShuffleOutput() RandomShuffleOutput

func (*RandomShuffle) ToRandomShuffleOutputWithContext

func (i *RandomShuffle) ToRandomShuffleOutputWithContext(ctx context.Context) RandomShuffleOutput

type RandomShuffleArgs

type RandomShuffleArgs struct {
	// The list of strings to shuffle.
	Inputs pulumi.StringArrayInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.
	ResultCount pulumi.IntPtrInput
	// Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.
	Seed pulumi.StringPtrInput
}

The set of arguments for constructing a RandomShuffle resource.

func (RandomShuffleArgs) ElementType

func (RandomShuffleArgs) ElementType() reflect.Type

type RandomShuffleArray

type RandomShuffleArray []RandomShuffleInput

func (RandomShuffleArray) ElementType

func (RandomShuffleArray) ElementType() reflect.Type

func (RandomShuffleArray) ToRandomShuffleArrayOutput

func (i RandomShuffleArray) ToRandomShuffleArrayOutput() RandomShuffleArrayOutput

func (RandomShuffleArray) ToRandomShuffleArrayOutputWithContext

func (i RandomShuffleArray) ToRandomShuffleArrayOutputWithContext(ctx context.Context) RandomShuffleArrayOutput

type RandomShuffleArrayInput

type RandomShuffleArrayInput interface {
	pulumi.Input

	ToRandomShuffleArrayOutput() RandomShuffleArrayOutput
	ToRandomShuffleArrayOutputWithContext(context.Context) RandomShuffleArrayOutput
}

RandomShuffleArrayInput is an input type that accepts RandomShuffleArray and RandomShuffleArrayOutput values. You can construct a concrete instance of `RandomShuffleArrayInput` via:

RandomShuffleArray{ RandomShuffleArgs{...} }

type RandomShuffleArrayOutput

type RandomShuffleArrayOutput struct{ *pulumi.OutputState }

func (RandomShuffleArrayOutput) ElementType

func (RandomShuffleArrayOutput) ElementType() reflect.Type

func (RandomShuffleArrayOutput) Index

func (RandomShuffleArrayOutput) ToRandomShuffleArrayOutput

func (o RandomShuffleArrayOutput) ToRandomShuffleArrayOutput() RandomShuffleArrayOutput

func (RandomShuffleArrayOutput) ToRandomShuffleArrayOutputWithContext

func (o RandomShuffleArrayOutput) ToRandomShuffleArrayOutputWithContext(ctx context.Context) RandomShuffleArrayOutput

type RandomShuffleInput

type RandomShuffleInput interface {
	pulumi.Input

	ToRandomShuffleOutput() RandomShuffleOutput
	ToRandomShuffleOutputWithContext(ctx context.Context) RandomShuffleOutput
}

type RandomShuffleMap

type RandomShuffleMap map[string]RandomShuffleInput

func (RandomShuffleMap) ElementType

func (RandomShuffleMap) ElementType() reflect.Type

func (RandomShuffleMap) ToRandomShuffleMapOutput

func (i RandomShuffleMap) ToRandomShuffleMapOutput() RandomShuffleMapOutput

func (RandomShuffleMap) ToRandomShuffleMapOutputWithContext

func (i RandomShuffleMap) ToRandomShuffleMapOutputWithContext(ctx context.Context) RandomShuffleMapOutput

type RandomShuffleMapInput

type RandomShuffleMapInput interface {
	pulumi.Input

	ToRandomShuffleMapOutput() RandomShuffleMapOutput
	ToRandomShuffleMapOutputWithContext(context.Context) RandomShuffleMapOutput
}

RandomShuffleMapInput is an input type that accepts RandomShuffleMap and RandomShuffleMapOutput values. You can construct a concrete instance of `RandomShuffleMapInput` via:

RandomShuffleMap{ "key": RandomShuffleArgs{...} }

type RandomShuffleMapOutput

type RandomShuffleMapOutput struct{ *pulumi.OutputState }

func (RandomShuffleMapOutput) ElementType

func (RandomShuffleMapOutput) ElementType() reflect.Type

func (RandomShuffleMapOutput) MapIndex

func (RandomShuffleMapOutput) ToRandomShuffleMapOutput

func (o RandomShuffleMapOutput) ToRandomShuffleMapOutput() RandomShuffleMapOutput

func (RandomShuffleMapOutput) ToRandomShuffleMapOutputWithContext

func (o RandomShuffleMapOutput) ToRandomShuffleMapOutputWithContext(ctx context.Context) RandomShuffleMapOutput

type RandomShuffleOutput

type RandomShuffleOutput struct{ *pulumi.OutputState }

func (RandomShuffleOutput) ElementType

func (RandomShuffleOutput) ElementType() reflect.Type

func (RandomShuffleOutput) Inputs added in v4.6.0

The list of strings to shuffle.

func (RandomShuffleOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomShuffleOutput) ResultCount added in v4.6.0

func (o RandomShuffleOutput) ResultCount() pulumi.IntPtrOutput

The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.

func (RandomShuffleOutput) Results added in v4.6.0

Random permutation of the list of strings given in `input`. The number of elements is determined by `result_count` if set, or the number of elements in `input`.

func (RandomShuffleOutput) Seed added in v4.6.0

Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.

func (RandomShuffleOutput) ToRandomShuffleOutput

func (o RandomShuffleOutput) ToRandomShuffleOutput() RandomShuffleOutput

func (RandomShuffleOutput) ToRandomShuffleOutputWithContext

func (o RandomShuffleOutput) ToRandomShuffleOutputWithContext(ctx context.Context) RandomShuffleOutput

type RandomShuffleState

type RandomShuffleState struct {
	// The list of strings to shuffle.
	Inputs pulumi.StringArrayInput
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.
	ResultCount pulumi.IntPtrInput
	// Random permutation of the list of strings given in `input`. The number of elements is determined by `result_count` if
	// set, or the number of elements in `input`.
	Results pulumi.StringArrayInput
	// Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.
	Seed pulumi.StringPtrInput
}

func (RandomShuffleState) ElementType

func (RandomShuffleState) ElementType() reflect.Type

type RandomString

type RandomString struct {
	pulumi.CustomResourceState

	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntOutput `pulumi:"length"`
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolOutput `pulumi:"lower"`
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntOutput `pulumi:"minLower"`
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntOutput `pulumi:"minNumeric"`
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntOutput `pulumi:"minSpecial"`
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntOutput `pulumi:"minUpper"`
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolOutput `pulumi:"number"`
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolOutput `pulumi:"numeric"`
	// 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.
	OverrideSpecial pulumi.StringPtrOutput `pulumi:"overrideSpecial"`
	// The generated random string.
	Result pulumi.StringOutput `pulumi:"result"`
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolOutput `pulumi:"special"`
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolOutput `pulumi:"upper"`
}

The resource `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

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := random.NewRandomString(ctx, "random", &random.RandomStringArgs{
			Length:          pulumi.Int(16),
			OverrideSpecial: pulumi.String("/@£$"),
			Special:         pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

You can import external strings into your Pulumi programs as RandomString resources as follows:

func GetRandomString

func GetRandomString(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomStringState, opts ...pulumi.ResourceOption) (*RandomString, error)

GetRandomString gets an existing RandomString resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomString

func NewRandomString(ctx *pulumi.Context,
	name string, args *RandomStringArgs, opts ...pulumi.ResourceOption) (*RandomString, error)

NewRandomString registers a new resource with the given unique name, arguments, and options.

func (*RandomString) ElementType

func (*RandomString) ElementType() reflect.Type

func (*RandomString) ToRandomStringOutput

func (i *RandomString) ToRandomStringOutput() RandomStringOutput

func (*RandomString) ToRandomStringOutputWithContext

func (i *RandomString) ToRandomStringOutputWithContext(ctx context.Context) RandomStringOutput

type RandomStringArgs

type RandomStringArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntInput
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolPtrInput
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntPtrInput
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntPtrInput
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntPtrInput
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntPtrInput
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolPtrInput
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolPtrInput
	// 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.
	OverrideSpecial pulumi.StringPtrInput
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolPtrInput
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolPtrInput
}

The set of arguments for constructing a RandomString resource.

func (RandomStringArgs) ElementType

func (RandomStringArgs) ElementType() reflect.Type

type RandomStringArray

type RandomStringArray []RandomStringInput

func (RandomStringArray) ElementType

func (RandomStringArray) ElementType() reflect.Type

func (RandomStringArray) ToRandomStringArrayOutput

func (i RandomStringArray) ToRandomStringArrayOutput() RandomStringArrayOutput

func (RandomStringArray) ToRandomStringArrayOutputWithContext

func (i RandomStringArray) ToRandomStringArrayOutputWithContext(ctx context.Context) RandomStringArrayOutput

type RandomStringArrayInput

type RandomStringArrayInput interface {
	pulumi.Input

	ToRandomStringArrayOutput() RandomStringArrayOutput
	ToRandomStringArrayOutputWithContext(context.Context) RandomStringArrayOutput
}

RandomStringArrayInput is an input type that accepts RandomStringArray and RandomStringArrayOutput values. You can construct a concrete instance of `RandomStringArrayInput` via:

RandomStringArray{ RandomStringArgs{...} }

type RandomStringArrayOutput

type RandomStringArrayOutput struct{ *pulumi.OutputState }

func (RandomStringArrayOutput) ElementType

func (RandomStringArrayOutput) ElementType() reflect.Type

func (RandomStringArrayOutput) Index

func (RandomStringArrayOutput) ToRandomStringArrayOutput

func (o RandomStringArrayOutput) ToRandomStringArrayOutput() RandomStringArrayOutput

func (RandomStringArrayOutput) ToRandomStringArrayOutputWithContext

func (o RandomStringArrayOutput) ToRandomStringArrayOutputWithContext(ctx context.Context) RandomStringArrayOutput

type RandomStringInput

type RandomStringInput interface {
	pulumi.Input

	ToRandomStringOutput() RandomStringOutput
	ToRandomStringOutputWithContext(ctx context.Context) RandomStringOutput
}

type RandomStringMap

type RandomStringMap map[string]RandomStringInput

func (RandomStringMap) ElementType

func (RandomStringMap) ElementType() reflect.Type

func (RandomStringMap) ToRandomStringMapOutput

func (i RandomStringMap) ToRandomStringMapOutput() RandomStringMapOutput

func (RandomStringMap) ToRandomStringMapOutputWithContext

func (i RandomStringMap) ToRandomStringMapOutputWithContext(ctx context.Context) RandomStringMapOutput

type RandomStringMapInput

type RandomStringMapInput interface {
	pulumi.Input

	ToRandomStringMapOutput() RandomStringMapOutput
	ToRandomStringMapOutputWithContext(context.Context) RandomStringMapOutput
}

RandomStringMapInput is an input type that accepts RandomStringMap and RandomStringMapOutput values. You can construct a concrete instance of `RandomStringMapInput` via:

RandomStringMap{ "key": RandomStringArgs{...} }

type RandomStringMapOutput

type RandomStringMapOutput struct{ *pulumi.OutputState }

func (RandomStringMapOutput) ElementType

func (RandomStringMapOutput) ElementType() reflect.Type

func (RandomStringMapOutput) MapIndex

func (RandomStringMapOutput) ToRandomStringMapOutput

func (o RandomStringMapOutput) ToRandomStringMapOutput() RandomStringMapOutput

func (RandomStringMapOutput) ToRandomStringMapOutputWithContext

func (o RandomStringMapOutput) ToRandomStringMapOutputWithContext(ctx context.Context) RandomStringMapOutput

type RandomStringOutput

type RandomStringOutput struct{ *pulumi.OutputState }

func (RandomStringOutput) ElementType

func (RandomStringOutput) ElementType() reflect.Type

func (RandomStringOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomStringOutput) Length added in v4.6.0

func (o RandomStringOutput) Length() pulumi.IntOutput

The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).

func (RandomStringOutput) Lower added in v4.6.0

Include lowercase alphabet characters in the result. Default value is `true`.

func (RandomStringOutput) MinLower added in v4.6.0

func (o RandomStringOutput) MinLower() pulumi.IntOutput

Minimum number of lowercase alphabet characters in the result. Default value is `0`.

func (RandomStringOutput) MinNumeric added in v4.6.0

func (o RandomStringOutput) MinNumeric() pulumi.IntOutput

Minimum number of numeric characters in the result. Default value is `0`.

func (RandomStringOutput) MinSpecial added in v4.6.0

func (o RandomStringOutput) MinSpecial() pulumi.IntOutput

Minimum number of special characters in the result. Default value is `0`.

func (RandomStringOutput) MinUpper added in v4.6.0

func (o RandomStringOutput) MinUpper() pulumi.IntOutput

Minimum number of uppercase alphabet characters in the result. Default value is `0`.

func (RandomStringOutput) Number deprecated added in v4.6.0

Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.

Deprecated: **NOTE**: This is deprecated, use `numeric` instead.

func (RandomStringOutput) Numeric added in v4.9.0

func (o RandomStringOutput) Numeric() pulumi.BoolOutput

Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.

func (RandomStringOutput) OverrideSpecial added in v4.6.0

func (o RandomStringOutput) OverrideSpecial() pulumi.StringPtrOutput

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.

func (RandomStringOutput) Result added in v4.6.0

The generated random string.

func (RandomStringOutput) Special added in v4.6.0

func (o RandomStringOutput) Special() pulumi.BoolOutput

Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.

func (RandomStringOutput) ToRandomStringOutput

func (o RandomStringOutput) ToRandomStringOutput() RandomStringOutput

func (RandomStringOutput) ToRandomStringOutputWithContext

func (o RandomStringOutput) ToRandomStringOutputWithContext(ctx context.Context) RandomStringOutput

func (RandomStringOutput) Upper added in v4.6.0

Include uppercase alphabet characters in the result. Default value is `true`.

type RandomStringState

type RandomStringState struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The length of the string desired. The minimum value for length is 1 and, length must also be >= (`minUpper` + `minLower` + `minNumeric` + `minSpecial`).
	Length pulumi.IntPtrInput
	// Include lowercase alphabet characters in the result. Default value is `true`.
	Lower pulumi.BoolPtrInput
	// Minimum number of lowercase alphabet characters in the result. Default value is `0`.
	MinLower pulumi.IntPtrInput
	// Minimum number of numeric characters in the result. Default value is `0`.
	MinNumeric pulumi.IntPtrInput
	// Minimum number of special characters in the result. Default value is `0`.
	MinSpecial pulumi.IntPtrInput
	// Minimum number of uppercase alphabet characters in the result. Default value is `0`.
	MinUpper pulumi.IntPtrInput
	// Include numeric characters in the result. Default value is `true`. If `number`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`. **NOTE**: This is deprecated, use `numeric` instead.
	//
	// Deprecated: **NOTE**: This is deprecated, use `numeric` instead.
	Number pulumi.BoolPtrInput
	// Include numeric characters in the result. Default value is `true`. If `numeric`, `upper`, `lower`, and `special` are all configured, at least one of them must be set to `true`.
	Numeric pulumi.BoolPtrInput
	// 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.
	OverrideSpecial pulumi.StringPtrInput
	// The generated random string.
	Result pulumi.StringPtrInput
	// Include special characters in the result. These are `!@#$%&*()-_=+[]{}<>:?`. Default value is `true`.
	Special pulumi.BoolPtrInput
	// Include uppercase alphabet characters in the result. Default value is `true`.
	Upper pulumi.BoolPtrInput
}

func (RandomStringState) ElementType

func (RandomStringState) ElementType() reflect.Type

type RandomUuid

type RandomUuid struct {
	pulumi.CustomResourceState

	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapOutput `pulumi:"keepers"`
	// The generated uuid presented in string format.
	Result pulumi.StringOutput `pulumi:"result"`
}

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := random.NewRandomUuid(ctx, "testRandomUuid", nil)
		if err != nil {
			return err
		}
		_, err = core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("Central US"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

Random UUID's can be imported. This can be used to replace a config

value with a value interpolated from the random provider without

experiencing diffs.

```sh $ pulumi import random:index/randomUuid:RandomUuid main aabbccdd-eeff-0011-2233-445566778899 ```

func GetRandomUuid

func GetRandomUuid(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RandomUuidState, opts ...pulumi.ResourceOption) (*RandomUuid, error)

GetRandomUuid gets an existing RandomUuid resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRandomUuid

func NewRandomUuid(ctx *pulumi.Context,
	name string, args *RandomUuidArgs, opts ...pulumi.ResourceOption) (*RandomUuid, error)

NewRandomUuid registers a new resource with the given unique name, arguments, and options.

func (*RandomUuid) ElementType

func (*RandomUuid) ElementType() reflect.Type

func (*RandomUuid) ToRandomUuidOutput

func (i *RandomUuid) ToRandomUuidOutput() RandomUuidOutput

func (*RandomUuid) ToRandomUuidOutputWithContext

func (i *RandomUuid) ToRandomUuidOutputWithContext(ctx context.Context) RandomUuidOutput

type RandomUuidArgs

type RandomUuidArgs struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
}

The set of arguments for constructing a RandomUuid resource.

func (RandomUuidArgs) ElementType

func (RandomUuidArgs) ElementType() reflect.Type

type RandomUuidArray

type RandomUuidArray []RandomUuidInput

func (RandomUuidArray) ElementType

func (RandomUuidArray) ElementType() reflect.Type

func (RandomUuidArray) ToRandomUuidArrayOutput

func (i RandomUuidArray) ToRandomUuidArrayOutput() RandomUuidArrayOutput

func (RandomUuidArray) ToRandomUuidArrayOutputWithContext

func (i RandomUuidArray) ToRandomUuidArrayOutputWithContext(ctx context.Context) RandomUuidArrayOutput

type RandomUuidArrayInput

type RandomUuidArrayInput interface {
	pulumi.Input

	ToRandomUuidArrayOutput() RandomUuidArrayOutput
	ToRandomUuidArrayOutputWithContext(context.Context) RandomUuidArrayOutput
}

RandomUuidArrayInput is an input type that accepts RandomUuidArray and RandomUuidArrayOutput values. You can construct a concrete instance of `RandomUuidArrayInput` via:

RandomUuidArray{ RandomUuidArgs{...} }

type RandomUuidArrayOutput

type RandomUuidArrayOutput struct{ *pulumi.OutputState }

func (RandomUuidArrayOutput) ElementType

func (RandomUuidArrayOutput) ElementType() reflect.Type

func (RandomUuidArrayOutput) Index

func (RandomUuidArrayOutput) ToRandomUuidArrayOutput

func (o RandomUuidArrayOutput) ToRandomUuidArrayOutput() RandomUuidArrayOutput

func (RandomUuidArrayOutput) ToRandomUuidArrayOutputWithContext

func (o RandomUuidArrayOutput) ToRandomUuidArrayOutputWithContext(ctx context.Context) RandomUuidArrayOutput

type RandomUuidInput

type RandomUuidInput interface {
	pulumi.Input

	ToRandomUuidOutput() RandomUuidOutput
	ToRandomUuidOutputWithContext(ctx context.Context) RandomUuidOutput
}

type RandomUuidMap

type RandomUuidMap map[string]RandomUuidInput

func (RandomUuidMap) ElementType

func (RandomUuidMap) ElementType() reflect.Type

func (RandomUuidMap) ToRandomUuidMapOutput

func (i RandomUuidMap) ToRandomUuidMapOutput() RandomUuidMapOutput

func (RandomUuidMap) ToRandomUuidMapOutputWithContext

func (i RandomUuidMap) ToRandomUuidMapOutputWithContext(ctx context.Context) RandomUuidMapOutput

type RandomUuidMapInput

type RandomUuidMapInput interface {
	pulumi.Input

	ToRandomUuidMapOutput() RandomUuidMapOutput
	ToRandomUuidMapOutputWithContext(context.Context) RandomUuidMapOutput
}

RandomUuidMapInput is an input type that accepts RandomUuidMap and RandomUuidMapOutput values. You can construct a concrete instance of `RandomUuidMapInput` via:

RandomUuidMap{ "key": RandomUuidArgs{...} }

type RandomUuidMapOutput

type RandomUuidMapOutput struct{ *pulumi.OutputState }

func (RandomUuidMapOutput) ElementType

func (RandomUuidMapOutput) ElementType() reflect.Type

func (RandomUuidMapOutput) MapIndex

func (RandomUuidMapOutput) ToRandomUuidMapOutput

func (o RandomUuidMapOutput) ToRandomUuidMapOutput() RandomUuidMapOutput

func (RandomUuidMapOutput) ToRandomUuidMapOutputWithContext

func (o RandomUuidMapOutput) ToRandomUuidMapOutputWithContext(ctx context.Context) RandomUuidMapOutput

type RandomUuidOutput

type RandomUuidOutput struct{ *pulumi.OutputState }

func (RandomUuidOutput) ElementType

func (RandomUuidOutput) ElementType() reflect.Type

func (RandomUuidOutput) Keepers added in v4.6.0

Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.

func (RandomUuidOutput) Result added in v4.6.0

The generated uuid presented in string format.

func (RandomUuidOutput) ToRandomUuidOutput

func (o RandomUuidOutput) ToRandomUuidOutput() RandomUuidOutput

func (RandomUuidOutput) ToRandomUuidOutputWithContext

func (o RandomUuidOutput) ToRandomUuidOutputWithContext(ctx context.Context) RandomUuidOutput

type RandomUuidState

type RandomUuidState struct {
	// Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
	Keepers pulumi.StringMapInput
	// The generated uuid presented in string format.
	Result pulumi.StringPtrInput
}

func (RandomUuidState) ElementType

func (RandomUuidState) ElementType() reflect.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL