1. Registry
  2. Packages
  3. Pulumi Cloud (Pulumi Service provider)
  4. API Docs
  5. getOrganizationRoles
Viewing docs for Pulumi Cloud v1.5.0
published on Monday, Oct 19, 2026 by Pulumi
pulumiservice logo pulumiservice logo
Viewing docs for Pulumi Cloud v1.5.0
published on Monday, Oct 19, 2026 by Pulumi

    Lists the roles in a Pulumi Cloud organization, including both built-in and custom roles, sorted by name. To look up a single role by the name shown in the Pulumi Cloud console, use getOrganizationRole.

    Example Usage

    List all roles

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using PulumiService = Pulumi.PulumiService;
    
    return await Deployment.RunAsync(() => 
    {
        var allRoles = PulumiService.GetOrganizationRoles.Invoke(new()
        {
            OrganizationName = "my-org",
        });
    
        return new Dictionary<string, object?>
        {
            ["roles"] = allRoles.Apply(getOrganizationRolesResult => getOrganizationRolesResult.Roles),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-pulumiservice/sdk/go/pulumiservice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		allRoles := pulumiservice.GetOrganizationRolesOutput(ctx, pulumiservice.GetOrganizationRolesOutputArgs{
    			OrganizationName: pulumi.String("my-org"),
    		}, nil)
    		ctx.Export("roles", allRoles.ApplyT(func(allRoles pulumiservice.GetOrganizationRolesResult) ([]pulumiservice.OrganizationRoleInfo, error) {
    			return allRoles.Roles.([]pulumiservice.OrganizationRoleInfo), nil
    		}).(pulumi.ArrayOutput))
    		return nil
    	})
    }
    

    Example coming soon!

    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.pulumiservice.PulumiserviceFunctions;
    import com.pulumi.pulumiservice.inputs.GetOrganizationRolesArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 allRoles = PulumiserviceFunctions.getOrganizationRoles(GetOrganizationRolesArgs.builder()
                .organizationName("my-org")
                .build());
    
            ctx.export("roles", allRoles.applyValue(_allRoles -> _allRoles.roles()));
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as pulumiservice from "@pulumi/pulumiservice";
    
    const allRoles = pulumiservice.getOrganizationRolesOutput({
        organizationName: "my-org",
    });
    export const roles = allRoles.apply(allRoles => allRoles.roles);
    
    import pulumi
    import pulumi_pulumiservice as pulumiservice
    
    all_roles = pulumiservice.get_organization_roles_output(organization_name="my-org")
    pulumi.export("roles", all_roles.roles)
    
    variables:
      allRoles:
        fn::invoke:
          function: pulumiservice:getOrganizationRoles
          arguments:
            organizationName: my-org
    outputs:
      roles: ${allRoles.roles}
    

    Using getOrganizationRoles

    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 getOrganizationRoles(args: GetOrganizationRolesArgs, opts?: InvokeOptions): Promise<GetOrganizationRolesResult>
    function getOrganizationRolesOutput(args: GetOrganizationRolesOutputArgs, opts?: InvokeOutputOptions): Output<GetOrganizationRolesResult>
    def get_organization_roles(organization_name: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetOrganizationRolesResult
    def get_organization_roles_output(organization_name: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOutputOptions] = None) -> Output[GetOrganizationRolesResult]
    func GetOrganizationRoles(ctx *Context, args *GetOrganizationRolesArgs, opts ...InvokeOption) (*GetOrganizationRolesResult, error)
    func GetOrganizationRolesOutput(ctx *Context, args *GetOrganizationRolesOutputArgs, opts ...InvokeOption) GetOrganizationRolesResultOutput

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

    public static class GetOrganizationRoles 
    {
        public static Task<GetOrganizationRolesResult> InvokeAsync(GetOrganizationRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetOrganizationRolesResult> Invoke(GetOrganizationRolesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetOrganizationRolesResult> Invoke(GetOrganizationRolesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetOrganizationRolesResult> getOrganizationRoles(GetOrganizationRolesArgs args, InvokeOptions options)
    public static Output<GetOrganizationRolesResult> getOrganizationRoles(GetOrganizationRolesArgs args, InvokeOptions options)
    public static Output<GetOrganizationRolesResult> getOrganizationRoles(GetOrganizationRolesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: pulumiservice:getOrganizationRoles
      arguments:
        # arguments dictionary
    data "pulumiservice_get_organization_roles" "name" {
        # arguments
    }

    The following arguments are supported:

    OrganizationName string
    The name of the Pulumi organization.
    OrganizationName string
    The name of the Pulumi organization.
    organization_name string
    The name of the Pulumi organization.
    organizationName String
    The name of the Pulumi organization.
    organizationName string
    The name of the Pulumi organization.
    organization_name str
    The name of the Pulumi organization.
    organizationName String
    The name of the Pulumi organization.

    getOrganizationRoles Result

    The following output properties are available:

    Roles List<Pulumi.PulumiService.Outputs.OrganizationRoleInfo>
    The organization's roles, built-in and custom, sorted by name.
    Roles []OrganizationRoleInfo
    The organization's roles, built-in and custom, sorted by name.
    roles list(object)
    The organization's roles, built-in and custom, sorted by name.
    roles List<OrganizationRoleInfo>
    The organization's roles, built-in and custom, sorted by name.
    roles OrganizationRoleInfo[]
    The organization's roles, built-in and custom, sorted by name.
    roles Sequence[OrganizationRoleInfo]
    The organization's roles, built-in and custom, sorted by name.
    roles List<Property Map>
    The organization's roles, built-in and custom, sorted by name.

    Supporting Types

    OrganizationRoleInfo

    BuiltIn bool
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    Name string
    The role's name, as shown in the Pulumi Cloud console.
    RoleId string
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    Description string
    The role's description, if it has one.
    BuiltIn bool
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    Name string
    The role's name, as shown in the Pulumi Cloud console.
    RoleId string
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    Description string
    The role's description, if it has one.
    built_in bool
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    name string
    The role's name, as shown in the Pulumi Cloud console.
    role_id string
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    description string
    The role's description, if it has one.
    builtIn Boolean
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    name String
    The role's name, as shown in the Pulumi Cloud console.
    roleId String
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    description String
    The role's description, if it has one.
    builtIn boolean
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    name string
    The role's name, as shown in the Pulumi Cloud console.
    roleId string
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    description string
    The role's description, if it has one.
    built_in bool
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    name str
    The role's name, as shown in the Pulumi Cloud console.
    role_id str
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    description str
    The role's description, if it has one.
    builtIn Boolean
    Whether this is one of the roles every organization has (Admin, Member and Billing Manager), rather than a custom role.
    name String
    The role's name, as shown in the Pulumi Cloud console.
    roleId String
    The role's ID. Pass it to inputs that take a role ID, such as TeamRoleAssignment.roleId and OrganizationMember.roleId.
    description String
    The role's description, if it has one.

    Package Details

    Repository
    pulumiservice pulumi/pulumi-pulumiservice
    License
    Apache-2.0
    pulumiservice logo pulumiservice logo
    Viewing docs for Pulumi Cloud v1.5.0
    published on Monday, Oct 19, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial