github.ProjectCard
Explore with Pulumi AI
This resource allows you to create and manage cards for GitHub projects.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const project = new github.OrganizationProject("project", {
name: "An Organization Project",
body: "This is an organization project.",
});
const column = new github.ProjectColumn("column", {
projectId: project.id,
name: "Backlog",
});
const card = new github.ProjectCard("card", {
columnId: column.columnId,
note: "## Unaccepted 👇",
});
import pulumi
import pulumi_github as github
project = github.OrganizationProject("project",
name="An Organization Project",
body="This is an organization project.")
column = github.ProjectColumn("column",
project_id=project.id,
name="Backlog")
card = github.ProjectCard("card",
column_id=column.column_id,
note="## Unaccepted 👇")
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 {
project, err := github.NewOrganizationProject(ctx, "project", &github.OrganizationProjectArgs{
Name: pulumi.String("An Organization Project"),
Body: pulumi.String("This is an organization project."),
})
if err != nil {
return err
}
column, err := github.NewProjectColumn(ctx, "column", &github.ProjectColumnArgs{
ProjectId: project.ID(),
Name: pulumi.String("Backlog"),
})
if err != nil {
return err
}
_, err = github.NewProjectCard(ctx, "card", &github.ProjectCardArgs{
ColumnId: column.ColumnId,
Note: pulumi.String("## Unaccepted 👇"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var project = new Github.OrganizationProject("project", new()
{
Name = "An Organization Project",
Body = "This is an organization project.",
});
var column = new Github.ProjectColumn("column", new()
{
ProjectId = project.Id,
Name = "Backlog",
});
var card = new Github.ProjectCard("card", new()
{
ColumnId = column.ColumnId,
Note = "## Unaccepted 👇",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.OrganizationProject;
import com.pulumi.github.OrganizationProjectArgs;
import com.pulumi.github.ProjectColumn;
import com.pulumi.github.ProjectColumnArgs;
import com.pulumi.github.ProjectCard;
import com.pulumi.github.ProjectCardArgs;
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 project = new OrganizationProject("project", OrganizationProjectArgs.builder()
.name("An Organization Project")
.body("This is an organization project.")
.build());
var column = new ProjectColumn("column", ProjectColumnArgs.builder()
.projectId(project.id())
.name("Backlog")
.build());
var card = new ProjectCard("card", ProjectCardArgs.builder()
.columnId(column.columnId())
.note("## Unaccepted 👇")
.build());
}
}
resources:
project:
type: github:OrganizationProject
properties:
name: An Organization Project
body: This is an organization project.
column:
type: github:ProjectColumn
properties:
projectId: ${project.id}
name: Backlog
card:
type: github:ProjectCard
properties:
columnId: ${column.columnId}
note: "## Unaccepted \U0001F447"
Adding An Issue To A Project
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const test = new github.Repository("test", {
name: "myrepo",
hasProjects: true,
hasIssues: true,
});
const testIssue = new github.Issue("test", {
repository: test.id,
title: "Test issue title",
body: "Test issue body",
});
const testRepositoryProject = new github.RepositoryProject("test", {
name: "test",
repository: test.name,
body: "this is a test project",
});
const testProjectColumn = new github.ProjectColumn("test", {
projectId: testRepositoryProject.id,
name: "Backlog",
});
const testProjectCard = new github.ProjectCard("test", {
columnId: testProjectColumn.columnId,
contentId: testIssue.issueId,
contentType: "Issue",
});
import pulumi
import pulumi_github as github
test = github.Repository("test",
name="myrepo",
has_projects=True,
has_issues=True)
test_issue = github.Issue("test",
repository=test.id,
title="Test issue title",
body="Test issue body")
test_repository_project = github.RepositoryProject("test",
name="test",
repository=test.name,
body="this is a test project")
test_project_column = github.ProjectColumn("test",
project_id=test_repository_project.id,
name="Backlog")
test_project_card = github.ProjectCard("test",
column_id=test_project_column.column_id,
content_id=test_issue.issue_id,
content_type="Issue")
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 {
test, err := github.NewRepository(ctx, "test", &github.RepositoryArgs{
Name: pulumi.String("myrepo"),
HasProjects: pulumi.Bool(true),
HasIssues: pulumi.Bool(true),
})
if err != nil {
return err
}
testIssue, err := github.NewIssue(ctx, "test", &github.IssueArgs{
Repository: test.ID(),
Title: pulumi.String("Test issue title"),
Body: pulumi.String("Test issue body"),
})
if err != nil {
return err
}
testRepositoryProject, err := github.NewRepositoryProject(ctx, "test", &github.RepositoryProjectArgs{
Name: pulumi.String("test"),
Repository: test.Name,
Body: pulumi.String("this is a test project"),
})
if err != nil {
return err
}
testProjectColumn, err := github.NewProjectColumn(ctx, "test", &github.ProjectColumnArgs{
ProjectId: testRepositoryProject.ID(),
Name: pulumi.String("Backlog"),
})
if err != nil {
return err
}
_, err = github.NewProjectCard(ctx, "test", &github.ProjectCardArgs{
ColumnId: testProjectColumn.ColumnId,
ContentId: testIssue.IssueId,
ContentType: pulumi.String("Issue"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var test = new Github.Repository("test", new()
{
Name = "myrepo",
HasProjects = true,
HasIssues = true,
});
var testIssue = new Github.Issue("test", new()
{
Repository = test.Id,
Title = "Test issue title",
Body = "Test issue body",
});
var testRepositoryProject = new Github.RepositoryProject("test", new()
{
Name = "test",
Repository = test.Name,
Body = "this is a test project",
});
var testProjectColumn = new Github.ProjectColumn("test", new()
{
ProjectId = testRepositoryProject.Id,
Name = "Backlog",
});
var testProjectCard = new Github.ProjectCard("test", new()
{
ColumnId = testProjectColumn.ColumnId,
ContentId = testIssue.IssueId,
ContentType = "Issue",
});
});
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.Issue;
import com.pulumi.github.IssueArgs;
import com.pulumi.github.RepositoryProject;
import com.pulumi.github.RepositoryProjectArgs;
import com.pulumi.github.ProjectColumn;
import com.pulumi.github.ProjectColumnArgs;
import com.pulumi.github.ProjectCard;
import com.pulumi.github.ProjectCardArgs;
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 test = new Repository("test", RepositoryArgs.builder()
.name("myrepo")
.hasProjects(true)
.hasIssues(true)
.build());
var testIssue = new Issue("testIssue", IssueArgs.builder()
.repository(test.id())
.title("Test issue title")
.body("Test issue body")
.build());
var testRepositoryProject = new RepositoryProject("testRepositoryProject", RepositoryProjectArgs.builder()
.name("test")
.repository(test.name())
.body("this is a test project")
.build());
var testProjectColumn = new ProjectColumn("testProjectColumn", ProjectColumnArgs.builder()
.projectId(testRepositoryProject.id())
.name("Backlog")
.build());
var testProjectCard = new ProjectCard("testProjectCard", ProjectCardArgs.builder()
.columnId(testProjectColumn.columnId())
.contentId(testIssue.issueId())
.contentType("Issue")
.build());
}
}
resources:
test:
type: github:Repository
properties:
name: myrepo
hasProjects: true
hasIssues: true
testIssue:
type: github:Issue
name: test
properties:
repository: ${test.id}
title: Test issue title
body: Test issue body
testRepositoryProject:
type: github:RepositoryProject
name: test
properties:
name: test
repository: ${test.name}
body: this is a test project
testProjectColumn:
type: github:ProjectColumn
name: test
properties:
projectId: ${testRepositoryProject.id}
name: Backlog
testProjectCard:
type: github:ProjectCard
name: test
properties:
columnId: ${testProjectColumn.columnId}
contentId: ${testIssue.issueId}
contentType: Issue
Create ProjectCard Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectCard(name: string, args: ProjectCardArgs, opts?: CustomResourceOptions);
@overload
def ProjectCard(resource_name: str,
args: ProjectCardArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectCard(resource_name: str,
opts: Optional[ResourceOptions] = None,
column_id: Optional[str] = None,
content_id: Optional[int] = None,
content_type: Optional[str] = None,
note: Optional[str] = None)
func NewProjectCard(ctx *Context, name string, args ProjectCardArgs, opts ...ResourceOption) (*ProjectCard, error)
public ProjectCard(string name, ProjectCardArgs args, CustomResourceOptions? opts = null)
public ProjectCard(String name, ProjectCardArgs args)
public ProjectCard(String name, ProjectCardArgs args, CustomResourceOptions options)
type: github:ProjectCard
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 ProjectCardArgs
- 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 ProjectCardArgs
- 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 ProjectCardArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectCardArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectCardArgs
- 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 projectCardResource = new Github.ProjectCard("projectCardResource", new()
{
ColumnId = "string",
ContentId = 0,
ContentType = "string",
Note = "string",
});
example, err := github.NewProjectCard(ctx, "projectCardResource", &github.ProjectCardArgs{
ColumnId: pulumi.String("string"),
ContentId: pulumi.Int(0),
ContentType: pulumi.String("string"),
Note: pulumi.String("string"),
})
var projectCardResource = new ProjectCard("projectCardResource", ProjectCardArgs.builder()
.columnId("string")
.contentId(0)
.contentType("string")
.note("string")
.build());
project_card_resource = github.ProjectCard("projectCardResource",
column_id="string",
content_id=0,
content_type="string",
note="string")
const projectCardResource = new github.ProjectCard("projectCardResource", {
columnId: "string",
contentId: 0,
contentType: "string",
note: "string",
});
type: github:ProjectCard
properties:
columnId: string
contentId: 0
contentType: string
note: string
ProjectCard 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 ProjectCard resource accepts the following input properties:
- Column
Id string - The ID of the card.
- Content
Id int github_issue.issue_id
.- Content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- Note string
- The note contents of the card. Markdown supported.
- Column
Id string - The ID of the card.
- Content
Id int github_issue.issue_id
.- Content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- Note string
- The note contents of the card. Markdown supported.
- column
Id String - The ID of the card.
- content
Id Integer github_issue.issue_id
.- content
Type String Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- note String
- The note contents of the card. Markdown supported.
- column
Id string - The ID of the card.
- content
Id number github_issue.issue_id
.- content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- note string
- The note contents of the card. Markdown supported.
- column_
id str - The ID of the card.
- content_
id int github_issue.issue_id
.- content_
type str Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- note str
- The note contents of the card. Markdown supported.
- column
Id String - The ID of the card.
- content
Id Number github_issue.issue_id
.- content
Type String Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- note String
- The note contents of the card. Markdown supported.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectCard resource produces the following output properties:
Look up Existing ProjectCard Resource
Get an existing ProjectCard 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?: ProjectCardState, opts?: CustomResourceOptions): ProjectCard
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
card_id: Optional[int] = None,
column_id: Optional[str] = None,
content_id: Optional[int] = None,
content_type: Optional[str] = None,
etag: Optional[str] = None,
note: Optional[str] = None) -> ProjectCard
func GetProjectCard(ctx *Context, name string, id IDInput, state *ProjectCardState, opts ...ResourceOption) (*ProjectCard, error)
public static ProjectCard Get(string name, Input<string> id, ProjectCardState? state, CustomResourceOptions? opts = null)
public static ProjectCard get(String name, Output<String> id, ProjectCardState 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.
- Card
Id int - The ID of the card.
- Column
Id string - The ID of the card.
- Content
Id int github_issue.issue_id
.- Content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- Etag string
- Note string
- The note contents of the card. Markdown supported.
- Card
Id int - The ID of the card.
- Column
Id string - The ID of the card.
- Content
Id int github_issue.issue_id
.- Content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- Etag string
- Note string
- The note contents of the card. Markdown supported.
- card
Id Integer - The ID of the card.
- column
Id String - The ID of the card.
- content
Id Integer github_issue.issue_id
.- content
Type String Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- etag String
- note String
- The note contents of the card. Markdown supported.
- card
Id number - The ID of the card.
- column
Id string - The ID of the card.
- content
Id number github_issue.issue_id
.- content
Type string Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- etag string
- note string
- The note contents of the card. Markdown supported.
- card_
id int - The ID of the card.
- column_
id str - The ID of the card.
- content_
id int github_issue.issue_id
.- content_
type str Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- etag str
- note str
- The note contents of the card. Markdown supported.
- card
Id Number - The ID of the card.
- column
Id String - The ID of the card.
- content
Id Number github_issue.issue_id
.- content
Type String Must be either
Issue
orPullRequest
Remarks: You must either set the
note
attribute or bothcontent_id
andcontent_type
. See note example or issue example for more information.- etag String
- note String
- The note contents of the card. Markdown supported.
Import
A GitHub Project Card can be imported using its Card ID:
$ pulumi import github:index/projectCard:ProjectCard card 01234567
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
github
Terraform Provider.