1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getInstanceVariable
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

gitlab.getInstanceVariable

Explore with Pulumi AI

gitlab logo
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

    The gitlab.InstanceVariable data source allows to retrieve details about an instance-level CI/CD variable.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const foo = gitlab.getInstanceVariable({
        key: "foo",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    foo = gitlab.get_instance_variable(key="foo")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gitlab.LookupInstanceVariable(ctx, &gitlab.LookupInstanceVariableArgs{
    			Key: "foo",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = GitLab.GetInstanceVariable.Invoke(new()
        {
            Key = "foo",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GitlabFunctions;
    import com.pulumi.gitlab.inputs.GetInstanceVariableArgs;
    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) {
            final var foo = GitlabFunctions.getInstanceVariable(GetInstanceVariableArgs.builder()
                .key("foo")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: gitlab:getInstanceVariable
          Arguments:
            key: foo
    

    Using getInstanceVariable

    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 getInstanceVariable(args: GetInstanceVariableArgs, opts?: InvokeOptions): Promise<GetInstanceVariableResult>
    function getInstanceVariableOutput(args: GetInstanceVariableOutputArgs, opts?: InvokeOptions): Output<GetInstanceVariableResult>
    def get_instance_variable(key: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetInstanceVariableResult
    def get_instance_variable_output(key: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetInstanceVariableResult]
    func LookupInstanceVariable(ctx *Context, args *LookupInstanceVariableArgs, opts ...InvokeOption) (*LookupInstanceVariableResult, error)
    func LookupInstanceVariableOutput(ctx *Context, args *LookupInstanceVariableOutputArgs, opts ...InvokeOption) LookupInstanceVariableResultOutput

    > Note: This function is named LookupInstanceVariable in the Go SDK.

    public static class GetInstanceVariable 
    {
        public static Task<GetInstanceVariableResult> InvokeAsync(GetInstanceVariableArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceVariableResult> Invoke(GetInstanceVariableInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceVariableResult> getInstanceVariable(GetInstanceVariableArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gitlab:index/getInstanceVariable:getInstanceVariable
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Key string
    The name of the variable.
    Key string
    The name of the variable.
    key String
    The name of the variable.
    key string
    The name of the variable.
    key str
    The name of the variable.
    key String
    The name of the variable.

    getInstanceVariable Result

    The following output properties are available:

    Description string
    The description of the variable. Maximum of 255 characters.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The name of the variable.
    Masked bool
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    Protected bool
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    Raw bool
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    Value string
    The value of the variable.
    VariableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    Description string
    The description of the variable. Maximum of 255 characters.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The name of the variable.
    Masked bool
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    Protected bool
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    Raw bool
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    Value string
    The value of the variable.
    VariableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    description String
    The description of the variable. Maximum of 255 characters.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The name of the variable.
    masked Boolean
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    protected_ Boolean
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    raw Boolean
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    value String
    The value of the variable.
    variableType String
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    description string
    The description of the variable. Maximum of 255 characters.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The name of the variable.
    masked boolean
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    protected boolean
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    raw boolean
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    value string
    The value of the variable.
    variableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    description str
    The description of the variable. Maximum of 255 characters.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    The name of the variable.
    masked bool
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    protected bool
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    raw bool
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    value str
    The value of the variable.
    variable_type str
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    description String
    The description of the variable. Maximum of 255 characters.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The name of the variable.
    masked Boolean
    If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.
    protected Boolean
    If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
    raw Boolean
    Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
    value String
    The value of the variable.
    variableType String
    The type of a variable. Valid values are: env_var, file. Default is env_var.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi