Nomad v2.3.0 published on Wednesday, Jun 5, 2024 by Pulumi
nomad.getVariable
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";
const example = new nomad.Variable("example", {path: "path/of/existing/variable"});
import pulumi
import pulumi_nomad as nomad
example = nomad.Variable("example", path="path/of/existing/variable")
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("path/of/existing/variable"),
})
if err != nil {
return err
}
return nil
})
}
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 = "path/of/existing/variable",
});
});
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("path/of/existing/variable")
.build());
}
}
resources:
example:
type: nomad:Variable
properties:
path: path/of/existing/variable
Using getVariable
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVariable(args: GetVariableArgs, opts?: InvokeOptions): Promise<GetVariableResult>
function getVariableOutput(args: GetVariableOutputArgs, opts?: InvokeOptions): Output<GetVariableResult>
def get_variable(namespace: Optional[str] = None,
path: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVariableResult
def get_variable_output(namespace: Optional[pulumi.Input[str]] = None,
path: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVariableResult]
func LookupVariable(ctx *Context, args *LookupVariableArgs, opts ...InvokeOption) (*LookupVariableResult, error)
func LookupVariableOutput(ctx *Context, args *LookupVariableOutputArgs, opts ...InvokeOption) LookupVariableResultOutput
> Note: This function is named LookupVariable
in the Go SDK.
public static class GetVariable
{
public static Task<GetVariableResult> InvokeAsync(GetVariableArgs args, InvokeOptions? opts = null)
public static Output<GetVariableResult> Invoke(GetVariableInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVariableResult> getVariable(GetVariableArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: nomad:index/getVariable:getVariable
arguments:
# arguments dictionary
The following arguments are supported:
getVariable Result
The following output properties are available:
Package Details
- Repository
- HashiCorp Nomad pulumi/pulumi-nomad
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nomad
Terraform Provider.