1. Packages
  2. Github Provider
  3. API Docs
  4. OrganizationRoleTeamAssignment
GitHub v6.8.0 published on Thursday, Oct 23, 2025 by Pulumi

github.OrganizationRoleTeamAssignment

Get Started
github logo
GitHub v6.8.0 published on Thursday, Oct 23, 2025 by Pulumi

    This resource manages relationships between teams and organization roles in your GitHub organization. This works on predefined roles, and custom roles, where the latter is an Enterprise feature.

    Creating this resource assigns the role to a team.

    The organization role and team must both belong to the same organization on GitHub.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const test_team = new github.Team("test-team", {name: "test-team"});
    const test_team_role_assignment = new github.OrganizationRoleTeamAssignment("test-team-role-assignment", {
        teamSlug: test_team.slug,
        roleId: "8132",
    });
    
    import pulumi
    import pulumi_github as github
    
    test_team = github.Team("test-team", name="test-team")
    test_team_role_assignment = github.OrganizationRoleTeamAssignment("test-team-role-assignment",
        team_slug=test_team.slug,
        role_id="8132")
    
    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_team, err := github.NewTeam(ctx, "test-team", &github.TeamArgs{
    			Name: pulumi.String("test-team"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewOrganizationRoleTeamAssignment(ctx, "test-team-role-assignment", &github.OrganizationRoleTeamAssignmentArgs{
    			TeamSlug: test_team.Slug,
    			RoleId:   pulumi.String("8132"),
    		})
    		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_team = new Github.Team("test-team", new()
        {
            Name = "test-team",
        });
    
        var test_team_role_assignment = new Github.OrganizationRoleTeamAssignment("test-team-role-assignment", new()
        {
            TeamSlug = test_team.Slug,
            RoleId = "8132",
        });
    
    });
    
    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 com.pulumi.github.OrganizationRoleTeamAssignment;
    import com.pulumi.github.OrganizationRoleTeamAssignmentArgs;
    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_team = new Team("test-team", TeamArgs.builder()
                .name("test-team")
                .build());
    
            var test_team_role_assignment = new OrganizationRoleTeamAssignment("test-team-role-assignment", OrganizationRoleTeamAssignmentArgs.builder()
                .teamSlug(test_team.slug())
                .roleId("8132")
                .build());
    
        }
    }
    
    resources:
      test-team:
        type: github:Team
        properties:
          name: test-team
      test-team-role-assignment:
        type: github:OrganizationRoleTeamAssignment
        properties:
          teamSlug: ${["test-team"].slug}
          roleId: '8132'
    

    Create OrganizationRoleTeamAssignment Resource

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

    Constructor syntax

    new OrganizationRoleTeamAssignment(name: string, args: OrganizationRoleTeamAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationRoleTeamAssignment(resource_name: str,
                                       args: OrganizationRoleTeamAssignmentArgs,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationRoleTeamAssignment(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       role_id: Optional[str] = None,
                                       team_slug: Optional[str] = None)
    func NewOrganizationRoleTeamAssignment(ctx *Context, name string, args OrganizationRoleTeamAssignmentArgs, opts ...ResourceOption) (*OrganizationRoleTeamAssignment, error)
    public OrganizationRoleTeamAssignment(string name, OrganizationRoleTeamAssignmentArgs args, CustomResourceOptions? opts = null)
    public OrganizationRoleTeamAssignment(String name, OrganizationRoleTeamAssignmentArgs args)
    public OrganizationRoleTeamAssignment(String name, OrganizationRoleTeamAssignmentArgs args, CustomResourceOptions options)
    
    type: github:OrganizationRoleTeamAssignment
    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 OrganizationRoleTeamAssignmentArgs
    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 OrganizationRoleTeamAssignmentArgs
    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 OrganizationRoleTeamAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationRoleTeamAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationRoleTeamAssignmentArgs
    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 organizationRoleTeamAssignmentResource = new Github.OrganizationRoleTeamAssignment("organizationRoleTeamAssignmentResource", new()
    {
        RoleId = "string",
        TeamSlug = "string",
    });
    
    example, err := github.NewOrganizationRoleTeamAssignment(ctx, "organizationRoleTeamAssignmentResource", &github.OrganizationRoleTeamAssignmentArgs{
    	RoleId:   pulumi.String("string"),
    	TeamSlug: pulumi.String("string"),
    })
    
    var organizationRoleTeamAssignmentResource = new OrganizationRoleTeamAssignment("organizationRoleTeamAssignmentResource", OrganizationRoleTeamAssignmentArgs.builder()
        .roleId("string")
        .teamSlug("string")
        .build());
    
    organization_role_team_assignment_resource = github.OrganizationRoleTeamAssignment("organizationRoleTeamAssignmentResource",
        role_id="string",
        team_slug="string")
    
    const organizationRoleTeamAssignmentResource = new github.OrganizationRoleTeamAssignment("organizationRoleTeamAssignmentResource", {
        roleId: "string",
        teamSlug: "string",
    });
    
    type: github:OrganizationRoleTeamAssignment
    properties:
        roleId: string
        teamSlug: string
    

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

    RoleId string
    The GitHub organization role id
    TeamSlug string
    The GitHub team slug
    RoleId string
    The GitHub organization role id
    TeamSlug string
    The GitHub team slug
    roleId String
    The GitHub organization role id
    teamSlug String
    The GitHub team slug
    roleId string
    The GitHub organization role id
    teamSlug string
    The GitHub team slug
    role_id str
    The GitHub organization role id
    team_slug str
    The GitHub team slug
    roleId String
    The GitHub organization role id
    teamSlug String
    The GitHub team slug

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing OrganizationRoleTeamAssignment Resource

    Get an existing OrganizationRoleTeamAssignment 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?: OrganizationRoleTeamAssignmentState, opts?: CustomResourceOptions): OrganizationRoleTeamAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            role_id: Optional[str] = None,
            team_slug: Optional[str] = None) -> OrganizationRoleTeamAssignment
    func GetOrganizationRoleTeamAssignment(ctx *Context, name string, id IDInput, state *OrganizationRoleTeamAssignmentState, opts ...ResourceOption) (*OrganizationRoleTeamAssignment, error)
    public static OrganizationRoleTeamAssignment Get(string name, Input<string> id, OrganizationRoleTeamAssignmentState? state, CustomResourceOptions? opts = null)
    public static OrganizationRoleTeamAssignment get(String name, Output<String> id, OrganizationRoleTeamAssignmentState state, CustomResourceOptions options)
    resources:  _:    type: github:OrganizationRoleTeamAssignment    get:      id: ${id}
    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:
    RoleId string
    The GitHub organization role id
    TeamSlug string
    The GitHub team slug
    RoleId string
    The GitHub organization role id
    TeamSlug string
    The GitHub team slug
    roleId String
    The GitHub organization role id
    teamSlug String
    The GitHub team slug
    roleId string
    The GitHub organization role id
    teamSlug string
    The GitHub team slug
    role_id str
    The GitHub organization role id
    team_slug str
    The GitHub team slug
    roleId String
    The GitHub organization role id
    teamSlug String
    The GitHub team slug

    Import

    GitHub Team Organization Role Assignment can be imported using an ID made up of team_slug:role_id

    $ pulumi import github:index/organizationRoleTeamAssignment:OrganizationRoleTeamAssignment role_assignment test-team:8132
    

    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.8.0 published on Thursday, Oct 23, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate