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

github.getOrganizationRole

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

    Lookup a custom organization role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = github.getOrganizationRole({
        roleId: 1234,
    });
    
    import pulumi
    import pulumi_github as github
    
    example = github.get_organization_role(role_id=1234)
    
    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.LookupOrganizationRole(ctx, &github.LookupOrganizationRoleArgs{
    			RoleId: 1234,
    		}, nil)
    		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 = Github.GetOrganizationRole.Invoke(new()
        {
            RoleId = 1234,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.GithubFunctions;
    import com.pulumi.github.inputs.GetOrganizationRoleArgs;
    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) {
            final var example = GithubFunctions.getOrganizationRole(GetOrganizationRoleArgs.builder()
                .roleId(1234)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: github:getOrganizationRole
          arguments:
            roleId: 1234
    

    Using getOrganizationRole

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getOrganizationRole(args: GetOrganizationRoleArgs, opts?: InvokeOptions): Promise<GetOrganizationRoleResult>
    function getOrganizationRoleOutput(args: GetOrganizationRoleOutputArgs, opts?: InvokeOptions): Output<GetOrganizationRoleResult>
    def get_organization_role(role_id: Optional[int] = None,
                              opts: Optional[InvokeOptions] = None) -> GetOrganizationRoleResult
    def get_organization_role_output(role_id: Optional[pulumi.Input[int]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetOrganizationRoleResult]
    func LookupOrganizationRole(ctx *Context, args *LookupOrganizationRoleArgs, opts ...InvokeOption) (*LookupOrganizationRoleResult, error)
    func LookupOrganizationRoleOutput(ctx *Context, args *LookupOrganizationRoleOutputArgs, opts ...InvokeOption) LookupOrganizationRoleResultOutput

    > Note: This function is named LookupOrganizationRole in the Go SDK.

    public static class GetOrganizationRole 
    {
        public static Task<GetOrganizationRoleResult> InvokeAsync(GetOrganizationRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetOrganizationRoleResult> Invoke(GetOrganizationRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOrganizationRoleResult> getOrganizationRole(GetOrganizationRoleArgs args, InvokeOptions options)
    public static Output<GetOrganizationRoleResult> getOrganizationRole(GetOrganizationRoleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: github:index/getOrganizationRole:getOrganizationRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RoleId int
    The ID of the organization role.
    RoleId int
    The ID of the organization role.
    roleId Integer
    The ID of the organization role.
    roleId number
    The ID of the organization role.
    role_id int
    The ID of the organization role.
    roleId Number
    The ID of the organization role.

    getOrganizationRole Result

    The following output properties are available:

    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Id string
    The provider-assigned unique ID for this managed resource.
    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.
    Source string
    The source of this role; one of Predefined, Organization, or Enterprise.
    BaseRole string
    The system role from which this role inherits permissions.
    Description string
    The description of the organization role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the organization role.
    Permissions []string
    The permissions included in this role.
    RoleId int
    The ID of the organization role.
    Source string
    The source of this role; one of Predefined, Organization, or Enterprise.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    id String
    The provider-assigned unique ID for this managed resource.
    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.
    source String
    The source of this role; one of Predefined, Organization, or Enterprise.
    baseRole string
    The system role from which this role inherits permissions.
    description string
    The description of the organization role.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the organization role.
    permissions string[]
    The permissions included in this role.
    roleId number
    The ID of the organization role.
    source string
    The source of this role; one of Predefined, Organization, or Enterprise.
    base_role str
    The system role from which this role inherits permissions.
    description str
    The description of the organization role.
    id str
    The provider-assigned unique ID for this managed resource.
    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.
    source str
    The source of this role; one of Predefined, Organization, or Enterprise.
    baseRole String
    The system role from which this role inherits permissions.
    description String
    The description of the organization role.
    id String
    The provider-assigned unique ID for this managed resource.
    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.
    source String
    The source of this role; one of Predefined, Organization, or Enterprise.

    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