gitlab.ProjectIntegrationGithub
Explore with Pulumi AI
The gitlab.ProjectIntegrationGithub
resource manages the lifecycle of a project integration with GitHub.
This resource requires a GitLab Enterprise instance.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const awesomeProject = new gitlab.Project("awesome_project", {
name: "awesome_project",
description: "My awesome project.",
visibilityLevel: "public",
});
const github = new gitlab.ProjectIntegrationGithub("github", {
project: awesomeProject.id,
token: "REDACTED",
repositoryUrl: "https://github.com/gitlabhq/terraform-provider-gitlab",
});
import pulumi
import pulumi_gitlab as gitlab
awesome_project = gitlab.Project("awesome_project",
name="awesome_project",
description="My awesome project.",
visibility_level="public")
github = gitlab.ProjectIntegrationGithub("github",
project=awesome_project.id,
token="REDACTED",
repository_url="https://github.com/gitlabhq/terraform-provider-gitlab")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
awesomeProject, err := gitlab.NewProject(ctx, "awesome_project", &gitlab.ProjectArgs{
Name: pulumi.String("awesome_project"),
Description: pulumi.String("My awesome project."),
VisibilityLevel: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectIntegrationGithub(ctx, "github", &gitlab.ProjectIntegrationGithubArgs{
Project: awesomeProject.ID(),
Token: pulumi.String("REDACTED"),
RepositoryUrl: pulumi.String("https://github.com/gitlabhq/terraform-provider-gitlab"),
})
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 awesomeProject = new GitLab.Project("awesome_project", new()
{
Name = "awesome_project",
Description = "My awesome project.",
VisibilityLevel = "public",
});
var github = new GitLab.ProjectIntegrationGithub("github", new()
{
Project = awesomeProject.Id,
Token = "REDACTED",
RepositoryUrl = "https://github.com/gitlabhq/terraform-provider-gitlab",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ProjectIntegrationGithub;
import com.pulumi.gitlab.ProjectIntegrationGithubArgs;
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 awesomeProject = new Project("awesomeProject", ProjectArgs.builder()
.name("awesome_project")
.description("My awesome project.")
.visibilityLevel("public")
.build());
var github = new ProjectIntegrationGithub("github", ProjectIntegrationGithubArgs.builder()
.project(awesomeProject.id())
.token("REDACTED")
.repositoryUrl("https://github.com/gitlabhq/terraform-provider-gitlab")
.build());
}
}
resources:
awesomeProject:
type: gitlab:Project
name: awesome_project
properties:
name: awesome_project
description: My awesome project.
visibilityLevel: public
github:
type: gitlab:ProjectIntegrationGithub
properties:
project: ${awesomeProject.id}
token: REDACTED
repositoryUrl: https://github.com/gitlabhq/terraform-provider-gitlab
Create ProjectIntegrationGithub Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectIntegrationGithub(name: string, args: ProjectIntegrationGithubArgs, opts?: CustomResourceOptions);
@overload
def ProjectIntegrationGithub(resource_name: str,
args: ProjectIntegrationGithubArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectIntegrationGithub(resource_name: str,
opts: Optional[ResourceOptions] = None,
project: Optional[str] = None,
repository_url: Optional[str] = None,
token: Optional[str] = None,
static_context: Optional[bool] = None)
func NewProjectIntegrationGithub(ctx *Context, name string, args ProjectIntegrationGithubArgs, opts ...ResourceOption) (*ProjectIntegrationGithub, error)
public ProjectIntegrationGithub(string name, ProjectIntegrationGithubArgs args, CustomResourceOptions? opts = null)
public ProjectIntegrationGithub(String name, ProjectIntegrationGithubArgs args)
public ProjectIntegrationGithub(String name, ProjectIntegrationGithubArgs args, CustomResourceOptions options)
type: gitlab:ProjectIntegrationGithub
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 ProjectIntegrationGithubArgs
- 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 ProjectIntegrationGithubArgs
- 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 ProjectIntegrationGithubArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectIntegrationGithubArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectIntegrationGithubArgs
- 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 projectIntegrationGithubResource = new GitLab.ProjectIntegrationGithub("projectIntegrationGithubResource", new()
{
Project = "string",
RepositoryUrl = "string",
Token = "string",
StaticContext = false,
});
example, err := gitlab.NewProjectIntegrationGithub(ctx, "projectIntegrationGithubResource", &gitlab.ProjectIntegrationGithubArgs{
Project: pulumi.String("string"),
RepositoryUrl: pulumi.String("string"),
Token: pulumi.String("string"),
StaticContext: pulumi.Bool(false),
})
var projectIntegrationGithubResource = new ProjectIntegrationGithub("projectIntegrationGithubResource", ProjectIntegrationGithubArgs.builder()
.project("string")
.repositoryUrl("string")
.token("string")
.staticContext(false)
.build());
project_integration_github_resource = gitlab.ProjectIntegrationGithub("projectIntegrationGithubResource",
project="string",
repository_url="string",
token="string",
static_context=False)
const projectIntegrationGithubResource = new gitlab.ProjectIntegrationGithub("projectIntegrationGithubResource", {
project: "string",
repositoryUrl: "string",
token: "string",
staticContext: false,
});
type: gitlab:ProjectIntegrationGithub
properties:
project: string
repositoryUrl: string
staticContext: false
token: string
ProjectIntegrationGithub Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectIntegrationGithub resource accepts the following input properties:
- Project string
- ID of the project you want to activate the integration on.
- Repository
Url string - Token string
- A GitHub personal access token with at least the
repo:status
scope. - Static
Context bool - Append the instance name instead of the 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.
- Project string
- ID of the project you want to activate the integration on.
- Repository
Url string - Token string
- A GitHub personal access token with at least the
repo:status
scope. - Static
Context bool - Append the instance name instead of the 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.
- project String
- ID of the project you want to activate the integration on.
- repository
Url String - token String
- A GitHub personal access token with at least the
repo:status
scope. - static
Context Boolean - Append the instance name instead of the 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.
- project string
- ID of the project you want to activate the integration on.
- repository
Url string - token string
- A GitHub personal access token with at least the
repo:status
scope. - static
Context boolean - Append the instance name instead of the 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.
- project str
- ID of the project you want to activate the integration on.
- repository_
url str - token str
- A GitHub personal access token with at least the
repo:status
scope. - static_
context bool - Append the instance name instead of the 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.
- project String
- ID of the project you want to activate the integration on.
- repository
Url String - token String
- A GitHub personal access token with at least the
repo:status
scope. - static
Context Boolean - Append the instance name instead of the 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectIntegrationGithub resource produces the following output properties:
- active bool
- Whether the integration is active.
- created_
at str - Creation time.
- id str
- The provider-assigned unique ID for this managed resource.
- title str
- The title of this resource.
- updated_
at str - Update time.
Look up Existing ProjectIntegrationGithub Resource
Get an existing ProjectIntegrationGithub 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?: ProjectIntegrationGithubState, opts?: CustomResourceOptions): ProjectIntegrationGithub
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
active: Optional[bool] = None,
created_at: Optional[str] = None,
project: Optional[str] = None,
repository_url: Optional[str] = None,
static_context: Optional[bool] = None,
title: Optional[str] = None,
token: Optional[str] = None,
updated_at: Optional[str] = None) -> ProjectIntegrationGithub
func GetProjectIntegrationGithub(ctx *Context, name string, id IDInput, state *ProjectIntegrationGithubState, opts ...ResourceOption) (*ProjectIntegrationGithub, error)
public static ProjectIntegrationGithub Get(string name, Input<string> id, ProjectIntegrationGithubState? state, CustomResourceOptions? opts = null)
public static ProjectIntegrationGithub get(String name, Output<String> id, ProjectIntegrationGithubState state, CustomResourceOptions options)
resources: _: type: gitlab:ProjectIntegrationGithub get: id: ${id}
- 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.
- Active bool
- Whether the integration is active.
- Created
At string - Creation time.
- Project string
- ID of the project you want to activate the integration on.
- Repository
Url string - Static
Context bool - Append the instance name instead of the 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.
- Title string
- The title of this resource.
- Token string
- A GitHub personal access token with at least the
repo:status
scope. - Updated
At string - Update time.
- Active bool
- Whether the integration is active.
- Created
At string - Creation time.
- Project string
- ID of the project you want to activate the integration on.
- Repository
Url string - Static
Context bool - Append the instance name instead of the 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.
- Title string
- The title of this resource.
- Token string
- A GitHub personal access token with at least the
repo:status
scope. - Updated
At string - Update time.
- active Boolean
- Whether the integration is active.
- created
At String - Creation time.
- project String
- ID of the project you want to activate the integration on.
- repository
Url String - static
Context Boolean - Append the instance name instead of the 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.
- title String
- The title of this resource.
- token String
- A GitHub personal access token with at least the
repo:status
scope. - updated
At String - Update time.
- active boolean
- Whether the integration is active.
- created
At string - Creation time.
- project string
- ID of the project you want to activate the integration on.
- repository
Url string - static
Context boolean - Append the instance name instead of the 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.
- title string
- The title of this resource.
- token string
- A GitHub personal access token with at least the
repo:status
scope. - updated
At string - Update time.
- active bool
- Whether the integration is active.
- created_
at str - Creation time.
- project str
- ID of the project you want to activate the integration on.
- repository_
url str - static_
context bool - Append the instance name instead of the 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.
- title str
- The title of this resource.
- token str
- A GitHub personal access token with at least the
repo:status
scope. - updated_
at str - Update time.
- active Boolean
- Whether the integration is active.
- created
At String - Creation time.
- project String
- ID of the project you want to activate the integration on.
- repository
Url String - static
Context Boolean - Append the instance name instead of the 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.
- title String
- The title of this resource.
- token String
- A GitHub personal access token with at least the
repo:status
scope. - updated
At String - Update time.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab_project_integration_github
. For example:
terraform
import {
to = gitlab_project_integration_github.example
id = “see CLI command below for ID”
}
Importing using the CLI is supported with the following syntax:
$ pulumi import gitlab:index/projectIntegrationGithub:ProjectIntegrationGithub You can import a gitlab_project_integration_github state using `<resource> <project_id>`:
$ pulumi import gitlab:index/projectIntegrationGithub:ProjectIntegrationGithub github 1
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.