1. Packages
  2. Gitlab Provider
  3. API Docs
  4. SystemHook
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

gitlab.SystemHook

Explore with Pulumi AI

gitlab logo
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

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

    This resource requires GitLab 14.9

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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 string
    The unique name of the resource.
    args SystemHookArgs
    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 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 string
    The unique name of the resource.
    args SystemHookArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SystemHookArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    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"),
    })
    
    var systemHookResource = new SystemHook("systemHookResource", SystemHookArgs.builder()
        .url("string")
        .enableSslVerification(false)
        .mergeRequestsEvents(false)
        .pushEvents(false)
        .repositoryUpdateEvents(false)
        .tagPushEvents(false)
        .token("string")
        .build());
    
    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")
    
    const systemHookResource = new gitlab.SystemHook("systemHookResource", {
        url: "string",
        enableSslVerification: false,
        mergeRequestsEvents: false,
        pushEvents: false,
        repositoryUpdateEvents: false,
        tagPushEvents: false,
        token: "string",
    });
    
    type: gitlab:SystemHook
    properties:
        enableSslVerification: false
        mergeRequestsEvents: false
        pushEvents: false
        repositoryUpdateEvents: false
        tagPushEvents: false
        token: string
        url: string
    

    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

    The SystemHook resource accepts the following input properties:

    Url string
    The hook URL.
    EnableSslVerification bool
    Do SSL verification when triggering the hook.
    MergeRequestsEvents bool
    Trigger hook on merge requests events.
    PushEvents bool
    When true, the hook fires on push events.
    RepositoryUpdateEvents bool
    Trigger hook on repository update events.
    TagPushEvents bool
    When true, the hook fires on new tags being pushed.
    Token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    Url string
    The hook URL.
    EnableSslVerification bool
    Do SSL verification when triggering the hook.
    MergeRequestsEvents bool
    Trigger hook on merge requests events.
    PushEvents bool
    When true, the hook fires on push events.
    RepositoryUpdateEvents bool
    Trigger hook on repository update events.
    TagPushEvents bool
    When true, the hook fires on new tags being pushed.
    Token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url String
    The hook URL.
    enableSslVerification Boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents Boolean
    Trigger hook on merge requests events.
    pushEvents Boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents Boolean
    Trigger hook on repository update events.
    tagPushEvents Boolean
    When true, the hook fires on new tags being pushed.
    token String
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url string
    The hook URL.
    enableSslVerification boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents boolean
    Trigger hook on merge requests events.
    pushEvents boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents boolean
    Trigger hook on repository update events.
    tagPushEvents boolean
    When true, the hook fires on new tags being pushed.
    token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url str
    The hook URL.
    enable_ssl_verification bool
    Do SSL verification when triggering the hook.
    merge_requests_events bool
    Trigger hook on merge requests events.
    push_events bool
    When true, the hook fires on push events.
    repository_update_events bool
    Trigger hook on repository update events.
    tag_push_events bool
    When true, the hook fires on new tags being pushed.
    token str
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url String
    The hook URL.
    enableSslVerification Boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents Boolean
    Trigger hook on merge requests events.
    pushEvents Boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents Boolean
    Trigger hook on repository update events.
    tagPushEvents Boolean
    When true, the hook fires on new tags being pushed.
    token 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)
    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:
    CreatedAt string
    The date and time the hook was created in ISO8601 format.
    EnableSslVerification bool
    Do SSL verification when triggering the hook.
    MergeRequestsEvents bool
    Trigger hook on merge requests events.
    PushEvents bool
    When true, the hook fires on push events.
    RepositoryUpdateEvents bool
    Trigger hook on repository update events.
    TagPushEvents bool
    When true, the hook fires on new tags being pushed.
    Token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    Url string
    The hook URL.
    CreatedAt string
    The date and time the hook was created in ISO8601 format.
    EnableSslVerification bool
    Do SSL verification when triggering the hook.
    MergeRequestsEvents bool
    Trigger hook on merge requests events.
    PushEvents bool
    When true, the hook fires on push events.
    RepositoryUpdateEvents bool
    Trigger hook on repository update events.
    TagPushEvents bool
    When true, the hook fires on new tags being pushed.
    Token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    Url string
    The hook URL.
    createdAt String
    The date and time the hook was created in ISO8601 format.
    enableSslVerification Boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents Boolean
    Trigger hook on merge requests events.
    pushEvents Boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents Boolean
    Trigger hook on repository update events.
    tagPushEvents Boolean
    When true, the hook fires on new tags being pushed.
    token String
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url String
    The hook URL.
    createdAt string
    The date and time the hook was created in ISO8601 format.
    enableSslVerification boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents boolean
    Trigger hook on merge requests events.
    pushEvents boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents boolean
    Trigger hook on repository update events.
    tagPushEvents boolean
    When true, the hook fires on new tags being pushed.
    token string
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url string
    The hook URL.
    created_at str
    The date and time the hook was created in ISO8601 format.
    enable_ssl_verification bool
    Do SSL verification when triggering the hook.
    merge_requests_events bool
    Trigger hook on merge requests events.
    push_events bool
    When true, the hook fires on push events.
    repository_update_events bool
    Trigger hook on repository update events.
    tag_push_events bool
    When true, the hook fires on new tags being pushed.
    token str
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url str
    The hook URL.
    createdAt String
    The date and time the hook was created in ISO8601 format.
    enableSslVerification Boolean
    Do SSL verification when triggering the hook.
    mergeRequestsEvents Boolean
    Trigger hook on merge requests events.
    pushEvents Boolean
    When true, the hook fires on push events.
    repositoryUpdateEvents Boolean
    Trigger hook on repository update events.
    tagPushEvents Boolean
    When true, the hook fires on new tags being pushed.
    token String
    Secret token to validate received payloads; this isn’t returned in the response. This attribute is not available for imported resources.
    url String
    The hook URL.

    Import

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

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

    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.
    gitlab logo
    GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi