Variable Args
data class VariableArgs(val items: Output<Map<String, String>>? = null, val namespace: Output<String>? = null, val path: Output<String>? = null) : ConvertibleToJava<VariableArgs>
Example Usage
Creating a variable in the default namespace:
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",
},
});
Content copied to clipboard
import pulumi
import pulumi_nomad as nomad
example = nomad.Variable("example",
path="some/path/of/your/choosing",
items={
"example_key": "example_value",
})
Content copied to clipboard
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" },
},
});
});
Content copied to clipboard
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.StringMap{
"example_key": pulumi.String("example_value"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
resources:
example:
type: nomad:Variable
properties:
path: some/path/of/your/choosing
items:
example_key: example_value
Content copied to clipboard
Creating a variable in a custom namespace:
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",
},
});
Content copied to clipboard
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",
})
Content copied to clipboard
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" },
},
});
});
Content copied to clipboard
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.StringMap{
"example_key": pulumi.String("example_value"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard