Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 2.53 KB

service_github.md

File metadata and controls

74 lines (55 loc) · 2.53 KB
page_title subcategory description
gitlab_service_github Resource - terraform-provider-gitlab
The gitlab_service_github resource allows to manage the lifecycle of a project integration with GitHub. -> This resource requires a GitLab Enterprise instance. ~> This resource is deprecated. use gitlab_integration_githubinstead! Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/integrations.html#github

gitlab_service_github (Resource)

The gitlab_service_github resource allows to manage the lifecycle of a project integration with GitHub.

-> This resource requires a GitLab Enterprise instance.

~> This resource is deprecated. use gitlab_integration_githubinstead!

Upstream API: GitLab REST API docs

Example Usage

resource "gitlab_project" "awesome_project" {
  name             = "awesome_project"
  description      = "My awesome project."
  visibility_level = "public"
}

resource "gitlab_service_github" "github" {
  project        = gitlab_project.awesome_project.id
  token          = "REDACTED"
  repository_url = "https://github.com/gitlabhq/terraform-provider-gitlab"
}

Schema

Required

  • project (String) ID of the project you want to activate integration on.
  • repository_url (String) The URL of the GitHub repo to integrate with, e,g, https://github.com/gitlabhq/terraform-provider-gitlab.
  • token (String, Sensitive) A GitHub personal access token with at least repo:status scope.

Optional

  • static_context (Boolean) Append instance name instead of branch to the status. Must enable to set a GitLab status check as required in GitHub. See [Static / dynamic status check names] to learn more.

Read-Only

  • active (Boolean) Whether the integration is active.
  • created_at (String) Create time.
  • id (String) The ID of this resource.
  • title (String) Title.
  • updated_at (String) Update time.

Import

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

import {
  to = gitlab_service_github.example
  id = "see CLI command below for ID"
}

Import using the CLI is supported using the following syntax:

# You can import a gitlab_service_github state using `terraform import <resource> <project_id>`:
terraform import gitlab_service_github.github 1