![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.random.kotlin.RandomPetArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.random.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.random.RandomPetArgs.builder
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* The resource `random.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 `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.
* ## Example Usage
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.random.RandomPet;
* import com.pulumi.random.RandomPetArgs;
* import com.pulumi.aws.ec2.Instance;
* import com.pulumi.aws.ec2.InstanceArgs;
* 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) {
* var serverRandomPet = new RandomPet("serverRandomPet", RandomPetArgs.builder()
* .keepers(Map.of("ami_id", var_.ami_id()))
* .build());
* var serverInstance = new Instance("serverInstance", InstanceArgs.builder()
* .tags(Map.of("Name", serverRandomPet.id().applyValue(id -> String.format("web-server-%s", id))))
* .ami(serverRandomPet.keepers().applyValue(keepers -> keepers.amiId()))
* .build());
* }
* }
* ```
* @property keepers Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.
* @property length The length (in words) of the pet name. Defaults to 2
* @property prefix A string to prefix the name with.
* @property separator The character to separate words in the pet name. Defaults to "-"
*/
public data class RandomPetArgs(
public val keepers: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy