1. Packages
  2. Gitlab Provider
  3. API Docs
  4. PipelineTrigger
GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi

gitlab.PipelineTrigger

Explore with Pulumi AI

The gitlab.PipelineTrigger resource allows to manage the lifecycle of a pipeline trigger.

Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = new gitlab.PipelineTrigger("example", {
    project: "12345",
    description: "Used to trigger builds",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.PipelineTrigger("example",
    project="12345",
    description="Used to trigger builds")
Copy
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.NewPipelineTrigger(ctx, "example", &gitlab.PipelineTriggerArgs{
			Project:     pulumi.String("12345"),
			Description: pulumi.String("Used to trigger builds"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var example = new GitLab.PipelineTrigger("example", new()
    {
        Project = "12345",
        Description = "Used to trigger builds",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.PipelineTrigger;
import com.pulumi.gitlab.PipelineTriggerArgs;
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 PipelineTrigger("example", PipelineTriggerArgs.builder()
            .project("12345")
            .description("Used to trigger builds")
            .build());

    }
}
Copy
resources:
  example:
    type: gitlab:PipelineTrigger
    properties:
      project: '12345'
      description: Used to trigger builds
Copy

Create PipelineTrigger Resource

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

Constructor syntax

new PipelineTrigger(name: string, args: PipelineTriggerArgs, opts?: CustomResourceOptions);
@overload
def PipelineTrigger(resource_name: str,
                    args: PipelineTriggerArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def PipelineTrigger(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    description: Optional[str] = None,
                    project: Optional[str] = None)
func NewPipelineTrigger(ctx *Context, name string, args PipelineTriggerArgs, opts ...ResourceOption) (*PipelineTrigger, error)
public PipelineTrigger(string name, PipelineTriggerArgs args, CustomResourceOptions? opts = null)
public PipelineTrigger(String name, PipelineTriggerArgs args)
public PipelineTrigger(String name, PipelineTriggerArgs args, CustomResourceOptions options)
type: gitlab:PipelineTrigger
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PipelineTriggerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PipelineTriggerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PipelineTriggerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PipelineTriggerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PipelineTriggerArgs
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 pipelineTriggerResource = new GitLab.PipelineTrigger("pipelineTriggerResource", new()
{
    Description = "string",
    Project = "string",
});
Copy
example, err := gitlab.NewPipelineTrigger(ctx, "pipelineTriggerResource", &gitlab.PipelineTriggerArgs{
	Description: pulumi.String("string"),
	Project:     pulumi.String("string"),
})
Copy
var pipelineTriggerResource = new PipelineTrigger("pipelineTriggerResource", PipelineTriggerArgs.builder()
    .description("string")
    .project("string")
    .build());
Copy
pipeline_trigger_resource = gitlab.PipelineTrigger("pipelineTriggerResource",
    description="string",
    project="string")
Copy
const pipelineTriggerResource = new gitlab.PipelineTrigger("pipelineTriggerResource", {
    description: "string",
    project: "string",
});
Copy
type: gitlab:PipelineTrigger
properties:
    description: string
    project: string
Copy

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

Description This property is required. string
The description of the pipeline trigger.
Project
This property is required.
Changes to this property will trigger replacement.
string
The name or id of the project to add the trigger to.
Description This property is required. string
The description of the pipeline trigger.
Project
This property is required.
Changes to this property will trigger replacement.
string
The name or id of the project to add the trigger to.
description This property is required. String
The description of the pipeline trigger.
project
This property is required.
Changes to this property will trigger replacement.
String
The name or id of the project to add the trigger to.
description This property is required. string
The description of the pipeline trigger.
project
This property is required.
Changes to this property will trigger replacement.
string
The name or id of the project to add the trigger to.
description This property is required. str
The description of the pipeline trigger.
project
This property is required.
Changes to this property will trigger replacement.
str
The name or id of the project to add the trigger to.
description This property is required. String
The description of the pipeline trigger.
project
This property is required.
Changes to this property will trigger replacement.
String
The name or id of the project to add the trigger to.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
PipelineTriggerId int
The pipeline trigger id.
Token string
The pipeline trigger token. This value is not available during import.
Id string
The provider-assigned unique ID for this managed resource.
PipelineTriggerId int
The pipeline trigger id.
Token string
The pipeline trigger token. This value is not available during import.
id String
The provider-assigned unique ID for this managed resource.
pipelineTriggerId Integer
The pipeline trigger id.
token String
The pipeline trigger token. This value is not available during import.
id string
The provider-assigned unique ID for this managed resource.
pipelineTriggerId number
The pipeline trigger id.
token string
The pipeline trigger token. This value is not available during import.
id str
The provider-assigned unique ID for this managed resource.
pipeline_trigger_id int
The pipeline trigger id.
token str
The pipeline trigger token. This value is not available during import.
id String
The provider-assigned unique ID for this managed resource.
pipelineTriggerId Number
The pipeline trigger id.
token String
The pipeline trigger token. This value is not available during import.

Look up Existing PipelineTrigger Resource

Get an existing PipelineTrigger 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?: PipelineTriggerState, opts?: CustomResourceOptions): PipelineTrigger
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        pipeline_trigger_id: Optional[int] = None,
        project: Optional[str] = None,
        token: Optional[str] = None) -> PipelineTrigger
func GetPipelineTrigger(ctx *Context, name string, id IDInput, state *PipelineTriggerState, opts ...ResourceOption) (*PipelineTrigger, error)
public static PipelineTrigger Get(string name, Input<string> id, PipelineTriggerState? state, CustomResourceOptions? opts = null)
public static PipelineTrigger get(String name, Output<String> id, PipelineTriggerState state, CustomResourceOptions options)
resources:  _:    type: gitlab:PipelineTrigger    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 pipeline trigger.
PipelineTriggerId int
The pipeline trigger id.
Project Changes to this property will trigger replacement. string
The name or id of the project to add the trigger to.
Token string
The pipeline trigger token. This value is not available during import.
Description string
The description of the pipeline trigger.
PipelineTriggerId int
The pipeline trigger id.
Project Changes to this property will trigger replacement. string
The name or id of the project to add the trigger to.
Token string
The pipeline trigger token. This value is not available during import.
description String
The description of the pipeline trigger.
pipelineTriggerId Integer
The pipeline trigger id.
project Changes to this property will trigger replacement. String
The name or id of the project to add the trigger to.
token String
The pipeline trigger token. This value is not available during import.
description string
The description of the pipeline trigger.
pipelineTriggerId number
The pipeline trigger id.
project Changes to this property will trigger replacement. string
The name or id of the project to add the trigger to.
token string
The pipeline trigger token. This value is not available during import.
description str
The description of the pipeline trigger.
pipeline_trigger_id int
The pipeline trigger id.
project Changes to this property will trigger replacement. str
The name or id of the project to add the trigger to.
token str
The pipeline trigger token. This value is not available during import.
description String
The description of the pipeline trigger.
pipelineTriggerId Number
The pipeline trigger id.
project Changes to this property will trigger replacement. String
The name or id of the project to add the trigger to.
token String
The pipeline trigger token. This value is not available during import.

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_pipeline_trigger. For example:

terraform

import {

to = gitlab_pipeline_trigger.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

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

$ pulumi import gitlab:index/pipelineTrigger:PipelineTrigger test 1:3
Copy

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.