The gitlab_project_hook
resource allows to manage the lifecycle of a project hook.
Upstream API: GitLab REST API docs
resource "gitlab_project_hook" "example" {
project = "example/hooked"
url = "https://example.com/hook/example"
merge_requests_events = true
}
project
(String) The name or id of the project to add the hook to.url
(String) The url of the hook to invoke. Forces re-creation to preserve token
.confidential_issues_events
(Boolean) Invoke the hook for confidential issues events.confidential_note_events
(Boolean) Invoke the hook for confidential notes events.custom_webhook_template
(String) Set a custom webhook template.deployment_events
(Boolean) Invoke the hook for deployment events.enable_ssl_verification
(Boolean) Enable ssl verification when invoking the hook.issues_events
(Boolean) Invoke the hook for issues events.job_events
(Boolean) Invoke the hook for job events.merge_requests_events
(Boolean) Invoke the hook for merge requests.note_events
(Boolean) Invoke the hook for notes events.pipeline_events
(Boolean) Invoke the hook for pipeline events.push_events
(Boolean) Invoke the hook for push events.push_events_branch_filter
(String) Invoke the hook for push events on matching branches only.releases_events
(Boolean) Invoke the hook for releases events.tag_push_events
(Boolean) Invoke the hook for tag push events.token
(String, Sensitive) A token to present when invoking the hook. The token is not available for imported resources.wiki_page_events
(Boolean) Invoke the hook for wiki page events.hook_id
(Number) The id of the project hook.id
(String) The ID of this resource.project_id
(Number) The id of the project for the hook.Import is supported using the following syntax:
# A GitLab Project Hook can be imported using a key composed of `<project-id>:<hook-id>`, e.g.
terraform import gitlab_project_hook.example "12345:1"
# NOTE: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.