gitlab.IntegrationGithub
Explore with Pulumi AI
The gitlab.IntegrationGithub
resource allows to manage 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.IntegrationGithub("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.IntegrationGithub("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/v8/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.NewIntegrationGithub(ctx, "github", &gitlab.IntegrationGithubArgs{
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.IntegrationGithub("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.IntegrationGithub;
import com.pulumi.gitlab.IntegrationGithubArgs;
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 IntegrationGithub("github", IntegrationGithubArgs.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:IntegrationGithub
properties:
project: ${awesomeProject.id}
token: REDACTED
repositoryUrl: https://github.com/gitlabhq/terraform-provider-gitlab
Create IntegrationGithub Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IntegrationGithub(name: string, args: IntegrationGithubArgs, opts?: CustomResourceOptions);
@overload
def IntegrationGithub(resource_name: str,
args: IntegrationGithubArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IntegrationGithub(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 NewIntegrationGithub(ctx *Context, name string, args IntegrationGithubArgs, opts ...ResourceOption) (*IntegrationGithub, error)
public IntegrationGithub(string name, IntegrationGithubArgs args, CustomResourceOptions? opts = null)
public IntegrationGithub(String name, IntegrationGithubArgs args)
public IntegrationGithub(String name, IntegrationGithubArgs args, CustomResourceOptions options)
type: gitlab:IntegrationGithub
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 IntegrationGithubArgs
- 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 IntegrationGithubArgs
- 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 IntegrationGithubArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IntegrationGithubArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IntegrationGithubArgs
- 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 integrationGithubResource = new GitLab.IntegrationGithub("integrationGithubResource", new()
{
Project = "string",
RepositoryUrl = "string",
Token = "string",
StaticContext = false,
});
example, err := gitlab.NewIntegrationGithub(ctx, "integrationGithubResource", &gitlab.IntegrationGithubArgs{
Project: pulumi.String("string"),
RepositoryUrl: pulumi.String("string"),
Token: pulumi.String("string"),
StaticContext: pulumi.Bool(false),
})
var integrationGithubResource = new IntegrationGithub("integrationGithubResource", IntegrationGithubArgs.builder()
.project("string")
.repositoryUrl("string")
.token("string")
.staticContext(false)
.build());
integration_github_resource = gitlab.IntegrationGithub("integrationGithubResource",
project="string",
repository_url="string",
token="string",
static_context=False)
const integrationGithubResource = new gitlab.IntegrationGithub("integrationGithubResource", {
project: "string",
repositoryUrl: "string",
token: "string",
staticContext: false,
});
type: gitlab:IntegrationGithub
properties:
project: string
repositoryUrl: string
staticContext: false
token: string
IntegrationGithub 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 IntegrationGithub resource accepts the following input properties:
- Project string
- ID of the project you want to activate integration on.
- Repository
Url string - Token string
- A GitHub personal access token with at least
repo:status
scope. - Static
Context bool - 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.
- Project string
- ID of the project you want to activate integration on.
- Repository
Url string - Token string
- A GitHub personal access token with at least
repo:status
scope. - Static
Context bool - 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.
- project String
- ID of the project you want to activate integration on.
- repository
Url String - token String
- A GitHub personal access token with at least
repo:status
scope. - 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.
- project string
- ID of the project you want to activate integration on.
- repository
Url string - token string
- A GitHub personal access token with at least
repo:status
scope. - 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.
- project str
- ID of the project you want to activate integration on.
- repository_
url str - token str
- A GitHub personal access token with at least
repo:status
scope. - static_
context bool - 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.
- project String
- ID of the project you want to activate integration on.
- repository
Url String - token String
- A GitHub personal access token with at least
repo:status
scope. - 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the IntegrationGithub resource produces the following output properties:
- active bool
- Whether the integration is active.
- created_
at str - Create time.
- id str
- The provider-assigned unique ID for this managed resource.
- title str
- Title.
- updated_
at str - Update time.
Look up Existing IntegrationGithub Resource
Get an existing IntegrationGithub 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?: IntegrationGithubState, opts?: CustomResourceOptions): IntegrationGithub
@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) -> IntegrationGithub
func GetIntegrationGithub(ctx *Context, name string, id IDInput, state *IntegrationGithubState, opts ...ResourceOption) (*IntegrationGithub, error)
public static IntegrationGithub Get(string name, Input<string> id, IntegrationGithubState? state, CustomResourceOptions? opts = null)
public static IntegrationGithub get(String name, Output<String> id, IntegrationGithubState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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 - Create time.
- Project string
- ID of the project you want to activate integration on.
- Repository
Url string - Static
Context bool - 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.
- Title string
- Title.
- Token string
- A GitHub personal access token with at least
repo:status
scope. - Updated
At string - Update time.
- Active bool
- Whether the integration is active.
- Created
At string - Create time.
- Project string
- ID of the project you want to activate integration on.
- Repository
Url string - Static
Context bool - 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.
- Title string
- Title.
- Token string
- A GitHub personal access token with at least
repo:status
scope. - Updated
At string - Update time.
- active Boolean
- Whether the integration is active.
- created
At String - Create time.
- project String
- ID of the project you want to activate integration on.
- repository
Url String - 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.
- title String
- Title.
- token String
- A GitHub personal access token with at least
repo:status
scope. - updated
At String - Update time.
- active boolean
- Whether the integration is active.
- created
At string - Create time.
- project string
- ID of the project you want to activate integration on.
- repository
Url string - 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.
- title string
- Title.
- token string
- A GitHub personal access token with at least
repo:status
scope. - updated
At string - Update time.
- active bool
- Whether the integration is active.
- created_
at str - Create time.
- project str
- ID of the project you want to activate integration on.
- repository_
url str - static_
context bool - 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.
- title str
- Title.
- token str
- A GitHub personal access token with at least
repo:status
scope. - updated_
at str - Update time.
- active Boolean
- Whether the integration is active.
- created
At String - Create time.
- project String
- ID of the project you want to activate integration on.
- repository
Url String - 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.
- title String
- Title.
- token String
- A GitHub personal access token with at least
repo:status
scope. - updated
At String - Update time.
Import
$ pulumi import gitlab:index/integrationGithub:IntegrationGithub You can import a gitlab_integration_github state using `<resource> <project_id>`:
$ pulumi import gitlab:index/integrationGithub:IntegrationGithub 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.