1. Packages
  2. GitLab
  3. API Docs
  4. PipelineScheduleVariable
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.PipelineScheduleVariable

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

    The gitlab.PipelineScheduleVariable resource allows to manage the lifecycle of a variable for a pipeline schedule.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const examplePipelineSchedule = new gitlab.PipelineSchedule("examplePipelineSchedule", {
        project: "12345",
        description: "Used to schedule builds",
        ref: "master",
        cron: "0 1 * * *",
    });
    const examplePipelineScheduleVariable = new gitlab.PipelineScheduleVariable("examplePipelineScheduleVariable", {
        project: examplePipelineSchedule.project,
        pipelineScheduleId: examplePipelineSchedule.pipelineScheduleId,
        key: "EXAMPLE_KEY",
        value: "example",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example_pipeline_schedule = gitlab.PipelineSchedule("examplePipelineSchedule",
        project="12345",
        description="Used to schedule builds",
        ref="master",
        cron="0 1 * * *")
    example_pipeline_schedule_variable = gitlab.PipelineScheduleVariable("examplePipelineScheduleVariable",
        project=example_pipeline_schedule.project,
        pipeline_schedule_id=example_pipeline_schedule.pipeline_schedule_id,
        key="EXAMPLE_KEY",
        value="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		examplePipelineSchedule, err := gitlab.NewPipelineSchedule(ctx, "examplePipelineSchedule", &gitlab.PipelineScheduleArgs{
    			Project:     pulumi.String("12345"),
    			Description: pulumi.String("Used to schedule builds"),
    			Ref:         pulumi.String("master"),
    			Cron:        pulumi.String("0 1 * * *"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewPipelineScheduleVariable(ctx, "examplePipelineScheduleVariable", &gitlab.PipelineScheduleVariableArgs{
    			Project:            examplePipelineSchedule.Project,
    			PipelineScheduleId: examplePipelineSchedule.PipelineScheduleId,
    			Key:                pulumi.String("EXAMPLE_KEY"),
    			Value:              pulumi.String("example"),
    		})
    		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 examplePipelineSchedule = new GitLab.PipelineSchedule("examplePipelineSchedule", new()
        {
            Project = "12345",
            Description = "Used to schedule builds",
            Ref = "master",
            Cron = "0 1 * * *",
        });
    
        var examplePipelineScheduleVariable = new GitLab.PipelineScheduleVariable("examplePipelineScheduleVariable", new()
        {
            Project = examplePipelineSchedule.Project,
            PipelineScheduleId = examplePipelineSchedule.PipelineScheduleId,
            Key = "EXAMPLE_KEY",
            Value = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.PipelineSchedule;
    import com.pulumi.gitlab.PipelineScheduleArgs;
    import com.pulumi.gitlab.PipelineScheduleVariable;
    import com.pulumi.gitlab.PipelineScheduleVariableArgs;
    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 examplePipelineSchedule = new PipelineSchedule("examplePipelineSchedule", PipelineScheduleArgs.builder()        
                .project("12345")
                .description("Used to schedule builds")
                .ref("master")
                .cron("0 1 * * *")
                .build());
    
            var examplePipelineScheduleVariable = new PipelineScheduleVariable("examplePipelineScheduleVariable", PipelineScheduleVariableArgs.builder()        
                .project(examplePipelineSchedule.project())
                .pipelineScheduleId(examplePipelineSchedule.pipelineScheduleId())
                .key("EXAMPLE_KEY")
                .value("example")
                .build());
    
        }
    }
    
    resources:
      examplePipelineSchedule:
        type: gitlab:PipelineSchedule
        properties:
          project: '12345'
          description: Used to schedule builds
          ref: master
          cron: 0 1 * * *
      examplePipelineScheduleVariable:
        type: gitlab:PipelineScheduleVariable
        properties:
          project: ${examplePipelineSchedule.project}
          pipelineScheduleId: ${examplePipelineSchedule.pipelineScheduleId}
          key: EXAMPLE_KEY
          value: example
    

    Create PipelineScheduleVariable Resource

    new PipelineScheduleVariable(name: string, args: PipelineScheduleVariableArgs, opts?: CustomResourceOptions);
    @overload
    def PipelineScheduleVariable(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 key: Optional[str] = None,
                                 pipeline_schedule_id: Optional[int] = None,
                                 project: Optional[str] = None,
                                 value: Optional[str] = None)
    @overload
    def PipelineScheduleVariable(resource_name: str,
                                 args: PipelineScheduleVariableArgs,
                                 opts: Optional[ResourceOptions] = None)
    func NewPipelineScheduleVariable(ctx *Context, name string, args PipelineScheduleVariableArgs, opts ...ResourceOption) (*PipelineScheduleVariable, error)
    public PipelineScheduleVariable(string name, PipelineScheduleVariableArgs args, CustomResourceOptions? opts = null)
    public PipelineScheduleVariable(String name, PipelineScheduleVariableArgs args)
    public PipelineScheduleVariable(String name, PipelineScheduleVariableArgs args, CustomResourceOptions options)
    
    type: gitlab:PipelineScheduleVariable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args PipelineScheduleVariableArgs
    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 PipelineScheduleVariableArgs
    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 PipelineScheduleVariableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PipelineScheduleVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PipelineScheduleVariableArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PipelineScheduleVariable Resource Properties

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

    Inputs

    The PipelineScheduleVariable resource accepts the following input properties:

    Key string
    Name of the variable.
    PipelineScheduleId int
    The id of the pipeline schedule.
    Project string
    The id of the project to add the schedule to.
    Value string
    Value of the variable.
    Key string
    Name of the variable.
    PipelineScheduleId int
    The id of the pipeline schedule.
    Project string
    The id of the project to add the schedule to.
    Value string
    Value of the variable.
    key String
    Name of the variable.
    pipelineScheduleId Integer
    The id of the pipeline schedule.
    project String
    The id of the project to add the schedule to.
    value String
    Value of the variable.
    key string
    Name of the variable.
    pipelineScheduleId number
    The id of the pipeline schedule.
    project string
    The id of the project to add the schedule to.
    value string
    Value of the variable.
    key str
    Name of the variable.
    pipeline_schedule_id int
    The id of the pipeline schedule.
    project str
    The id of the project to add the schedule to.
    value str
    Value of the variable.
    key String
    Name of the variable.
    pipelineScheduleId Number
    The id of the pipeline schedule.
    project String
    The id of the project to add the schedule to.
    value String
    Value of the variable.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PipelineScheduleVariable 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 PipelineScheduleVariable Resource

    Get an existing PipelineScheduleVariable 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?: PipelineScheduleVariableState, opts?: CustomResourceOptions): PipelineScheduleVariable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            pipeline_schedule_id: Optional[int] = None,
            project: Optional[str] = None,
            value: Optional[str] = None) -> PipelineScheduleVariable
    func GetPipelineScheduleVariable(ctx *Context, name string, id IDInput, state *PipelineScheduleVariableState, opts ...ResourceOption) (*PipelineScheduleVariable, error)
    public static PipelineScheduleVariable Get(string name, Input<string> id, PipelineScheduleVariableState? state, CustomResourceOptions? opts = null)
    public static PipelineScheduleVariable get(String name, Output<String> id, PipelineScheduleVariableState 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:
    Key string
    Name of the variable.
    PipelineScheduleId int
    The id of the pipeline schedule.
    Project string
    The id of the project to add the schedule to.
    Value string
    Value of the variable.
    Key string
    Name of the variable.
    PipelineScheduleId int
    The id of the pipeline schedule.
    Project string
    The id of the project to add the schedule to.
    Value string
    Value of the variable.
    key String
    Name of the variable.
    pipelineScheduleId Integer
    The id of the pipeline schedule.
    project String
    The id of the project to add the schedule to.
    value String
    Value of the variable.
    key string
    Name of the variable.
    pipelineScheduleId number
    The id of the pipeline schedule.
    project string
    The id of the project to add the schedule to.
    value string
    Value of the variable.
    key str
    Name of the variable.
    pipeline_schedule_id int
    The id of the pipeline schedule.
    project str
    The id of the project to add the schedule to.
    value str
    Value of the variable.
    key String
    Name of the variable.
    pipelineScheduleId Number
    The id of the pipeline schedule.
    project String
    The id of the project to add the schedule to.
    value String
    Value of the variable.

    Import

    Pipeline schedule variables can be imported using an id made up of project_id:pipeline_schedule_id:key, e.g.

    $ pulumi import gitlab:index/pipelineScheduleVariable:PipelineScheduleVariable example 123456789:13:mykey
    

    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 v6.10.0 published on Monday, Mar 25, 2024 by Pulumi