1. Packages
  2. Gitlab Provider
  3. API Docs
  4. GroupVariable
GitLab v8.5.0 published on Friday, Oct 18, 2024 by Pulumi

gitlab.GroupVariable

Explore with Pulumi AI

gitlab logo
GitLab v8.5.0 published on Friday, Oct 18, 2024 by Pulumi

    The gitlab.GroupVariable resource allows to manage the lifecycle of a CI/CD variable for a group.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = new gitlab.GroupVariable("example", {
        group: "12345",
        key: "group_variable_key",
        value: "group_variable_value",
        "protected": false,
        masked: false,
        environmentScope: "*",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.GroupVariable("example",
        group="12345",
        key="group_variable_key",
        value="group_variable_value",
        protected=False,
        masked=False,
        environment_scope="*")
    
    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.NewGroupVariable(ctx, "example", &gitlab.GroupVariableArgs{
    			Group:            pulumi.String("12345"),
    			Key:              pulumi.String("group_variable_key"),
    			Value:            pulumi.String("group_variable_value"),
    			Protected:        pulumi.Bool(false),
    			Masked:           pulumi.Bool(false),
    			EnvironmentScope: pulumi.String("*"),
    		})
    		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 example = new GitLab.GroupVariable("example", new()
        {
            Group = "12345",
            Key = "group_variable_key",
            Value = "group_variable_value",
            Protected = false,
            Masked = false,
            EnvironmentScope = "*",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GroupVariable;
    import com.pulumi.gitlab.GroupVariableArgs;
    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 GroupVariable("example", GroupVariableArgs.builder()
                .group("12345")
                .key("group_variable_key")
                .value("group_variable_value")
                .protected_(false)
                .masked(false)
                .environmentScope("*")
                .build());
    
        }
    }
    
    resources:
      example:
        type: gitlab:GroupVariable
        properties:
          group: '12345'
          key: group_variable_key
          value: group_variable_value
          protected: false
          masked: false
          environmentScope: '*'
    

    Create GroupVariable Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GroupVariable(name: string, args: GroupVariableArgs, opts?: CustomResourceOptions);
    @overload
    def GroupVariable(resource_name: str,
                      args: GroupVariableArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupVariable(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      group: Optional[str] = None,
                      key: Optional[str] = None,
                      value: Optional[str] = None,
                      description: Optional[str] = None,
                      environment_scope: Optional[str] = None,
                      masked: Optional[bool] = None,
                      protected: Optional[bool] = None,
                      raw: Optional[bool] = None,
                      variable_type: Optional[str] = None)
    func NewGroupVariable(ctx *Context, name string, args GroupVariableArgs, opts ...ResourceOption) (*GroupVariable, error)
    public GroupVariable(string name, GroupVariableArgs args, CustomResourceOptions? opts = null)
    public GroupVariable(String name, GroupVariableArgs args)
    public GroupVariable(String name, GroupVariableArgs args, CustomResourceOptions options)
    
    type: gitlab:GroupVariable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GroupVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GroupVariableArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GroupVariableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupVariableArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var groupVariableResource = new GitLab.GroupVariable("groupVariableResource", new()
    {
        Group = "string",
        Key = "string",
        Value = "string",
        Description = "string",
        EnvironmentScope = "string",
        Masked = false,
        Protected = false,
        Raw = false,
        VariableType = "string",
    });
    
    example, err := gitlab.NewGroupVariable(ctx, "groupVariableResource", &gitlab.GroupVariableArgs{
    	Group:            pulumi.String("string"),
    	Key:              pulumi.String("string"),
    	Value:            pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	EnvironmentScope: pulumi.String("string"),
    	Masked:           pulumi.Bool(false),
    	Protected:        pulumi.Bool(false),
    	Raw:              pulumi.Bool(false),
    	VariableType:     pulumi.String("string"),
    })
    
    var groupVariableResource = new GroupVariable("groupVariableResource", GroupVariableArgs.builder()
        .group("string")
        .key("string")
        .value("string")
        .description("string")
        .environmentScope("string")
        .masked(false)
        .protected_(false)
        .raw(false)
        .variableType("string")
        .build());
    
    group_variable_resource = gitlab.GroupVariable("groupVariableResource",
        group="string",
        key="string",
        value="string",
        description="string",
        environment_scope="string",
        masked=False,
        protected=False,
        raw=False,
        variable_type="string")
    
    const groupVariableResource = new gitlab.GroupVariable("groupVariableResource", {
        group: "string",
        key: "string",
        value: "string",
        description: "string",
        environmentScope: "string",
        masked: false,
        "protected": false,
        raw: false,
        variableType: "string",
    });
    
    type: gitlab:GroupVariable
    properties:
        description: string
        environmentScope: string
        group: string
        key: string
        masked: false
        protected: false
        raw: false
        value: string
        variableType: string
    

    GroupVariable Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GroupVariable resource accepts the following input properties:

    Group string
    The name or id of the group.
    Key string
    The name of the variable.
    Value string
    The value of the variable.
    Description string
    The description of the variable.
    EnvironmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    VariableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    Group string
    The name or id of the group.
    Key string
    The name of the variable.
    Value string
    The value of the variable.
    Description string
    The description of the variable.
    EnvironmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    VariableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    group String
    The name or id of the group.
    key String
    The name of the variable.
    value String
    The value of the variable.
    description String
    The description of the variable.
    environmentScope String
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    variableType String
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    group string
    The name or id of the group.
    key string
    The name of the variable.
    value string
    The value of the variable.
    description string
    The description of the variable.
    environmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    variableType string
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    group str
    The name or id of the group.
    key str
    The name of the variable.
    value str
    The value of the variable.
    description str
    The description of the variable.
    environment_scope str
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    variable_type str
    The type of a variable. Valid values are: env_var, file. Default is env_var.
    group String
    The name or id of the group.
    key String
    The name of the variable.
    value String
    The value of the variable.
    description String
    The description of the variable.
    environmentScope String
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    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.
    variableType String
    The type of a variable. Valid values are: env_var, file. Default is env_var.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GroupVariable resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GroupVariable Resource

    Get an existing GroupVariable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GroupVariableState, opts?: CustomResourceOptions): GroupVariable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            environment_scope: Optional[str] = None,
            group: Optional[str] = None,
            key: Optional[str] = None,
            masked: Optional[bool] = None,
            protected: Optional[bool] = None,
            raw: Optional[bool] = None,
            value: Optional[str] = None,
            variable_type: Optional[str] = None) -> GroupVariable
    func GetGroupVariable(ctx *Context, name string, id IDInput, state *GroupVariableState, opts ...ResourceOption) (*GroupVariable, error)
    public static GroupVariable Get(string name, Input<string> id, GroupVariableState? state, CustomResourceOptions? opts = null)
    public static GroupVariable get(String name, Output<String> id, GroupVariableState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    The description of the variable.
    EnvironmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    Group string
    The name or id of the group.
    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.
    EnvironmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    Group string
    The name or id of the group.
    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.
    environmentScope String
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    group String
    The name or id of the group.
    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.
    environmentScope string
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    group string
    The name or id of the group.
    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.
    environment_scope str
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    group str
    The name or id of the group.
    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.
    environmentScope String
    The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
    group String
    The name or id of the group.
    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.

    Import

    GitLab group variables can be imported using an id made up of groupid:variablename:scope, e.g.

    $ pulumi import gitlab:index/groupVariable:GroupVariable example 12345:group_variable_key:*
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.5.0 published on Friday, Oct 18, 2024 by Pulumi