1. Packages
  2. GitHub
  3. API Docs
  4. Team
GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi

github.Team

Explore with Pulumi AI

github logo
GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi

    Provides a GitHub team resource.

    This resource allows you to add/remove teams from your organization. When applied, a new team will be created. When destroyed, that team will be removed.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Add a team to the organization
    const someTeam = new github.Team("some_team", {
        name: "some-team",
        description: "Some cool team",
        privacy: "closed",
    });
    
    import pulumi
    import pulumi_github as github
    
    # Add a team to the organization
    some_team = github.Team("some_team",
        name="some-team",
        description="Some cool team",
        privacy="closed")
    
    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 {
    		// Add a team to the organization
    		_, err := github.NewTeam(ctx, "some_team", &github.TeamArgs{
    			Name:        pulumi.String("some-team"),
    			Description: pulumi.String("Some cool team"),
    			Privacy:     pulumi.String("closed"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        // Add a team to the organization
        var someTeam = new Github.Team("some_team", new()
        {
            Name = "some-team",
            Description = "Some cool team",
            Privacy = "closed",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.Team;
    import com.pulumi.github.TeamArgs;
    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) {
            // Add a team to the organization
            var someTeam = new Team("someTeam", TeamArgs.builder()
                .name("some-team")
                .description("Some cool team")
                .privacy("closed")
                .build());
    
        }
    }
    
    resources:
      # Add a team to the organization
      someTeam:
        type: github:Team
        name: some_team
        properties:
          name: some-team
          description: Some cool team
          privacy: closed
    

    Create Team Resource

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

    Constructor syntax

    new Team(name: string, args?: TeamArgs, opts?: CustomResourceOptions);
    @overload
    def Team(resource_name: str,
             args: Optional[TeamArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Team(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             create_default_maintainer: Optional[bool] = None,
             description: Optional[str] = None,
             ldap_dn: Optional[str] = None,
             name: Optional[str] = None,
             parent_team_id: Optional[str] = None,
             parent_team_read_id: Optional[str] = None,
             parent_team_read_slug: Optional[str] = None,
             privacy: Optional[str] = None)
    func NewTeam(ctx *Context, name string, args *TeamArgs, opts ...ResourceOption) (*Team, error)
    public Team(string name, TeamArgs? args = null, CustomResourceOptions? opts = null)
    public Team(String name, TeamArgs args)
    public Team(String name, TeamArgs args, CustomResourceOptions options)
    
    type: github:Team
    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 TeamArgs
    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 TeamArgs
    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 TeamArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamArgs
    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 teamResource = new Github.Team("teamResource", new()
    {
        CreateDefaultMaintainer = false,
        Description = "string",
        LdapDn = "string",
        Name = "string",
        ParentTeamId = "string",
        ParentTeamReadId = "string",
        ParentTeamReadSlug = "string",
        Privacy = "string",
    });
    
    example, err := github.NewTeam(ctx, "teamResource", &github.TeamArgs{
    	CreateDefaultMaintainer: pulumi.Bool(false),
    	Description:             pulumi.String("string"),
    	LdapDn:                  pulumi.String("string"),
    	Name:                    pulumi.String("string"),
    	ParentTeamId:            pulumi.String("string"),
    	ParentTeamReadId:        pulumi.String("string"),
    	ParentTeamReadSlug:      pulumi.String("string"),
    	Privacy:                 pulumi.String("string"),
    })
    
    var teamResource = new Team("teamResource", TeamArgs.builder()
        .createDefaultMaintainer(false)
        .description("string")
        .ldapDn("string")
        .name("string")
        .parentTeamId("string")
        .parentTeamReadId("string")
        .parentTeamReadSlug("string")
        .privacy("string")
        .build());
    
    team_resource = github.Team("teamResource",
        create_default_maintainer=False,
        description="string",
        ldap_dn="string",
        name="string",
        parent_team_id="string",
        parent_team_read_id="string",
        parent_team_read_slug="string",
        privacy="string")
    
    const teamResource = new github.Team("teamResource", {
        createDefaultMaintainer: false,
        description: "string",
        ldapDn: "string",
        name: "string",
        parentTeamId: "string",
        parentTeamReadId: "string",
        parentTeamReadSlug: "string",
        privacy: "string",
    });
    
    type: github:Team
    properties:
        createDefaultMaintainer: false
        description: string
        ldapDn: string
        name: string
        parentTeamId: string
        parentTeamReadId: string
        parentTeamReadSlug: string
        privacy: string
    

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

    CreateDefaultMaintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    Description string
    A description of the team.
    LdapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    Name string
    The name of the team.
    ParentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    ParentTeamReadId string
    The id of the parent team read in Github.
    ParentTeamReadSlug string
    The id of the parent team read in Github.
    Privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    CreateDefaultMaintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    Description string
    A description of the team.
    LdapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    Name string
    The name of the team.
    ParentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    ParentTeamReadId string
    The id of the parent team read in Github.
    ParentTeamReadSlug string
    The id of the parent team read in Github.
    Privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    createDefaultMaintainer Boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description String
    A description of the team.
    ldapDn String
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    name String
    The name of the team.
    parentTeamId String
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId String
    The id of the parent team read in Github.
    parentTeamReadSlug String
    The id of the parent team read in Github.
    privacy String
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    createDefaultMaintainer boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description string
    A description of the team.
    ldapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    name string
    The name of the team.
    parentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId string
    The id of the parent team read in Github.
    parentTeamReadSlug string
    The id of the parent team read in Github.
    privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    create_default_maintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description str
    A description of the team.
    ldap_dn str
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    name str
    The name of the team.
    parent_team_id str
    The ID or slug of the parent team, if this is a nested team.
    parent_team_read_id str
    The id of the parent team read in Github.
    parent_team_read_slug str
    The id of the parent team read in Github.
    privacy str
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    createDefaultMaintainer Boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description String
    A description of the team.
    ldapDn String
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    name String
    The name of the team.
    parentTeamId String
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId String
    The id of the parent team read in Github.
    parentTeamReadSlug String
    The id of the parent team read in Github.
    privacy String
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.

    Outputs

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

    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    MembersCount int
    NodeId string
    The Node ID of the created team.
    Slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    MembersCount int
    NodeId string
    The Node ID of the created team.
    Slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    membersCount Integer
    nodeId String
    The Node ID of the created team.
    slug String
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    etag string
    id string
    The provider-assigned unique ID for this managed resource.
    membersCount number
    nodeId string
    The Node ID of the created team.
    slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    etag str
    id str
    The provider-assigned unique ID for this managed resource.
    members_count int
    node_id str
    The Node ID of the created team.
    slug str
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    membersCount Number
    nodeId String
    The Node ID of the created team.
    slug String
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.

    Look up Existing Team Resource

    Get an existing Team 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?: TeamState, opts?: CustomResourceOptions): Team
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_default_maintainer: Optional[bool] = None,
            description: Optional[str] = None,
            etag: Optional[str] = None,
            ldap_dn: Optional[str] = None,
            members_count: Optional[int] = None,
            name: Optional[str] = None,
            node_id: Optional[str] = None,
            parent_team_id: Optional[str] = None,
            parent_team_read_id: Optional[str] = None,
            parent_team_read_slug: Optional[str] = None,
            privacy: Optional[str] = None,
            slug: Optional[str] = None) -> Team
    func GetTeam(ctx *Context, name string, id IDInput, state *TeamState, opts ...ResourceOption) (*Team, error)
    public static Team Get(string name, Input<string> id, TeamState? state, CustomResourceOptions? opts = null)
    public static Team get(String name, Output<String> id, TeamState 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:
    CreateDefaultMaintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    Description string
    A description of the team.
    Etag string
    LdapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    MembersCount int
    Name string
    The name of the team.
    NodeId string
    The Node ID of the created team.
    ParentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    ParentTeamReadId string
    The id of the parent team read in Github.
    ParentTeamReadSlug string
    The id of the parent team read in Github.
    Privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    Slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    CreateDefaultMaintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    Description string
    A description of the team.
    Etag string
    LdapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    MembersCount int
    Name string
    The name of the team.
    NodeId string
    The Node ID of the created team.
    ParentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    ParentTeamReadId string
    The id of the parent team read in Github.
    ParentTeamReadSlug string
    The id of the parent team read in Github.
    Privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    Slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    createDefaultMaintainer Boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description String
    A description of the team.
    etag String
    ldapDn String
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    membersCount Integer
    name String
    The name of the team.
    nodeId String
    The Node ID of the created team.
    parentTeamId String
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId String
    The id of the parent team read in Github.
    parentTeamReadSlug String
    The id of the parent team read in Github.
    privacy String
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    slug String
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    createDefaultMaintainer boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description string
    A description of the team.
    etag string
    ldapDn string
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    membersCount number
    name string
    The name of the team.
    nodeId string
    The Node ID of the created team.
    parentTeamId string
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId string
    The id of the parent team read in Github.
    parentTeamReadSlug string
    The id of the parent team read in Github.
    privacy string
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    slug string
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    create_default_maintainer bool
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description str
    A description of the team.
    etag str
    ldap_dn str
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    members_count int
    name str
    The name of the team.
    node_id str
    The Node ID of the created team.
    parent_team_id str
    The ID or slug of the parent team, if this is a nested team.
    parent_team_read_id str
    The id of the parent team read in Github.
    parent_team_read_slug str
    The id of the parent team read in Github.
    privacy str
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    slug str
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.
    createDefaultMaintainer Boolean
    Adds a default maintainer to the team. Defaults to false and adds the creating user to the team when true.
    description String
    A description of the team.
    etag String
    ldapDn String
    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server.
    membersCount Number
    name String
    The name of the team.
    nodeId String
    The Node ID of the created team.
    parentTeamId String
    The ID or slug of the parent team, if this is a nested team.
    parentTeamReadId String
    The id of the parent team read in Github.
    parentTeamReadSlug String
    The id of the parent team read in Github.
    privacy String
    The level of privacy for the team. Must be one of secret or closed. Defaults to secret.
    slug String
    The slug of the created team, which may or may not differ from name, depending on whether name contains "URL-unsafe" characters. Useful when referencing the team in github.BranchProtection.

    Import

    GitHub Teams can be imported using the GitHub team ID or name e.g.

    $ pulumi import github:index/team:Team core 1234567
    
    $ pulumi import github:index/team:Team core Administrators
    

    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.
    github logo
    GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi