1. Packages
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. getProjectHook
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi

    The gitlab.ProjectHook data source retrieves details about a hook in a project.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = gitlab.getProject({
        id: "foo/bar/baz",
    });
    const exampleGetProjectHook = example.then(example => gitlab.getProjectHook({
        project: example.id,
        hookId: 1,
    }));
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.get_project(id="foo/bar/baz")
    example_get_project_hook = gitlab.get_project_hook(project=example.id,
        hook_id=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := gitlab.GetProject(ctx, &gitlab.LookupProjectArgs{
    			Id: pulumi.StringRef("foo/bar/baz"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.GetProjectHook(ctx, &gitlab.LookupProjectHookArgs{
    			Project: example.Id,
    			HookId:  1,
    		}, nil)
    		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 = GitLab.GetProject.Invoke(new()
        {
            Id = "foo/bar/baz",
        });
    
        var exampleGetProjectHook = GitLab.GetProjectHook.Invoke(new()
        {
            Project = example.Apply(getProjectResult => getProjectResult.Id),
            HookId = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GitlabFunctions;
    import com.pulumi.gitlab.inputs.GetProjectArgs;
    import com.pulumi.gitlab.inputs.GetProjectHookArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var example = GitlabFunctions.getProject(GetProjectArgs.builder()
                .id("foo/bar/baz")
                .build());
    
            final var exampleGetProjectHook = GitlabFunctions.getProjectHook(GetProjectHookArgs.builder()
                .project(example.id())
                .hookId(1)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: gitlab:getProject
          arguments:
            id: foo/bar/baz
      exampleGetProjectHook:
        fn::invoke:
          function: gitlab:getProjectHook
          arguments:
            project: ${example.id}
            hookId: 1
    
    pulumi {
      required_providers {
        gitlab = {
          source = "pulumi/gitlab"
        }
      }
    }
    
    data "gitlab_getproject" "example" {
      id = "foo/bar/baz"
    }
    data "gitlab_getprojecthook" "exampleGetProjectHook" {
      project = data.gitlab_getproject.example.id
      hook_id = 1
    }
    

    Using getProjectHook

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProjectHook(args: GetProjectHookArgs, opts?: InvokeOptions): Promise<GetProjectHookResult>
    function getProjectHookOutput(args: GetProjectHookOutputArgs, opts?: InvokeOptions): Output<GetProjectHookResult>
    def get_project_hook(hook_id: Optional[int] = None,
                         project: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetProjectHookResult
    def get_project_hook_output(hook_id: pulumi.Input[Optional[int]] = None,
                         project: pulumi.Input[Optional[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetProjectHookResult]
    func LookupProjectHook(ctx *Context, args *LookupProjectHookArgs, opts ...InvokeOption) (*LookupProjectHookResult, error)
    func LookupProjectHookOutput(ctx *Context, args *LookupProjectHookOutputArgs, opts ...InvokeOption) LookupProjectHookResultOutput

    > Note: This function is named LookupProjectHook in the Go SDK.

    public static class GetProjectHook 
    {
        public static Task<GetProjectHookResult> InvokeAsync(GetProjectHookArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectHookResult> Invoke(GetProjectHookInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectHookResult> getProjectHook(GetProjectHookArgs args, InvokeOptions options)
    public static Output<GetProjectHookResult> getProjectHook(GetProjectHookArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getProjectHook:getProjectHook
      arguments:
        # arguments dictionary
    data "gitlab_getprojecthook" "name" {
        # arguments
    }

    The following arguments are supported:

    HookId int
    The id of the project hook.
    Project string
    The name or id of the project to add the hook to.
    HookId int
    The id of the project hook.
    Project string
    The name or id of the project to add the hook to.
    hook_id number
    The id of the project hook.
    project string
    The name or id of the project to add the hook to.
    hookId Integer
    The id of the project hook.
    project String
    The name or id of the project to add the hook to.
    hookId number
    The id of the project hook.
    project string
    The name or id of the project to add the hook to.
    hook_id int
    The id of the project hook.
    project str
    The name or id of the project to add the hook to.
    hookId Number
    The id of the project hook.
    project String
    The name or id of the project to add the hook to.

    getProjectHook Result

    The following output properties are available:

    AlertStatus string
    Lifecycle status of the webhook. Values include executable and disabled.
    BranchFilterStrategy string
    Filter push events by branch.
    ConfidentialIssuesEvents bool
    Invoke the hook for confidential issues events.
    ConfidentialNoteEvents bool
    Invoke the hook for confidential notes events.
    CreatedAt string
    The date and time the hook was created in ISO8601 format.
    CustomWebhookTemplate string
    Set a custom webhook template.
    DeploymentEvents bool
    Invoke the hook for deployment events.
    DisabledUntil string
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    EmojiEvents bool
    Invoke the hook for emoji events.
    EnableSslVerification bool
    Enable ssl verification when invoking the hook.
    FeatureFlagEvents bool
    Invoke the hook for feature flag events.
    HookId int
    The id of the project hook.
    Id string
    The ID of this datasource. In the format <project>:<hook-id>.
    IssuesEvents bool
    Invoke the hook for issues events.
    JobEvents bool
    Invoke the hook for job events.
    MergeRequestsEvents bool
    Invoke the hook for merge requests.
    MilestoneEvents bool
    Invoke the hook for milestone events.
    NoteEvents bool
    Invoke the hook for notes events.
    PipelineEvents bool
    Invoke the hook for pipeline events.
    Project string
    The name or id of the project to add the hook to.
    ProjectId int
    The id of the project for the hook.
    PushEvents bool
    Invoke the hook for push events.
    PushEventsBranchFilter string
    Invoke the hook for push events on matching branches only.
    ReleasesEvents bool
    Invoke the hook for releases events.
    RepositoryUpdateEvents bool
    Invoke the hook for repository update events.
    ResourceAccessTokenEvents bool
    Invoke the hook for project access token expiry events.
    ResourceDeployTokenEvents bool
    Invoke the hook for resource deploy token events.
    SigningTokenPresent bool
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    TagPushEvents bool
    Invoke the hook for tag push events.
    Url string
    The url of the hook to invoke.
    VulnerabilityEvents bool
    Invoke the hook for vulnerability events.
    WikiPageEvents bool
    Invoke the hook for wiki page events.
    AlertStatus string
    Lifecycle status of the webhook. Values include executable and disabled.
    BranchFilterStrategy string
    Filter push events by branch.
    ConfidentialIssuesEvents bool
    Invoke the hook for confidential issues events.
    ConfidentialNoteEvents bool
    Invoke the hook for confidential notes events.
    CreatedAt string
    The date and time the hook was created in ISO8601 format.
    CustomWebhookTemplate string
    Set a custom webhook template.
    DeploymentEvents bool
    Invoke the hook for deployment events.
    DisabledUntil string
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    EmojiEvents bool
    Invoke the hook for emoji events.
    EnableSslVerification bool
    Enable ssl verification when invoking the hook.
    FeatureFlagEvents bool
    Invoke the hook for feature flag events.
    HookId int
    The id of the project hook.
    Id string
    The ID of this datasource. In the format <project>:<hook-id>.
    IssuesEvents bool
    Invoke the hook for issues events.
    JobEvents bool
    Invoke the hook for job events.
    MergeRequestsEvents bool
    Invoke the hook for merge requests.
    MilestoneEvents bool
    Invoke the hook for milestone events.
    NoteEvents bool
    Invoke the hook for notes events.
    PipelineEvents bool
    Invoke the hook for pipeline events.
    Project string
    The name or id of the project to add the hook to.
    ProjectId int
    The id of the project for the hook.
    PushEvents bool
    Invoke the hook for push events.
    PushEventsBranchFilter string
    Invoke the hook for push events on matching branches only.
    ReleasesEvents bool
    Invoke the hook for releases events.
    RepositoryUpdateEvents bool
    Invoke the hook for repository update events.
    ResourceAccessTokenEvents bool
    Invoke the hook for project access token expiry events.
    ResourceDeployTokenEvents bool
    Invoke the hook for resource deploy token events.
    SigningTokenPresent bool
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    TagPushEvents bool
    Invoke the hook for tag push events.
    Url string
    The url of the hook to invoke.
    VulnerabilityEvents bool
    Invoke the hook for vulnerability events.
    WikiPageEvents bool
    Invoke the hook for wiki page events.
    alert_status string
    Lifecycle status of the webhook. Values include executable and disabled.
    branch_filter_strategy string
    Filter push events by branch.
    confidential_issues_events bool
    Invoke the hook for confidential issues events.
    confidential_note_events bool
    Invoke the hook for confidential notes events.
    created_at string
    The date and time the hook was created in ISO8601 format.
    custom_webhook_template string
    Set a custom webhook template.
    deployment_events bool
    Invoke the hook for deployment events.
    disabled_until string
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    emoji_events bool
    Invoke the hook for emoji events.
    enable_ssl_verification bool
    Enable ssl verification when invoking the hook.
    feature_flag_events bool
    Invoke the hook for feature flag events.
    hook_id number
    The id of the project hook.
    id string
    The ID of this datasource. In the format <project>:<hook-id>.
    issues_events bool
    Invoke the hook for issues events.
    job_events bool
    Invoke the hook for job events.
    merge_requests_events bool
    Invoke the hook for merge requests.
    milestone_events bool
    Invoke the hook for milestone events.
    note_events bool
    Invoke the hook for notes events.
    pipeline_events bool
    Invoke the hook for pipeline events.
    project string
    The name or id of the project to add the hook to.
    project_id number
    The id of the project for the hook.
    push_events bool
    Invoke the hook for push events.
    push_events_branch_filter string
    Invoke the hook for push events on matching branches only.
    releases_events bool
    Invoke the hook for releases events.
    repository_update_events bool
    Invoke the hook for repository update events.
    resource_access_token_events bool
    Invoke the hook for project access token expiry events.
    resource_deploy_token_events bool
    Invoke the hook for resource deploy token events.
    signing_token_present bool
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    tag_push_events bool
    Invoke the hook for tag push events.
    url string
    The url of the hook to invoke.
    vulnerability_events bool
    Invoke the hook for vulnerability events.
    wiki_page_events bool
    Invoke the hook for wiki page events.
    alertStatus String
    Lifecycle status of the webhook. Values include executable and disabled.
    branchFilterStrategy String
    Filter push events by branch.
    confidentialIssuesEvents Boolean
    Invoke the hook for confidential issues events.
    confidentialNoteEvents Boolean
    Invoke the hook for confidential notes events.
    createdAt String
    The date and time the hook was created in ISO8601 format.
    customWebhookTemplate String
    Set a custom webhook template.
    deploymentEvents Boolean
    Invoke the hook for deployment events.
    disabledUntil String
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    emojiEvents Boolean
    Invoke the hook for emoji events.
    enableSslVerification Boolean
    Enable ssl verification when invoking the hook.
    featureFlagEvents Boolean
    Invoke the hook for feature flag events.
    hookId Integer
    The id of the project hook.
    id String
    The ID of this datasource. In the format <project>:<hook-id>.
    issuesEvents Boolean
    Invoke the hook for issues events.
    jobEvents Boolean
    Invoke the hook for job events.
    mergeRequestsEvents Boolean
    Invoke the hook for merge requests.
    milestoneEvents Boolean
    Invoke the hook for milestone events.
    noteEvents Boolean
    Invoke the hook for notes events.
    pipelineEvents Boolean
    Invoke the hook for pipeline events.
    project String
    The name or id of the project to add the hook to.
    projectId Integer
    The id of the project for the hook.
    pushEvents Boolean
    Invoke the hook for push events.
    pushEventsBranchFilter String
    Invoke the hook for push events on matching branches only.
    releasesEvents Boolean
    Invoke the hook for releases events.
    repositoryUpdateEvents Boolean
    Invoke the hook for repository update events.
    resourceAccessTokenEvents Boolean
    Invoke the hook for project access token expiry events.
    resourceDeployTokenEvents Boolean
    Invoke the hook for resource deploy token events.
    signingTokenPresent Boolean
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    tagPushEvents Boolean
    Invoke the hook for tag push events.
    url String
    The url of the hook to invoke.
    vulnerabilityEvents Boolean
    Invoke the hook for vulnerability events.
    wikiPageEvents Boolean
    Invoke the hook for wiki page events.
    alertStatus string
    Lifecycle status of the webhook. Values include executable and disabled.
    branchFilterStrategy string
    Filter push events by branch.
    confidentialIssuesEvents boolean
    Invoke the hook for confidential issues events.
    confidentialNoteEvents boolean
    Invoke the hook for confidential notes events.
    createdAt string
    The date and time the hook was created in ISO8601 format.
    customWebhookTemplate string
    Set a custom webhook template.
    deploymentEvents boolean
    Invoke the hook for deployment events.
    disabledUntil string
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    emojiEvents boolean
    Invoke the hook for emoji events.
    enableSslVerification boolean
    Enable ssl verification when invoking the hook.
    featureFlagEvents boolean
    Invoke the hook for feature flag events.
    hookId number
    The id of the project hook.
    id string
    The ID of this datasource. In the format <project>:<hook-id>.
    issuesEvents boolean
    Invoke the hook for issues events.
    jobEvents boolean
    Invoke the hook for job events.
    mergeRequestsEvents boolean
    Invoke the hook for merge requests.
    milestoneEvents boolean
    Invoke the hook for milestone events.
    noteEvents boolean
    Invoke the hook for notes events.
    pipelineEvents boolean
    Invoke the hook for pipeline events.
    project string
    The name or id of the project to add the hook to.
    projectId number
    The id of the project for the hook.
    pushEvents boolean
    Invoke the hook for push events.
    pushEventsBranchFilter string
    Invoke the hook for push events on matching branches only.
    releasesEvents boolean
    Invoke the hook for releases events.
    repositoryUpdateEvents boolean
    Invoke the hook for repository update events.
    resourceAccessTokenEvents boolean
    Invoke the hook for project access token expiry events.
    resourceDeployTokenEvents boolean
    Invoke the hook for resource deploy token events.
    signingTokenPresent boolean
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    tagPushEvents boolean
    Invoke the hook for tag push events.
    url string
    The url of the hook to invoke.
    vulnerabilityEvents boolean
    Invoke the hook for vulnerability events.
    wikiPageEvents boolean
    Invoke the hook for wiki page events.
    alert_status str
    Lifecycle status of the webhook. Values include executable and disabled.
    branch_filter_strategy str
    Filter push events by branch.
    confidential_issues_events bool
    Invoke the hook for confidential issues events.
    confidential_note_events bool
    Invoke the hook for confidential notes events.
    created_at str
    The date and time the hook was created in ISO8601 format.
    custom_webhook_template str
    Set a custom webhook template.
    deployment_events bool
    Invoke the hook for deployment events.
    disabled_until str
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    emoji_events bool
    Invoke the hook for emoji events.
    enable_ssl_verification bool
    Enable ssl verification when invoking the hook.
    feature_flag_events bool
    Invoke the hook for feature flag events.
    hook_id int
    The id of the project hook.
    id str
    The ID of this datasource. In the format <project>:<hook-id>.
    issues_events bool
    Invoke the hook for issues events.
    job_events bool
    Invoke the hook for job events.
    merge_requests_events bool
    Invoke the hook for merge requests.
    milestone_events bool
    Invoke the hook for milestone events.
    note_events bool
    Invoke the hook for notes events.
    pipeline_events bool
    Invoke the hook for pipeline events.
    project str
    The name or id of the project to add the hook to.
    project_id int
    The id of the project for the hook.
    push_events bool
    Invoke the hook for push events.
    push_events_branch_filter str
    Invoke the hook for push events on matching branches only.
    releases_events bool
    Invoke the hook for releases events.
    repository_update_events bool
    Invoke the hook for repository update events.
    resource_access_token_events bool
    Invoke the hook for project access token expiry events.
    resource_deploy_token_events bool
    Invoke the hook for resource deploy token events.
    signing_token_present bool
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    tag_push_events bool
    Invoke the hook for tag push events.
    url str
    The url of the hook to invoke.
    vulnerability_events bool
    Invoke the hook for vulnerability events.
    wiki_page_events bool
    Invoke the hook for wiki page events.
    alertStatus String
    Lifecycle status of the webhook. Values include executable and disabled.
    branchFilterStrategy String
    Filter push events by branch.
    confidentialIssuesEvents Boolean
    Invoke the hook for confidential issues events.
    confidentialNoteEvents Boolean
    Invoke the hook for confidential notes events.
    createdAt String
    The date and time the hook was created in ISO8601 format.
    customWebhookTemplate String
    Set a custom webhook template.
    deploymentEvents Boolean
    Invoke the hook for deployment events.
    disabledUntil String
    Time until the webhook is re-enabled after being automatically disabled due to failures, in ISO8601 format. Null when the webhook is enabled.
    emojiEvents Boolean
    Invoke the hook for emoji events.
    enableSslVerification Boolean
    Enable ssl verification when invoking the hook.
    featureFlagEvents Boolean
    Invoke the hook for feature flag events.
    hookId Number
    The id of the project hook.
    id String
    The ID of this datasource. In the format <project>:<hook-id>.
    issuesEvents Boolean
    Invoke the hook for issues events.
    jobEvents Boolean
    Invoke the hook for job events.
    mergeRequestsEvents Boolean
    Invoke the hook for merge requests.
    milestoneEvents Boolean
    Invoke the hook for milestone events.
    noteEvents Boolean
    Invoke the hook for notes events.
    pipelineEvents Boolean
    Invoke the hook for pipeline events.
    project String
    The name or id of the project to add the hook to.
    projectId Number
    The id of the project for the hook.
    pushEvents Boolean
    Invoke the hook for push events.
    pushEventsBranchFilter String
    Invoke the hook for push events on matching branches only.
    releasesEvents Boolean
    Invoke the hook for releases events.
    repositoryUpdateEvents Boolean
    Invoke the hook for repository update events.
    resourceAccessTokenEvents Boolean
    Invoke the hook for project access token expiry events.
    resourceDeployTokenEvents Boolean
    Invoke the hook for resource deploy token events.
    signingTokenPresent Boolean
    Whether a signingToken is configured server-side. Reflects the value returned by the GitLab API.
    tagPushEvents Boolean
    Invoke the hook for tag push events.
    url String
    The url of the hook to invoke.
    vulnerabilityEvents Boolean
    Invoke the hook for vulnerability events.
    wikiPageEvents Boolean
    Invoke the hook for wiki page events.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    Viewing docs for GitLab v10.0.0
    published on Friday, Jun 26, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial