RandomUuid

class RandomUuid : KotlinCustomResource

Example Usage

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 pulumi
import pulumi_azurerm as azurerm
import pulumi_random as random
# The following example shows how to generate a unique name for an Azure Resource Group.
test = random.RandomUuid("test")
test_resource_group = azurerm.index.ResourceGroup("test",
name=f{test.result}-rg,
location=Central US)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azurerm = Pulumi.Azurerm;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
// The following example shows how to generate a unique name for an Azure Resource Group.
var test = new Random.RandomUuid("test");
var testResourceGroup = new Azurerm.Index.ResourceGroup("test", new()
{
Name = $"{test.Result}-rg",
Location = "Central US",
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-azurerm/sdk/go/azurerm"
"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 Azure Resource Group.
test, err := random.NewRandomUuid(ctx, "test", nil)
if err != nil {
return err
}
_, err = azurerm.NewResourceGroup(ctx, "test", &azurerm.ResourceGroupArgs{
Name: pulumi.Sprintf("%v-rg", test.Result),
Location: "Central US",
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomUuid;
import com.pulumi.azurerm.resourceGroup;
import com.pulumi.azurerm.ResourceGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// The following example shows how to generate a unique name for an Azure Resource Group.
var test = new RandomUuid("test");
var testResourceGroup = new ResourceGroup("testResourceGroup", ResourceGroupArgs.builder()
.name(String.format("%s-rg", test.result()))
.location("Central US")
.build());
}
}
resources:
# The following example shows how to generate a unique name for an Azure Resource Group.
test:
type: random:RandomUuid
testResourceGroup:
type: azurerm:resourceGroup
name: test
properties:
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.

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

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val keepers: Output<Map<String, String>>?

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val result: Output<String>

The generated uuid presented in string format.

Link copied to clipboard
val urn: Output<String>