1. Packages
  2. Gitlab Provider
  3. API Docs
  4. SystemHook
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.SystemHook

Explore with Pulumi AI

The gitlab.SystemHook resource allows to manage the lifecycle of a system hook.

Upstream API: GitLab REST API docs

Example Usage

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

const example = new gitlab.SystemHook("example", {
    url: "https://example.com/hook-%d",
    token: "secret-token",
    pushEvents: true,
    tagPushEvents: true,
    mergeRequestsEvents: true,
    repositoryUpdateEvents: true,
    enableSslVerification: true,
});
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.SystemHook("example",
    url="https://example.com/hook-%d",
    token="secret-token",
    push_events=True,
    tag_push_events=True,
    merge_requests_events=True,
    repository_update_events=True,
    enable_ssl_verification=True)
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.NewSystemHook(ctx, "example", &gitlab.SystemHookArgs{
			Url:                    pulumi.String("https://example.com/hook-%d"),
			Token:                  pulumi.String("secret-token"),
			PushEvents:             pulumi.Bool(true),
			TagPushEvents:          pulumi.Bool(true),
			MergeRequestsEvents:    pulumi.Bool(true),
			RepositoryUpdateEvents: pulumi.Bool(true),
			EnableSslVerification:  pulumi.Bool(true),
		})
		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.SystemHook("example", new()
    {
        Url = "https://example.com/hook-%d",
        Token = "secret-token",
        PushEvents = true,
        TagPushEvents = true,
        MergeRequestsEvents = true,
        RepositoryUpdateEvents = true,
        EnableSslVerification = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.SystemHook;
import com.pulumi.gitlab.SystemHookArgs;
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 SystemHook("example", SystemHookArgs.builder()
            .url("https://example.com/hook-%d")
            .token("secret-token")
            .pushEvents(true)
            .tagPushEvents(true)
            .mergeRequestsEvents(true)
            .repositoryUpdateEvents(true)
            .enableSslVerification(true)
            .build());

    }
}
Copy
resources:
  example:
    type: gitlab:SystemHook
    properties:
      url: https://example.com/hook-%d
      token: secret-token
      pushEvents: true
      tagPushEvents: true
      mergeRequestsEvents: true
      repositoryUpdateEvents: true
      enableSslVerification: true
Copy

Create SystemHook Resource

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

Constructor syntax

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

@overload
def SystemHook(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               url: Optional[str] = None,
               enable_ssl_verification: Optional[bool] = None,
               merge_requests_events: Optional[bool] = None,
               push_events: Optional[bool] = None,
               repository_update_events: Optional[bool] = None,
               tag_push_events: Optional[bool] = None,
               token: Optional[str] = None)
func NewSystemHook(ctx *Context, name string, args SystemHookArgs, opts ...ResourceOption) (*SystemHook, error)
public SystemHook(string name, SystemHookArgs args, CustomResourceOptions? opts = null)
public SystemHook(String name, SystemHookArgs args)
public SystemHook(String name, SystemHookArgs args, CustomResourceOptions options)
type: gitlab:SystemHook
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. SystemHookArgs
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. SystemHookArgs
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. SystemHookArgs
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. SystemHookArgs
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. SystemHookArgs
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 systemHookResource = new GitLab.SystemHook("systemHookResource", new()
{
    Url = "string",
    EnableSslVerification = false,
    MergeRequestsEvents = false,
    PushEvents = false,
    RepositoryUpdateEvents = false,
    TagPushEvents = false,
    Token = "string",
});
Copy
example, err := gitlab.NewSystemHook(ctx, "systemHookResource", &gitlab.SystemHookArgs{
	Url:                    pulumi.String("string"),
	EnableSslVerification:  pulumi.Bool(false),
	MergeRequestsEvents:    pulumi.Bool(false),
	PushEvents:             pulumi.Bool(false),
	RepositoryUpdateEvents: pulumi.Bool(false),
	TagPushEvents:          pulumi.Bool(false),
	Token:                  pulumi.String("string"),
})
Copy
var systemHookResource = new SystemHook("systemHookResource", SystemHookArgs.builder()
    .url("string")
    .enableSslVerification(false)
    .mergeRequestsEvents(false)
    .pushEvents(false)
    .repositoryUpdateEvents(false)
    .tagPushEvents(false)
    .token("string")
    .build());
Copy
system_hook_resource = gitlab.SystemHook("systemHookResource",
    url="string",
    enable_ssl_verification=False,
    merge_requests_events=False,
    push_events=False,
    repository_update_events=False,
    tag_push_events=False,
    token="string")
Copy
const systemHookResource = new gitlab.SystemHook("systemHookResource", {
    url: "string",
    enableSslVerification: false,
    mergeRequestsEvents: false,
    pushEvents: false,
    repositoryUpdateEvents: false,
    tagPushEvents: false,
    token: "string",
});
Copy
type: gitlab:SystemHook
properties:
    enableSslVerification: false
    mergeRequestsEvents: false
    pushEvents: false
    repositoryUpdateEvents: false
    tagPushEvents: false
    token: string
    url: string
