
com.pulumi.nomad.kotlin.VariableArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-nomad-kotlin Show documentation
Show all versions of pulumi-nomad-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy