UNPKG

@pulumi/random

Version:

A Pulumi package to safely use randomness in Pulumi programs.

91 lines (90 loc) 3.32 kB
import * as pulumi from "@pulumi/pulumi"; /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azurerm from "@pulumi/azurerm"; * import * as random from "@pulumi/random"; * * // The following example shows how to generate a unique name for an Azure Resource Group. * const test = new random.RandomUuid("test", {}); * const testResourceGroup = new azurerm.index.ResourceGroup("test", { * name: `${test.result}-rg`, * location: "Central US", * }); * ``` * * ## 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 * ``` */ export declare class RandomUuid extends pulumi.CustomResource { /** * Get an existing RandomUuid resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RandomUuidState, opts?: pulumi.CustomResourceOptions): RandomUuid; /** * Returns true if the given object is an instance of RandomUuid. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RandomUuid; /** * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information. */ readonly keepers: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The generated uuid presented in string format. */ readonly result: pulumi.Output<string>; /** * Create a RandomUuid resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: RandomUuidArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RandomUuid resources. */ export interface RandomUuidState { /** * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information. */ keepers?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The generated uuid presented in string format. */ result?: pulumi.Input<string>; } /** * The set of arguments for constructing a RandomUuid resource. */ export interface RandomUuidArgs { /** * Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information. */ keepers?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }