GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi
gitlab.getProjectHook
Explore with Pulumi AI
The gitlab.ProjectHook data source allows to retrieve 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/v8/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := gitlab.LookupProject(ctx, &gitlab.LookupProjectArgs{
			Id: pulumi.StringRef("foo/bar/baz"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = gitlab.LookupProjectHook(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.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) {
        final var example = GitlabFunctions.getProject(GetProjectArgs.builder()
            .id("foo/bar/baz")
            .build());
        final var exampleGetProjectHook = GitlabFunctions.getProjectHook(GetProjectHookArgs.builder()
            .project(example.applyValue(getProjectResult -> getProjectResult.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
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: Optional[pulumi.Input[int]] = None,
                     project: Optional[pulumi.Input[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 dictionaryThe following arguments are supported:
getProjectHook Result
The following output properties are available:
- Confidential
Issues boolEvents  - Invoke the hook for confidential issues events.
 - Confidential
Note boolEvents  - Invoke the hook for confidential notes events.
 - Custom
Webhook stringTemplate  - Set a custom webhook template.
 - Deployment
Events bool - Invoke the hook for deployment events.
 - Enable
Ssl boolVerification  - Enable ssl verification when invoking the hook.
 - Hook
Id int - The id of the project hook.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Issues
Events bool - Invoke the hook for issues events.
 - Job
Events bool - Invoke the hook for job events.
 - Merge
Requests boolEvents  - Invoke the hook for merge requests.
 - 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 int - The id of the project for the hook.
 - Push
Events bool - Invoke the hook for push events.
 - Push
Events stringBranch Filter  - Invoke the hook for push events on matching branches only.
 - Releases
Events bool - Invoke the hook for releases events.
 - Tag
Push boolEvents  - Invoke the hook for tag push events.
 - Token string
 - A token to present when invoking the hook. The token is not available for imported resources.
 - Url string
 - The url of the hook to invoke.
 - Wiki
Page boolEvents  - Invoke the hook for wiki page events.
 
- Confidential
Issues boolEvents  - Invoke the hook for confidential issues events.
 - Confidential
Note boolEvents  - Invoke the hook for confidential notes events.
 - Custom
Webhook stringTemplate  - Set a custom webhook template.
 - Deployment
Events bool - Invoke the hook for deployment events.
 - Enable
Ssl boolVerification  - Enable ssl verification when invoking the hook.
 - Hook
Id int - The id of the project hook.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Issues
Events bool - Invoke the hook for issues events.
 - Job
Events bool - Invoke the hook for job events.
 - Merge
Requests boolEvents  - Invoke the hook for merge requests.
 - 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 int - The id of the project for the hook.
 - Push
Events bool - Invoke the hook for push events.
 - Push
Events stringBranch Filter  - Invoke the hook for push events on matching branches only.
 - Releases
Events bool - Invoke the hook for releases events.
 - Tag
Push boolEvents  - Invoke the hook for tag push events.
 - Token string
 - A token to present when invoking the hook. The token is not available for imported resources.
 - Url string
 - The url of the hook to invoke.
 - Wiki
Page boolEvents  - Invoke the hook for wiki page events.
 
- confidential
Issues BooleanEvents  - Invoke the hook for confidential issues events.
 - confidential
Note BooleanEvents  - Invoke the hook for confidential notes events.
 - custom
Webhook StringTemplate  - Set a custom webhook template.
 - deployment
Events Boolean - Invoke the hook for deployment events.
 - enable
Ssl BooleanVerification  - Enable ssl verification when invoking the hook.
 - hook
Id Integer - The id of the project hook.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - issues
Events Boolean - Invoke the hook for issues events.
 - job
Events Boolean - Invoke the hook for job events.
 - merge
Requests BooleanEvents  - Invoke the hook for merge requests.
 - note
Events Boolean - Invoke the hook for notes events.
 - pipeline
Events Boolean - Invoke the hook for pipeline events.
 - project String
 - The name or id of the project to add the hook to.
 - project
Id Integer - The id of the project for the hook.
 - push
Events Boolean - Invoke the hook for push events.
 - push
Events StringBranch Filter  - Invoke the hook for push events on matching branches only.
 - releases
Events Boolean - Invoke the hook for releases events.
 - tag
Push BooleanEvents  - Invoke the hook for tag push events.
 - token String
 - A token to present when invoking the hook. The token is not available for imported resources.
 - url String
 - The url of the hook to invoke.
 - wiki
Page BooleanEvents  - Invoke the hook for wiki page events.
 
- confidential
Issues booleanEvents  - Invoke the hook for confidential issues events.
 - confidential
Note booleanEvents  - Invoke the hook for confidential notes events.
 - custom
Webhook stringTemplate  - Set a custom webhook template.
 - deployment
Events boolean - Invoke the hook for deployment events.
 - enable
Ssl booleanVerification  - Enable ssl verification when invoking the hook.
 - hook
Id number - The id of the project hook.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - issues
Events boolean - Invoke the hook for issues events.
 - job
Events boolean - Invoke the hook for job events.
 - merge
Requests booleanEvents  - Invoke the hook for merge requests.
 - note
Events boolean - Invoke the hook for notes events.
 - pipeline
Events boolean - 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 boolean - Invoke the hook for push events.
 - push
Events stringBranch Filter  - Invoke the hook for push events on matching branches only.
 - releases
Events boolean - Invoke the hook for releases events.
 - tag
Push booleanEvents  - Invoke the hook for tag push events.
 - token string
 - A token to present when invoking the hook. The token is not available for imported resources.
 - url string
 - The url of the hook to invoke.
 - wiki
Page booleanEvents  - Invoke the hook for wiki page events.
 
- confidential_
issues_ boolevents  - Invoke the hook for confidential issues events.
 - confidential_
note_ boolevents  - Invoke the hook for confidential notes events.
 - custom_
webhook_ strtemplate  - Set a custom webhook template.
 - deployment_
events bool - Invoke the hook for deployment events.
 - enable_
ssl_ boolverification  - Enable ssl verification when invoking the hook.
 - hook_
id int - The id of the project hook.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - issues_
events bool - Invoke the hook for issues events.
 - job_
events bool - Invoke the hook for job events.
 - merge_
requests_ boolevents  - Invoke the hook for merge requests.
 - 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_ strbranch_ filter  - Invoke the hook for push events on matching branches only.
 - releases_
events bool - Invoke the hook for releases events.
 - tag_
push_ boolevents  - Invoke the hook for tag push events.
 - token str
 - A token to present when invoking the hook. The token is not available for imported resources.
 - url str
 - The url of the hook to invoke.
 - wiki_
page_ boolevents  - Invoke the hook for wiki page events.
 
- confidential
Issues BooleanEvents  - Invoke the hook for confidential issues events.
 - confidential
Note BooleanEvents  - Invoke the hook for confidential notes events.
 - custom
Webhook StringTemplate  - Set a custom webhook template.
 - deployment
Events Boolean - Invoke the hook for deployment events.
 - enable
Ssl BooleanVerification  - Enable ssl verification when invoking the hook.
 - hook
Id Number - The id of the project hook.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - issues
Events Boolean - Invoke the hook for issues events.
 - job
Events Boolean - Invoke the hook for job events.
 - merge
Requests BooleanEvents  - Invoke the hook for merge requests.
 - note
Events Boolean - Invoke the hook for notes events.
 - pipeline
Events Boolean - 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 Boolean - Invoke the hook for push events.
 - push
Events StringBranch Filter  - Invoke the hook for push events on matching branches only.
 - releases
Events Boolean - Invoke the hook for releases events.
 - tag
Push BooleanEvents  - Invoke the hook for tag push events.
 - token String
 - A token to present when invoking the hook. The token is not available for imported resources.
 - url String
 - The url of the hook to invoke.
 - wiki
Page BooleanEvents  - 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 
gitlabTerraform Provider.