1. Packages
  2. Github Provider
  3. API Docs
  4. RepositoryProject
GitHub v6.7.0 published on Friday, Feb 28, 2025 by Pulumi

github.RepositoryProject

Explore with Pulumi AI

This resource allows you to create and manage projects for GitHub repository.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const example = new github.Repository("example", {
    name: "example",
    description: "My awesome codebase",
    hasProjects: true,
});
const project = new github.RepositoryProject("project", {
    name: "A Repository Project",
    repository: example.name,
    body: "This is a repository project.",
});
Copy
import pulumi
import pulumi_github as github

example = github.Repository("example",
    name="example",
    description="My awesome codebase",
    has_projects=True)
project = github.RepositoryProject("project",
    name="A Repository Project",
    repository=example.name,
    body="This is a repository project.")
Copy
package main

import (
	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := github.NewRepository(ctx, "example", &github.RepositoryArgs{
			Name:        pulumi.String("example"),
			Description: pulumi.String("My awesome codebase"),
			HasProjects: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = github.NewRepositoryProject(ctx, "project", &github.RepositoryProjectArgs{
			Name:       pulumi.String("A Repository Project"),
			Repository: example.Name,
			Body:       pulumi.String("This is a repository project."),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var example = new Github.Repository("example", new()
    {
        Name = "example",
        Description = "My awesome codebase",
        HasProjects = true,
    });

    var project = new Github.RepositoryProject("project", new()
    {
        Name = "A Repository Project",
        Repository = example.Name,
        Body = "This is a repository project.",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryProject;
import com.pulumi.github.RepositoryProjectArgs;
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 example = new Repository("example", RepositoryArgs.builder()
            .name("example")
            .description("My awesome codebase")
            .hasProjects(true)
            .build());

        var project = new RepositoryProject("project", RepositoryProjectArgs.builder()
            .name("A Repository Project")
            .repository(example.name())
            .body("This is a repository project.")
            .build());

    }
}
Copy
resources:
  example:
    type: github:Repository
    properties:
      name: example
      description: My awesome codebase
      hasProjects: true
  project:
    type: github:RepositoryProject
    properties:
      name: A Repository Project
      repository: ${example.name}
      body: This is a repository project.
Copy

Create RepositoryProject Resource

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

Constructor syntax

new RepositoryProject(name: string, args: RepositoryProjectArgs, opts?: CustomResourceOptions);
@overload
def RepositoryProject(resource_name: str,
                      args: RepositoryProjectArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def RepositoryProject(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      repository: Optional[str] = None,
                      body: Optional[str] = None,
                      name: Optional[str] = None)
func NewRepositoryProject(ctx *Context, name string, args RepositoryProjectArgs, opts ...ResourceOption) (*RepositoryProject, error)
public RepositoryProject(string name, RepositoryProjectArgs args, CustomResourceOptions? opts = null)
public RepositoryProject(String name, RepositoryProjectArgs args)
public RepositoryProject(String name, RepositoryProjectArgs args, CustomResourceOptions options)
type: github:RepositoryProject
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RepositoryProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RepositoryProjectArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryProjectArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RepositoryProjectArgs
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 repositoryProjectResource = new Github.RepositoryProject("repositoryProjectResource", new()
{
    Repository = "string",
    Body = "string",
    Name = "string",
});
Copy
example, err := github.NewRepositoryProject(ctx, "repositoryProjectResource", &github.RepositoryProjectArgs{
	Repository: pulumi.String("string"),
	Body:       pulumi.String("string"),
	Name:       pulumi.String("string"),
})
Copy
var repositoryProjectResource = new RepositoryProject("repositoryProjectResource", RepositoryProjectArgs.builder()
    .repository("string")
    .body("string")
    .name("string")
    .build());
Copy
repository_project_resource = github.RepositoryProject("repositoryProjectResource",
    repository="string",
    body="string",
    name="string")
Copy
const repositoryProjectResource = new github.RepositoryProject("repositoryProjectResource", {
    repository: "string",
    body: "string",
    name: "string",
});
Copy
type: github:RepositoryProject
properties:
    body: string
    name: string
    repository: string
Copy

RepositoryProject 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 RepositoryProject resource accepts the following input properties:

Repository
This property is required.
Changes to this property will trigger replacement.
string
The repository of the project.
Body string
The body of the project.
Name string
The name of the project.
Repository
This property is required.
Changes to this property will trigger replacement.
string
The repository of the project.
Body string
The body of the project.
Name string
The name of the project.
repository
This property is required.
Changes to this property will trigger replacement.
String
The repository of the project.
body String
The body of the project.
name String
The name of the project.
repository
This property is required.
Changes to this property will trigger replacement.
string
The repository of the project.
body string
The body of the project.
name string
The name of the project.
repository
This property is required.
Changes to this property will trigger replacement.
str
The repository of the project.
body str
The body of the project.
name str
The name of the project.
repository
This property is required.
Changes to this property will trigger replacement.
String
The repository of the project.
body String
The body of the project.
name String
The name of the project.

Outputs

All input properties are implicitly available as output properties. Additionally, the RepositoryProject resource produces the following output properties:

Etag string
Id string
The provider-assigned unique ID for this managed resource.
Url string
URL of the project
Etag string
Id string
The provider-assigned unique ID for this managed resource.
Url string
URL of the project
etag String
id String
The provider-assigned unique ID for this managed resource.
url String
URL of the project
etag string
id string
The provider-assigned unique ID for this managed resource.
url string
URL of the project
etag str
id str
The provider-assigned unique ID for this managed resource.
url str
URL of the project
etag String
id String
The provider-assigned unique ID for this managed resource.
url String
URL of the project

Look up Existing RepositoryProject Resource

Get an existing RepositoryProject 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?: RepositoryProjectState, opts?: CustomResourceOptions): RepositoryProject
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        body: Optional[str] = None,
        etag: Optional[str] = None,
        name: Optional[str] = None,
        repository: Optional[str] = None,
        url: Optional[str] = None) -> RepositoryProject
func GetRepositoryProject(ctx *Context, name string, id IDInput, state *RepositoryProjectState, opts ...ResourceOption) (*RepositoryProject, error)
public static RepositoryProject Get(string name, Input<string> id, RepositoryProjectState? state, CustomResourceOptions? opts = null)
public static RepositoryProject get(String name, Output<String> id, RepositoryProjectState state, CustomResourceOptions options)
resources:  _:    type: github:RepositoryProject    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Body string
The body of the project.
Etag string
Name string
The name of the project.
Repository Changes to this property will trigger replacement. string
The repository of the project.
Url string
URL of the project
Body string
The body of the project.
Etag string
Name string
The name of the project.
Repository Changes to this property will trigger replacement. string
The repository of the project.
Url string
URL of the project
body String
The body of the project.
etag String
name String
The name of the project.
repository Changes to this property will trigger replacement. String
The repository of the project.
url String
URL of the project
body string
The body of the project.
etag string
name string
The name of the project.
repository Changes to this property will trigger replacement. string
The repository of the project.
url string
URL of the project
body str
The body of the project.
etag str
name str
The name of the project.
repository Changes to this property will trigger replacement. str
The repository of the project.
url str
URL of the project
body String
The body of the project.
etag String
name String
The name of the project.
repository Changes to this property will trigger replacement. String
The repository of the project.
url String
URL of the project

Package Details

Repository
GitHub pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.