1. Packages
  2. Nomad Provider
  3. API Docs
  4. getVariable
Nomad v2.4.1 published on Wednesday, Oct 30, 2024 by Pulumi

nomad.getVariable

Explore with Pulumi AI

nomad logo
Nomad v2.4.1 published on Wednesday, Oct 30, 2024 by Pulumi

    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:

    Path string
    (string) - Path to the existing variable.
    Namespace string
    (string: "default") - The namepsace in which the variable exists.
    Path string
    (string) - Path to the existing variable.
    Namespace string
    (string: "default") - The namepsace in which the variable exists.
    path String
    (string) - Path to the existing variable.
    namespace String
    (string: "default") - The namepsace in which the variable exists.
    path string
    (string) - Path to the existing variable.
    namespace string
    (string: "default") - The namepsace in which the variable exists.
    path str
    (string) - Path to the existing variable.
    namespace str
    (string: "default") - The namepsace in which the variable exists.
    path String
    (string) - Path to the existing variable.
    namespace String
    (string: "default") - The namepsace in which the variable exists.

    getVariable Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Items Dictionary<string, string>
    (map[string]string) - Map of items in the variable.
    Path string
    (string) - The path at which the variable exists.
    Namespace string
    (string) - The namespace in which the variable exists.
    Id string
    The provider-assigned unique ID for this managed resource.
    Items map[string]string
    (map[string]string) - Map of items in the variable.
    Path string
    (string) - The path at which the variable exists.
    Namespace string
    (string) - The namespace in which the variable exists.
    id String
    The provider-assigned unique ID for this managed resource.
    items Map<String,String>
    (map[string]string) - Map of items in the variable.
    path String
    (string) - The path at which the variable exists.
    namespace String
    (string) - The namespace in which the variable exists.
    id string
    The provider-assigned unique ID for this managed resource.
    items {[key: string]: string}
    (map[string]string) - Map of items in the variable.
    path string
    (string) - The path at which the variable exists.
    namespace string
    (string) - The namespace in which the variable exists.
    id str
    The provider-assigned unique ID for this managed resource.
    items Mapping[str, str]
    (map[string]string) - Map of items in the variable.
    path str
    (string) - The path at which the variable exists.
    namespace str
    (string) - The namespace in which the variable exists.
    id String
    The provider-assigned unique ID for this managed resource.
    items Map<String>
    (map[string]string) - Map of items in the variable.
    path String
    (string) - The path at which the variable exists.
    namespace String
    (string) - The namespace in which the variable exists.

    Package Details

    Repository
    HashiCorp Nomad pulumi/pulumi-nomad
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nomad Terraform Provider.
    nomad logo
    Nomad v2.4.1 published on Wednesday, Oct 30, 2024 by Pulumi