UNPKG

@pulumi/random

Version:

A Pulumi package to safely use randomness in Pulumi programs.

97 lines (96 loc) 3.71 kB
import * as pulumi from "@pulumi/pulumi"; /** * The resource `random.RandomUuid7` generates a random version 7 uuid string that is intended to be used as a unique identifier for other resources. * * This resource uses [google/uuid](https://github.com/google/uuid) to generate a valid V7 UUID for use with services needing a unique string identifier. * * ## 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.RandomUuid7("test", {}); * const testResourceGroup = new azurerm.index.ResourceGroup("test", { * name: `${test.result}-rg`, * location: "Central US", * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * 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/randomUuid7:RandomUuid7 main 0197ad85-fe6e-7e92-a2f5-7550daa83030 * ``` */ export declare class RandomUuid7 extends pulumi.CustomResource { /** * Get an existing RandomUuid7 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?: RandomUuid7State, opts?: pulumi.CustomResourceOptions): RandomUuid7; /** * Returns true if the given object is an instance of RandomUuid7. 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 RandomUuid7; /** * 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 RandomUuid7 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?: RandomUuid7Args, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RandomUuid7 resources. */ export interface RandomUuid7State { /** * 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 RandomUuid7 resource. */ export interface RandomUuid7Args { /** * 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>; }>; }