1. Packages
  2. GitLab
  3. API Docs
  4. ServiceGithub
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

gitlab.ServiceGithub

Explore with Pulumi AI

gitlab logo
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

    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.IntegrationGithubinstead!

    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",
    });
    
    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")
    
    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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    Create ServiceGithub Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ServiceGithub(name: string, args: ServiceGithubArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceGithub(resource_name: str,
                      args: ServiceGithubArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceGithub(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 NewServiceGithub(ctx *Context, name string, args ServiceGithubArgs, opts ...ResourceOption) (*ServiceGithub, error)
    public ServiceGithub(string name, ServiceGithubArgs args, CustomResourceOptions? opts = null)
    public ServiceGithub(String name, ServiceGithubArgs args)
    public ServiceGithub(String name, ServiceGithubArgs args, CustomResourceOptions options)
    
    type: gitlab:ServiceGithub
    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 ServiceGithubArgs
    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 ServiceGithubArgs
    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 ServiceGithubArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceGithubArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceGithubArgs
    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 serviceGithubResource = new GitLab.ServiceGithub("serviceGithubResource", new()
    {
        Project = "string",
        RepositoryUrl = "string",
        Token = "string",
        StaticContext = false,
    });
    
    example, err := gitlab.NewServiceGithub(ctx, "serviceGithubResource", &gitlab.ServiceGithubArgs{
    	Project:       pulumi.String("string"),
    	RepositoryUrl: pulumi.String("string"),
    	Token:         pulumi.String("string"),
    	StaticContext: pulumi.Bool(false),
    })
    
    var serviceGithubResource = new ServiceGithub("serviceGithubResource", ServiceGithubArgs.builder()
        .project("string")
        .repositoryUrl("string")
        .token("string")
        .staticContext(false)
        .build());
    
    service_github_resource = gitlab.ServiceGithub("serviceGithubResource",
        project="string",
        repository_url="string",
        token="string",
        static_context=False)
    
    const serviceGithubResource = new gitlab.ServiceGithub("serviceGithubResource", {
        project: "string",
        repositoryUrl: "string",
        token: "string",
        staticContext: false,
    });
    
    type: gitlab:ServiceGithub
    properties:
        project: string
        repositoryUrl: string
        staticContext: false
        token: string
    

    ServiceGithub Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ServiceGithub resource accepts the following input properties:

    Project string
    ID of the project you want to activate integration on.
    RepositoryUrl string
    Token string
    A GitHub personal access token with at least repo:status scope.
    StaticContext 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.
    RepositoryUrl string
    Token string
    A GitHub personal access token with at least repo:status scope.
    StaticContext 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.
    repositoryUrl String
    token String
    A GitHub personal access token with at least repo:status scope.
    staticContext 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.
    repositoryUrl string
    token string
    A GitHub personal access token with at least repo:status scope.
    staticContext 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.
    repositoryUrl String
    token String
    A GitHub personal access token with at least repo:status scope.
    staticContext 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 ServiceGithub resource produces the following output properties:

    Active bool
    Whether the integration is active.
    CreatedAt string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Title string
    Title.
    UpdatedAt string
    Update time.
    Active bool
    Whether the integration is active.
    CreatedAt string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Title string
    Title.
    UpdatedAt string
    Update time.
    active Boolean
    Whether the integration is active.
    createdAt String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    title String
    Title.
    updatedAt String
    Update time.
    active boolean
    Whether the integration is active.
    createdAt string
    Create time.
    id string
    The provider-assigned unique ID for this managed resource.
    title string
    Title.
    updatedAt string
    Update time.
    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.
    active Boolean
    Whether the integration is active.
    createdAt String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    title String
    Title.
    updatedAt String
    Update time.

    Look up Existing ServiceGithub Resource

    Get an existing ServiceGithub 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?: ServiceGithubState, opts?: CustomResourceOptions): ServiceGithub
    @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) -> ServiceGithub
    func GetServiceGithub(ctx *Context, name string, id IDInput, state *ServiceGithubState, opts ...ResourceOption) (*ServiceGithub, error)
    public static ServiceGithub Get(string name, Input<string> id, ServiceGithubState? state, CustomResourceOptions? opts = null)
    public static ServiceGithub get(String name, Output<String> id, ServiceGithubState 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.
    The following state arguments are supported:
    Active bool
    Whether the integration is active.
    CreatedAt string
    Create time.
    Project string
    ID of the project you want to activate integration on.
    RepositoryUrl string
    StaticContext 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.
    UpdatedAt string
    Update time.
    Active bool
    Whether the integration is active.
    CreatedAt string
    Create time.
    Project string
    ID of the project you want to activate integration on.
    RepositoryUrl string
    StaticContext 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.
    UpdatedAt string
    Update time.
    active Boolean
    Whether the integration is active.
    createdAt String
    Create time.
    project String
    ID of the project you want to activate integration on.
    repositoryUrl String
    staticContext 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.
    updatedAt String
    Update time.
    active boolean
    Whether the integration is active.
    createdAt string
    Create time.
    project string
    ID of the project you want to activate integration on.
    repositoryUrl string
    staticContext 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.
    updatedAt 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.
    createdAt String
    Create time.
    project String
    ID of the project you want to activate integration on.
    repositoryUrl String
    staticContext 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.
    updatedAt String
    Update time.

    Import

    $ pulumi import gitlab:index/serviceGithub:ServiceGithub You can import a gitlab_service_github state using `<resource> <project_id>`:
    
    $ pulumi import gitlab:index/serviceGithub:ServiceGithub 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.
    gitlab logo
    GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi