All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.nomad.kotlin.VariableArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.4.3.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.nomad.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.nomad.VariableArgs.builder
import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * Creating a variable in the default namespace:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as nomad from "@pulumi/nomad";
 * const example = new nomad.Variable("example", {
 *     path: "some/path/of/your/choosing",
 *     items: {
 *         example_key: "example_value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_nomad as nomad
 * example = nomad.Variable("example",
 *     path="some/path/of/your/choosing",
 *     items={
 *         "example_key": "example_value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Nomad = Pulumi.Nomad;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Nomad.Variable("example", new()
 *     {
 *         Path = "some/path/of/your/choosing",
 *         Items =
 *         {
 *             { "example_key", "example_value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := nomad.NewVariable(ctx, "example", &nomad.VariableArgs{
 * 			Path: pulumi.String("some/path/of/your/choosing"),
 * 			Items: pulumi.Map{
 * 				"example_key": pulumi.Any("example_value"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.nomad.Variable;
 * import com.pulumi.nomad.VariableArgs;
 * 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 example = new Variable("example", VariableArgs.builder()
 *             .path("some/path/of/your/choosing")
 *             .items(Map.of("example_key", "example_value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: nomad:Variable
 *     properties:
 *       path: some/path/of/your/choosing
 *       items:
 *         example_key: example_value
 * ```
 * 
 * Creating a variable in a custom namespace:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as nomad from "@pulumi/nomad";
 * const example = new nomad.Namespace("example", {
 *     name: "example",
 *     description: "Example namespace.",
 * });
 * const exampleVariable = new nomad.Variable("example", {
 *     path: "some/path/of/your/choosing",
 *     namespace: example.name,
 *     items: {
 *         example_key: "example_value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_nomad as nomad
 * example = nomad.Namespace("example",
 *     name="example",
 *     description="Example namespace.")
 * example_variable = nomad.Variable("example",
 *     path="some/path/of/your/choosing",
 *     namespace=example.name,
 *     items={
 *         "example_key": "example_value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Nomad = Pulumi.Nomad;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Nomad.Namespace("example", new()
 *     {
 *         Name = "example",
 *         Description = "Example namespace.",
 *     });
 *     var exampleVariable = new Nomad.Variable("example", new()
 *     {
 *         Path = "some/path/of/your/choosing",
 *         Namespace = example.Name,
 *         Items =
 *         {
 *             { "example_key", "example_value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := nomad.NewNamespace(ctx, "example", &nomad.NamespaceArgs{
 * 			Name:        pulumi.String("example"),
 * 			Description: pulumi.String("Example namespace."),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = nomad.NewVariable(ctx, "example", &nomad.VariableArgs{
 * 			Path:      pulumi.String("some/path/of/your/choosing"),
 * 			Namespace: example.Name,
 * 			Items: pulumi.Map{
 * 				"example_key": pulumi.Any("example_value"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.nomad.Namespace;
 * import com.pulumi.nomad.NamespaceArgs;
 * import com.pulumi.nomad.Variable;
 * import com.pulumi.nomad.VariableArgs;
 * 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 example = new Namespace("example", NamespaceArgs.builder()
 *             .name("example")
 *             .description("Example namespace.")
 *             .build());
 *         var exampleVariable = new Variable("exampleVariable", VariableArgs.builder()
 *             .path("some/path/of/your/choosing")
 *             .namespace(example.name())
 *             .items(Map.of("example_key", "example_value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: nomad:Namespace
 *     properties:
 *       name: example
 *       description: Example namespace.
 *   exampleVariable:
 *     type: nomad:Variable
 *     name: example
 *     properties:
 *       path: some/path/of/your/choosing
 *       namespace: ${example.name}
 *       items:
 *         example_key: example_value
 * ```
 * 
 * @property items `(map[string]string: )` - An arbitrary map of items to create in the variable.
 * @property namespace `(string: "default")` - The namepsace to create the variable in.
 * @property path `(string: )` - A unique path to create the variable at.
 */
public data class VariableArgs(
    public val items: Output>? = null,
    public val namespace: Output? = null,
    public val path: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.nomad.VariableArgs = com.pulumi.nomad.VariableArgs.builder()
        .items(items?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .namespace(namespace?.applyValue({ args0 -> args0 }))
        .path(path?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VariableArgs].
 */
@PulumiTagMarker
public class VariableArgsBuilder internal constructor() {
    private var items: Output>? = null

    private var namespace: Output? = null

    private var path: Output? = null

    /**
     * @param value `(map[string]string: )` - An arbitrary map of items to create in the variable.
     */
    @JvmName("swbwhflujyijgjog")
    public suspend fun items(`value`: Output>) {
        this.items = value
    }

    /**
     * @param value `(string: "default")` - The namepsace to create the variable in.
     */
    @JvmName("ujeqthfenhjftkrl")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value `(string: )` - A unique path to create the variable at.
     */
    @JvmName("bxcyuqnlliovijqn")
    public suspend fun path(`value`: Output) {
        this.path = value
    }

    /**
     * @param value `(map[string]string: )` - An arbitrary map of items to create in the variable.
     */
    @JvmName("ayqtbdcpjdkilvmh")
    public suspend fun items(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.items = mapped
    }

    /**
     * @param values `(map[string]string: )` - An arbitrary map of items to create in the variable.
     */
    @JvmName("xihphprrxnxigpjs")
    public fun items(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.items = mapped
    }

    /**
     * @param value `(string: "default")` - The namepsace to create the variable in.
     */
    @JvmName("hrprxdrladdvsmsm")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value `(string: )` - A unique path to create the variable at.
     */
    @JvmName("xofbyjalfunpgyfe")
    public suspend fun path(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.path = mapped
    }

    internal fun build(): VariableArgs = VariableArgs(
        items = items,
        namespace = namespace,
        path = path,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy