Service Github Args
data class ServiceGithubArgs(val project: Output<String>? = null, val repositoryUrl: Output<String>? = null, val staticContext: Output<Boolean>? = null, val token: Output<String>? = null) : ConvertibleToJava<ServiceGithubArgs>
The gitlab.ServiceGithub
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.IntegrationGithub
instead! 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.ServiceGithub("github", {
project: awesomeProject.id,
token: "REDACTED",
repositoryUrl: "https://github.com/gitlabhq/terraform-provider-gitlab",
});
Content copied to clipboard
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.ServiceGithub("github",
project=awesome_project.id,
token="REDACTED",
repository_url="https://github.com/gitlabhq/terraform-provider-gitlab")
Content copied to clipboard
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.ServiceGithub("github", new()
{
Project = awesomeProject.Id,
Token = "REDACTED",
RepositoryUrl = "https://github.com/gitlabhq/terraform-provider-gitlab",
});
});
Content copied to clipboard
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.NewServiceGithub(ctx, "github", &gitlab.ServiceGithubArgs{
Project: awesomeProject.ID(),
Token: pulumi.String("REDACTED"),
RepositoryUrl: pulumi.String("https://github.com/gitlabhq/terraform-provider-gitlab"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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.ServiceGithub;
import com.pulumi.gitlab.ServiceGithubArgs;
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 ServiceGithub("github", ServiceGithubArgs.builder()
.project(awesomeProject.id())
.token("REDACTED")
.repositoryUrl("https://github.com/gitlabhq/terraform-provider-gitlab")
.build());
}
}
Content copied to clipboard
resources:
awesomeProject:
type: gitlab:Project
name: awesome_project
properties:
name: awesome_project
description: My awesome project.
visibilityLevel: public
github:
type: gitlab:ServiceGithub
properties:
project: ${awesomeProject.id}
token: REDACTED
repositoryUrl: https://github.com/gitlabhq/terraform-provider-gitlab
Content copied to clipboard
Import
Starting in Terraform v1.5.0 you can use an import block to import gitlab_service_github
. For example: terraform import { to = gitlab_service_github.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax:
$ pulumi import gitlab:index/serviceGithub:ServiceGithub You can import a gitlab_service_github state using `<resource> <project_id>`:
Content copied to clipboard
$ pulumi import gitlab:index/serviceGithub:ServiceGithub github 1
Content copied to clipboard