1. Packages
  2. GitLab
  3. API Docs
  4. PipelineSchedule
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

gitlab.PipelineSchedule

Explore with Pulumi AI

gitlab logo
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

    The gitlab.PipelineSchedule resource allows to manage the lifecycle of a scheduled pipeline.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = new gitlab.PipelineSchedule("example", {
        project: "12345",
        description: "Used to schedule builds",
        ref: "refs/heads/main",
        cron: "0 1 * * *",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.PipelineSchedule("example",
        project="12345",
        description="Used to schedule builds",
        ref="refs/heads/main",
        cron="0 1 * * *")
    
    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.NewPipelineSchedule(ctx, "example", &gitlab.PipelineScheduleArgs{
    			Project:     pulumi.String("12345"),
    			Description: pulumi.String("Used to schedule builds"),
    			Ref:         pulumi.String("refs/heads/main"),
    			Cron:        pulumi.String("0 1 * * *"),
    		})
    		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.PipelineSchedule("example", new()
        {
            Project = "12345",
            Description = "Used to schedule builds",
            Ref = "refs/heads/main",
            Cron = "0 1 * * *",
        });
    
    });
    
    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 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 PipelineSchedule("example", PipelineScheduleArgs.builder()
                .project("12345")
                .description("Used to schedule builds")
                .ref("refs/heads/main")
                .cron("0 1 * * *")
                .build());
    
        }
    }
    
    resources:
      example:
        type: gitlab:PipelineSchedule
        properties:
          project: '12345'
          description: Used to schedule builds
          ref: refs/heads/main
          cron: 0 1 * * *
    

    Create PipelineSchedule Resource

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

    Constructor syntax

    new PipelineSchedule(name: string, args: PipelineScheduleArgs, opts?: CustomResourceOptions);
    @overload
    def PipelineSchedule(resource_name: str,
                         args: PipelineScheduleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def PipelineSchedule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cron: Optional[str] = None,
                         description: Optional[str] = None,
                         project: Optional[str] = None,
                         ref: Optional[str] = None,
                         active: Optional[bool] = None,
                         cron_timezone: Optional[str] = None,
                         take_ownership: Optional[bool] = None)
    func NewPipelineSchedule(ctx *Context, name string, args PipelineScheduleArgs, opts ...ResourceOption) (*PipelineSchedule, error)
    public PipelineSchedule(string name, PipelineScheduleArgs args, CustomResourceOptions? opts = null)
    public PipelineSchedule(String name, PipelineScheduleArgs args)
    public PipelineSchedule(String name, PipelineScheduleArgs args, CustomResourceOptions options)
    
    type: gitlab:PipelineSchedule
    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 PipelineScheduleArgs
    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 PipelineScheduleArgs
    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 PipelineScheduleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PipelineScheduleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PipelineScheduleArgs
    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 pipelineScheduleResource = new GitLab.PipelineSchedule("pipelineScheduleResource", new()
    {
        Cron = "string",
        Description = "string",
        Project = "string",
        Ref = "string",
        Active = false,
        CronTimezone = "string",
        TakeOwnership = false,
    });
    
    example, err := gitlab.NewPipelineSchedule(ctx, "pipelineScheduleResource", &gitlab.PipelineScheduleArgs{
    	Cron:          pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	Project:       pulumi.String("string"),
    	Ref:           pulumi.String("string"),
    	Active:        pulumi.Bool(false),
    	CronTimezone:  pulumi.String("string"),
    	TakeOwnership: pulumi.Bool(false),
    })
    
    var pipelineScheduleResource = new PipelineSchedule("pipelineScheduleResource", PipelineScheduleArgs.builder()
        .cron("string")
        .description("string")
        .project("string")
        .ref("string")
        .active(false)
        .cronTimezone("string")
        .takeOwnership(false)
        .build());
    
    pipeline_schedule_resource = gitlab.PipelineSchedule("pipelineScheduleResource",
        cron="string",
        description="string",
        project="string",
        ref="string",
        active=False,
        cron_timezone="string",
        take_ownership=False)
    
    const pipelineScheduleResource = new gitlab.PipelineSchedule("pipelineScheduleResource", {
        cron: "string",
        description: "string",
        project: "string",
        ref: "string",
        active: false,
        cronTimezone: "string",
        takeOwnership: false,
    });
    
    type: gitlab:PipelineSchedule
    properties:
        active: false
        cron: string
        cronTimezone: string
        description: string
        project: string
        ref: string
        takeOwnership: false
    

    PipelineSchedule 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 PipelineSchedule resource accepts the following input properties:

    Cron string
    The cron (e.g. 0 1 * * *).
    Description string
    The description of the pipeline schedule.
    Project string
    The name or id of the project to add the schedule to.
    Ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    Active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    CronTimezone string
    The timezone.
    TakeOwnership bool
    Cron string
    The cron (e.g. 0 1 * * *).
    Description string
    The description of the pipeline schedule.
    Project string
    The name or id of the project to add the schedule to.
    Ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    Active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    CronTimezone string
    The timezone.
    TakeOwnership bool
    cron String
    The cron (e.g. 0 1 * * *).
    description String
    The description of the pipeline schedule.
    project String
    The name or id of the project to add the schedule to.
    ref String
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    active Boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cronTimezone String
    The timezone.
    takeOwnership Boolean
    cron string
    The cron (e.g. 0 1 * * *).
    description string
    The description of the pipeline schedule.
    project string
    The name or id of the project to add the schedule to.
    ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    active boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cronTimezone string
    The timezone.
    takeOwnership boolean
    cron str
    The cron (e.g. 0 1 * * *).
    description str
    The description of the pipeline schedule.
    project str
    The name or id of the project to add the schedule to.
    ref str
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cron_timezone str
    The timezone.
    take_ownership bool
    cron String
    The cron (e.g. 0 1 * * *).
    description String
    The description of the pipeline schedule.
    project String
    The name or id of the project to add the schedule to.
    ref String
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    active Boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cronTimezone String
    The timezone.
    takeOwnership Boolean

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Owner int
    The ID of the user that owns the pipeline schedule.
    PipelineScheduleId int
    The pipeline schedule id.
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner int
    The ID of the user that owns the pipeline schedule.
    PipelineScheduleId int
    The pipeline schedule id.
    id String
    The provider-assigned unique ID for this managed resource.
    owner Integer
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId Integer
    The pipeline schedule id.
    id string
    The provider-assigned unique ID for this managed resource.
    owner number
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId number
    The pipeline schedule id.
    id str
    The provider-assigned unique ID for this managed resource.
    owner int
    The ID of the user that owns the pipeline schedule.
    pipeline_schedule_id int
    The pipeline schedule id.
    id String
    The provider-assigned unique ID for this managed resource.
    owner Number
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId Number
    The pipeline schedule id.

    Look up Existing PipelineSchedule Resource

    Get an existing PipelineSchedule 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?: PipelineScheduleState, opts?: CustomResourceOptions): PipelineSchedule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            cron: Optional[str] = None,
            cron_timezone: Optional[str] = None,
            description: Optional[str] = None,
            owner: Optional[int] = None,
            pipeline_schedule_id: Optional[int] = None,
            project: Optional[str] = None,
            ref: Optional[str] = None,
            take_ownership: Optional[bool] = None) -> PipelineSchedule
    func GetPipelineSchedule(ctx *Context, name string, id IDInput, state *PipelineScheduleState, opts ...ResourceOption) (*PipelineSchedule, error)
    public static PipelineSchedule Get(string name, Input<string> id, PipelineScheduleState? state, CustomResourceOptions? opts = null)
    public static PipelineSchedule get(String name, Output<String> id, PipelineScheduleState 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:
    Active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    Cron string
    The cron (e.g. 0 1 * * *).
    CronTimezone string
    The timezone.
    Description string
    The description of the pipeline schedule.
    Owner int
    The ID of the user that owns the pipeline schedule.
    PipelineScheduleId int
    The pipeline schedule id.
    Project string
    The name or id of the project to add the schedule to.
    Ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    TakeOwnership bool
    Active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    Cron string
    The cron (e.g. 0 1 * * *).
    CronTimezone string
    The timezone.
    Description string
    The description of the pipeline schedule.
    Owner int
    The ID of the user that owns the pipeline schedule.
    PipelineScheduleId int
    The pipeline schedule id.
    Project string
    The name or id of the project to add the schedule to.
    Ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    TakeOwnership bool
    active Boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cron String
    The cron (e.g. 0 1 * * *).
    cronTimezone String
    The timezone.
    description String
    The description of the pipeline schedule.
    owner Integer
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId Integer
    The pipeline schedule id.
    project String
    The name or id of the project to add the schedule to.
    ref String
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    takeOwnership Boolean
    active boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cron string
    The cron (e.g. 0 1 * * *).
    cronTimezone string
    The timezone.
    description string
    The description of the pipeline schedule.
    owner number
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId number
    The pipeline schedule id.
    project string
    The name or id of the project to add the schedule to.
    ref string
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    takeOwnership boolean
    active bool
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cron str
    The cron (e.g. 0 1 * * *).
    cron_timezone str
    The timezone.
    description str
    The description of the pipeline schedule.
    owner int
    The ID of the user that owns the pipeline schedule.
    pipeline_schedule_id int
    The pipeline schedule id.
    project str
    The name or id of the project to add the schedule to.
    ref str
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    take_ownership bool
    active Boolean
    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially.
    cron String
    The cron (e.g. 0 1 * * *).
    cronTimezone String
    The timezone.
    description String
    The description of the pipeline schedule.
    owner Number
    The ID of the user that owns the pipeline schedule.
    pipelineScheduleId Number
    The pipeline schedule id.
    project String
    The name or id of the project to add the schedule to.
    ref String
    The branch/tag name to be triggered. This must be the full branch reference, for example: refs/heads/main, not main.
    takeOwnership Boolean

    Import

    GitLab pipeline schedules can be imported using an id made up of {project_id}:{pipeline_schedule_id}, e.g.

    $ pulumi import gitlab:index/pipelineSchedule:PipelineSchedule test 1:3
    

    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.1.0 published on Friday, Jun 21, 2024 by Pulumi