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

github.OrganizationRole

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

    Manage a custom organization role.

    Note: Custom organization roles are currently only available in GitHub Enterprise Cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = new github.OrganizationRole("example", {
        name: "example",
        baseRole: "read",
        permissions: [
            "read_organization_custom_org_role",
            "read_organization_custom_repo_role",
        ],
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.OrganizationRole("example",
        name="example",
        base_role="read",
        permissions=[
            "read_organization_custom_org_role",
            "read_organization_custom_repo_role",
        ])
    
    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 {
    		_, err := github.NewOrganizationRole(ctx, "example", &github.OrganizationRoleArgs{
    			Name:     pulumi.String("example"),
    			BaseRole: pulumi.String("read"),
    			Permissions: pulumi.StringArray{
    				pulumi.String("read_organization_custom_org_role"),
    				pulumi.String("read_organization_custom_repo_role"),
    			},
    		})
    		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 example = new Github.OrganizationRole("example", new()
        {
            Name = "example",
            BaseRole = "read",
            Permissions = new[]
            {
                "read_organization_custom_org_role",
                "read_organization_custom_repo_role",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.OrganizationRole;
    import com.pulumi.github.OrganizationRoleArgs;
    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 OrganizationRole("example", OrganizationRoleArgs.builder()
                .name("example")
                .baseRole("read")
                .permissions(            
                    "read_organization_custom_org_role",
                    "read_organization_custom_repo_role")
                .build());
    
        }
    }
    
    resources:
      example:
        type: github:OrganizationRole
        properties:
          name: example
          baseRole: read
          permissions:
            - read_organization_custom_org_role
            - read_organization_custom_repo_role
    

    Create OrganizationRole Resource

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

    Constructor syntax

    new OrganizationRole(name: string, args: OrganizationRoleArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationRole(resource_name: str,
                         args: OrganizationRoleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationRole(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         permissions: Optional[Sequence[str]] = None,
                         base_role: Optional[str] = None,
                         description: Optional[str] = None,
                         name: Optional[str] = None)
    func NewOrganizationRole(ctx *Context, name string, args OrganizationRoleArgs, opts ...ResourceOption) (*OrganizationRole, error)
    public OrganizationRole(string name, OrganizationRoleArgs args, CustomResourceOptions? opts = null)
    public OrganizationRole(String name, OrganizationRoleArgs args)
    public OrganizationRole(String name, OrganizationRoleArgs args, CustomResourceOptions options)
    
    type: github:OrganizationRole
    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 OrganizationRoleArgs
    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 OrganizationRoleArgs
    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 OrganizationRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationRoleArgs
    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 organizationRoleResource = new Github.OrganizationRole("organizationRoleResource", new()
    {
        Permissions = new[]
        {
            "string",
        },
        BaseRole = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := github.NewOrganizationRole(ctx, "organizationRoleResource", &github.OrganizationRoleArgs{
    	Permissions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	BaseRole:    pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var organizationRoleResource = new OrganizationRole("organizationRoleResource", OrganizationRoleArgs.builder()
        .permissions("string")
        .baseRole("string")
        .description("string")
        .name("string")
        .build());
    
    organization_role_resource = github.OrganizationRole("organizationRoleResource",
        permissions=["string"],
        base_role="string",
        description="string",
        name="string")
    
    const organizationRoleResource = new github.OrganizationRole("organizationRoleResource", {
        permissions: ["string"],
        baseRole: "string",
        description: "string",
        name: "string",
    });
    
    type: github:OrganizationRole
    properties:
        baseRole: string
        description: string
        name: string
        permissions:
            - string
    

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

    Permissions List<string>
    The permissions included in this role.
    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Name string
    The name of the organization role.
    Permissions []string
    The permissions included in this role.
    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Name string
    The name of the organization role.
    permissions List<String>
    The permissions included in this role.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    name String
    The name of the organization role.
    permissions string[]
    The permissions included in this role.
    baseRole string
    The system role from which this role inherits permissions.
    description string
    The description of the organization role.
    name string
    The name of the organization role.
    permissions Sequence[str]
    The permissions included in this role.
    base_role str
    The system role from which this role inherits permissions.
    description str
    The description of the organization role.
    name str
    The name of the organization role.
    permissions List<String>
    The permissions included in this role.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    name String
    The name of the organization role.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId int
    The ID of the organization role.
    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId int
    The ID of the organization role.
    id String
    The provider-assigned unique ID for this managed resource.
    roleId Integer
    The ID of the organization role.
    id string
    The provider-assigned unique ID for this managed resource.
    roleId number
    The ID of the organization role.
    id str
    The provider-assigned unique ID for this managed resource.
    role_id int
    The ID of the organization role.
    id String
    The provider-assigned unique ID for this managed resource.
    roleId Number
    The ID of the organization role.

    Look up Existing OrganizationRole Resource

    Get an existing OrganizationRole 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?: OrganizationRoleState, opts?: CustomResourceOptions): OrganizationRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            base_role: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            permissions: Optional[Sequence[str]] = None,
            role_id: Optional[int] = None) -> OrganizationRole
    func GetOrganizationRole(ctx *Context, name string, id IDInput, state *OrganizationRoleState, opts ...ResourceOption) (*OrganizationRole, error)
    public static OrganizationRole Get(string name, Input<string> id, OrganizationRoleState? state, CustomResourceOptions? opts = null)
    public static OrganizationRole get(String name, Output<String> id, OrganizationRoleState state, CustomResourceOptions options)
    resources:  _:    type: github:OrganizationRole    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:
    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Name string
    The name of the organization role.
    Permissions List<string>
    The permissions included in this role.
    RoleId int
    The ID of the organization role.
    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Name string
    The name of the organization role.
    Permissions []string
    The permissions included in this role.
    RoleId int
    The ID of the organization role.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    name String
    The name of the organization role.
    permissions List<String>
    The permissions included in this role.
    roleId Integer
    The ID of the organization role.
    baseRole string
    The system role from which this role inherits permissions.
    description string
    The description of the organization role.
    name string
    The name of the organization role.
    permissions string[]
    The permissions included in this role.
    roleId number
    The ID of the organization role.
    base_role str
    The system role from which this role inherits permissions.
    description str
    The description of the organization role.
    name str
    The name of the organization role.
    permissions Sequence[str]
    The permissions included in this role.
    role_id int
    The ID of the organization role.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    name String
    The name of the organization role.
    permissions List<String>
    The permissions included in this role.
    roleId Number
    The ID of the organization role.

    Import

    A custom organization role can be imported using its ID.

    $ pulumi import github:index/organizationRole:OrganizationRole example 1234
    

    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