Copy

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

Url
This property is required.
Changes to this property will trigger replacement.
string
The hook URL.
EnableSslVerification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
MergeRequestsEvents Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
PushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
RepositoryUpdateEvents Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
TagPushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
Token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
Url
This property is required.
Changes to this property will trigger replacement.
string
The hook URL.
EnableSslVerification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
MergeRequestsEvents Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
PushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
RepositoryUpdateEvents Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
TagPushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
Token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url
This property is required.
Changes to this property will trigger replacement.
String
The hook URL.
enableSslVerification Changes to this property will trigger replacement. Boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. Boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. Boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. String
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url
This property is required.
Changes to this property will trigger replacement.
string
The hook URL.
enableSslVerification Changes to this property will trigger replacement. boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url
This property is required.
Changes to this property will trigger replacement.
str
The hook URL.
enable_ssl_verification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
merge_requests_events Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
push_events Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
repository_update_events Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
tag_push_events Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. str
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url
This property is required.
Changes to this property will trigger replacement.
String
The hook URL.
enableSslVerification Changes to this property will trigger replacement. Boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. Boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. Boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. String
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.

Outputs

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

CreatedAt string
The date and time the hook was created in ISO8601 format.
Id string
The provider-assigned unique ID for this managed resource.
CreatedAt string
The date and time the hook was created in ISO8601 format.
Id string
The provider-assigned unique ID for this managed resource.
createdAt String
The date and time the hook was created in ISO8601 format.
id String
The provider-assigned unique ID for this managed resource.
createdAt string
The date and time the hook was created in ISO8601 format.
id string
The provider-assigned unique ID for this managed resource.
created_at str
The date and time the hook was created in ISO8601 format.
id str
The provider-assigned unique ID for this managed resource.
createdAt String
The date and time the hook was created in ISO8601 format.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SystemHook Resource

Get an existing SystemHook 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?: SystemHookState, opts?: CustomResourceOptions): SystemHook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        enable_ssl_verification: Optional[bool] = None,
        merge_requests_events: Optional[bool] = None,
        push_events: Optional[bool] = None,
        repository_update_events: Optional[bool] = None,
        tag_push_events: Optional[bool] = None,
        token: Optional[str] = None,
        url: Optional[str] = None) -> SystemHook
func GetSystemHook(ctx *Context, name string, id IDInput, state *SystemHookState, opts ...ResourceOption) (*SystemHook, error)
public static SystemHook Get(string name, Input<string> id, SystemHookState? state, CustomResourceOptions? opts = null)
public static SystemHook get(String name, Output<String> id, SystemHookState state, CustomResourceOptions options)
resources:  _:    type: gitlab:SystemHook    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:
CreatedAt string
The date and time the hook was created in ISO8601 format.
EnableSslVerification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
MergeRequestsEvents Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
PushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
RepositoryUpdateEvents Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
TagPushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
Token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
Url Changes to this property will trigger replacement. string
The hook URL.
CreatedAt string
The date and time the hook was created in ISO8601 format.
EnableSslVerification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
MergeRequestsEvents Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
PushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
RepositoryUpdateEvents Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
TagPushEvents Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
Token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
Url Changes to this property will trigger replacement. string
The hook URL.
createdAt String
The date and time the hook was created in ISO8601 format.
enableSslVerification Changes to this property will trigger replacement. Boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. Boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. Boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. String
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url Changes to this property will trigger replacement. String
The hook URL.
createdAt string
The date and time the hook was created in ISO8601 format.
enableSslVerification Changes to this property will trigger replacement. boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. string
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url Changes to this property will trigger replacement. string
The hook URL.
created_at str
The date and time the hook was created in ISO8601 format.
enable_ssl_verification Changes to this property will trigger replacement. bool
Do SSL verification when triggering the hook.
merge_requests_events Changes to this property will trigger replacement. bool
Trigger hook on merge requests events.
push_events Changes to this property will trigger replacement. bool
When true, the hook fires on push events.
repository_update_events Changes to this property will trigger replacement. bool
Trigger hook on repository update events.
tag_push_events Changes to this property will trigger replacement. bool
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. str
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url Changes to this property will trigger replacement. str
The hook URL.
createdAt String
The date and time the hook was created in ISO8601 format.
enableSslVerification Changes to this property will trigger replacement. Boolean
Do SSL verification when triggering the hook.
mergeRequestsEvents Changes to this property will trigger replacement. Boolean
Trigger hook on merge requests events.
pushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on push events.
repositoryUpdateEvents Changes to this property will trigger replacement. Boolean
Trigger hook on repository update events.
tagPushEvents Changes to this property will trigger replacement. Boolean
When true, the hook fires on new tags being pushed.
token Changes to this property will trigger replacement. String
Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
url Changes to this property will trigger replacement. String
The hook URL.

Import

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

terraform

import {

to = gitlab_system_hook.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

You can import a system hook using the hook id {hook-id}, e.g.

$ pulumi import gitlab:index/systemHook:SystemHook example 42
Copy

NOTE: the token attribute won’t be available for imported resources.

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.