1. Packages
  2. Auth0 Provider
  3. API Docs
  4. getRole
Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 by Pulumi

auth0.getRole

Explore with Pulumi AI

auth0 logo
Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 by Pulumi

    Data source to retrieve a specific Auth0 role by role_id or name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as auth0 from "@pulumi/auth0";
    
    // An Auth0 Role loaded using its name.
    const some-role-by-name = auth0.getRole({
        name: "my-role",
    });
    // An Auth0 Role loaded using its ID.
    const some-role-by-id = auth0.getRole({
        roleId: "abcdefghkijklmnopqrstuvwxyz0123456789",
    });
    
    import pulumi
    import pulumi_auth0 as auth0
    
    # An Auth0 Role loaded using its name.
    some_role_by_name = auth0.get_role(name="my-role")
    # An Auth0 Role loaded using its ID.
    some_role_by_id = auth0.get_role(role_id="abcdefghkijklmnopqrstuvwxyz0123456789")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-auth0/sdk/v3/go/auth0"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// An Auth0 Role loaded using its name.
    		_, err := auth0.LookupRole(ctx, &auth0.LookupRoleArgs{
    			Name: pulumi.StringRef("my-role"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// An Auth0 Role loaded using its ID.
    		_, err = auth0.LookupRole(ctx, &auth0.LookupRoleArgs{
    			RoleId: pulumi.StringRef("abcdefghkijklmnopqrstuvwxyz0123456789"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Auth0 = Pulumi.Auth0;
    
    return await Deployment.RunAsync(() => 
    {
        // An Auth0 Role loaded using its name.
        var some_role_by_name = Auth0.GetRole.Invoke(new()
        {
            Name = "my-role",
        });
    
        // An Auth0 Role loaded using its ID.
        var some_role_by_id = Auth0.GetRole.Invoke(new()
        {
            RoleId = "abcdefghkijklmnopqrstuvwxyz0123456789",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.auth0.Auth0Functions;
    import com.pulumi.auth0.inputs.GetRoleArgs;
    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) {
            // An Auth0 Role loaded using its name.
            final var some-role-by-name = Auth0Functions.getRole(GetRoleArgs.builder()
                .name("my-role")
                .build());
    
            // An Auth0 Role loaded using its ID.
            final var some-role-by-id = Auth0Functions.getRole(GetRoleArgs.builder()
                .roleId("abcdefghkijklmnopqrstuvwxyz0123456789")
                .build());
    
        }
    }
    
    variables:
      # An Auth0 Role loaded using its name.
      some-role-by-name:
        fn::invoke:
          Function: auth0:getRole
          Arguments:
            name: my-role
      # An Auth0 Role loaded using its ID.
      some-role-by-id:
        fn::invoke:
          Function: auth0:getRole
          Arguments:
            roleId: abcdefghkijklmnopqrstuvwxyz0123456789
    

    Using getRole

    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 getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
    function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
    def get_role(name: Optional[str] = None,
                 role_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(name: Optional[pulumi.Input[str]] = None,
                 role_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
    func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
    func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput

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

    public static class GetRole 
    {
        public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: auth0:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the role. If not provided, role_id must be set.
    RoleId string
    The ID of the role. If not provided, name must be set.
    Name string
    The name of the role. If not provided, role_id must be set.
    RoleId string
    The ID of the role. If not provided, name must be set.
    name String
    The name of the role. If not provided, role_id must be set.
    roleId String
    The ID of the role. If not provided, name must be set.
    name string
    The name of the role. If not provided, role_id must be set.
    roleId string
    The ID of the role. If not provided, name must be set.
    name str
    The name of the role. If not provided, role_id must be set.
    role_id str
    The ID of the role. If not provided, name must be set.
    name String
    The name of the role. If not provided, role_id must be set.
    roleId String
    The ID of the role. If not provided, name must be set.

    getRole Result

    The following output properties are available:

    Description string
    The description of the role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Permissions List<GetRolePermission>
    Configuration settings for permissions (scopes) attached to the role.
    Users List<string>
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    Name string
    The name of the role. If not provided, role_id must be set.
    RoleId string
    The ID of the role. If not provided, name must be set.
    Description string
    The description of the role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Permissions []GetRolePermissionType
    Configuration settings for permissions (scopes) attached to the role.
    Users []string
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    Name string
    The name of the role. If not provided, role_id must be set.
    RoleId string
    The ID of the role. If not provided, name must be set.
    description String
    The description of the role.
    id String
    The provider-assigned unique ID for this managed resource.
    permissions List<GetRolePermission>
    Configuration settings for permissions (scopes) attached to the role.
    users List<String>
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    name String
    The name of the role. If not provided, role_id must be set.
    roleId String
    The ID of the role. If not provided, name must be set.
    description string
    The description of the role.
    id string
    The provider-assigned unique ID for this managed resource.
    permissions GetRolePermission[]
    Configuration settings for permissions (scopes) attached to the role.
    users string[]
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    name string
    The name of the role. If not provided, role_id must be set.
    roleId string
    The ID of the role. If not provided, name must be set.
    description str
    The description of the role.
    id str
    The provider-assigned unique ID for this managed resource.
    permissions Sequence[GetRolePermission]
    Configuration settings for permissions (scopes) attached to the role.
    users Sequence[str]
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    name str
    The name of the role. If not provided, role_id must be set.
    role_id str
    The ID of the role. If not provided, name must be set.
    description String
    The description of the role.
    id String
    The provider-assigned unique ID for this managed resource.
    permissions List<Property Map>
    Configuration settings for permissions (scopes) attached to the role.
    users List<String>
    List of user IDs assigned to this role. Retrieves a maximum of 1000 user IDs.
    name String
    The name of the role. If not provided, role_id must be set.
    roleId String
    The ID of the role. If not provided, name must be set.

    Supporting Types

    GetRolePermission

    Description string
    Description of the permission.
    Name string
    Name of the permission (scope) configured on the resource server (API).
    ResourceServerIdentifier string
    Unique identifier for the resource server (API).
    ResourceServerName string
    Name of resource server (API) that the permission is associated with.
    Description string
    Description of the permission.
    Name string
    Name of the permission (scope) configured on the resource server (API).
    ResourceServerIdentifier string
    Unique identifier for the resource server (API).
    ResourceServerName string
    Name of resource server (API) that the permission is associated with.
    description String
    Description of the permission.
    name String
    Name of the permission (scope) configured on the resource server (API).
    resourceServerIdentifier String
    Unique identifier for the resource server (API).
    resourceServerName String
    Name of resource server (API) that the permission is associated with.
    description string
    Description of the permission.
    name string
    Name of the permission (scope) configured on the resource server (API).
    resourceServerIdentifier string
    Unique identifier for the resource server (API).
    resourceServerName string
    Name of resource server (API) that the permission is associated with.
    description str
    Description of the permission.
    name str
    Name of the permission (scope) configured on the resource server (API).
    resource_server_identifier str
    Unique identifier for the resource server (API).
    resource_server_name str
    Name of resource server (API) that the permission is associated with.
    description String
    Description of the permission.
    name String
    Name of the permission (scope) configured on the resource server (API).
    resourceServerIdentifier String
    Unique identifier for the resource server (API).
    resourceServerName String
    Name of resource server (API) that the permission is associated with.

    Package Details

    Repository
    Auth0 pulumi/pulumi-auth0
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the auth0 Terraform Provider.
    auth0 logo
    Auth0 v3.8.3 published on Wednesday, Nov 6, 2024 by Pulumi