Viewing docs for Auth0 v2.24.3 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for Auth0 v2.24.3 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Data source to retrieve a specific Auth0 role by role_id or name.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Auth0 = Pulumi.Auth0;
return await Deployment.RunAsync(() =>
{
var some_role_by_name = Auth0.GetRole.Invoke(new()
{
Name = "my-role",
});
var some_role_by_id = Auth0.GetRole.Invoke(new()
{
RoleId = "abcdefghkijklmnopqrstuvwxyz0123456789",
});
});
package main
import (
"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := auth0.LookupRole(ctx, &auth0.LookupRoleArgs{
Name: pulumi.StringRef("my-role"),
}, nil)
if err != nil {
return err
}
_, err = auth0.LookupRole(ctx, &auth0.LookupRoleArgs{
RoleId: pulumi.StringRef("abcdefghkijklmnopqrstuvwxyz0123456789"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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) {
final var some-role-by-name = Auth0Functions.getRole(GetRoleArgs.builder()
.name("my-role")
.build());
final var some-role-by-id = Auth0Functions.getRole(GetRoleArgs.builder()
.roleId("abcdefghkijklmnopqrstuvwxyz0123456789")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";
const some-role-by-name = auth0.getRole({
name: "my-role",
});
const some-role-by-id = auth0.getRole({
roleId: "abcdefghkijklmnopqrstuvwxyz0123456789",
});
import pulumi
import pulumi_auth0 as auth0
some_role_by_name = auth0.get_role(name="my-role")
some_role_by_id = auth0.get_role(role_id="abcdefghkijklmnopqrstuvwxyz0123456789")
variables:
some-role-by-name:
fn::invoke:
Function: auth0:getRole
Arguments:
name: my-role
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)
public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
fn::invoke:
function: auth0:index/getRole:getRole
arguments:
# arguments dictionaryThe following arguments are supported:
getRole Result
The following output properties are available:
- Description string
- Description of the role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Permissions
List<Get
Role Permission> - Name string
- The name of the role. If not provided,
role_idmust be set. - Role
Id string - The ID of the role. If not provided,
namemust be set.
- Description string
- Description of the role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Permissions
[]Get
Role Permission Type - Name string
- The name of the role. If not provided,
role_idmust be set. - Role
Id string - The ID of the role. If not provided,
namemust be set.
- description String
- Description of the role.
- id String
- The provider-assigned unique ID for this managed resource.
- permissions
List<Get
Role Permission> - name String
- The name of the role. If not provided,
role_idmust be set. - role
Id String - The ID of the role. If not provided,
namemust be set.
- description string
- Description of the role.
- id string
- The provider-assigned unique ID for this managed resource.
- permissions
Get
Role Permission[] - name string
- The name of the role. If not provided,
role_idmust be set. - role
Id string - The ID of the role. If not provided,
namemust be set.
- description str
- Description of the role.
- id str
- The provider-assigned unique ID for this managed resource.
- permissions
Sequence[Get
Role Permission] - name str
- The name of the role. If not provided,
role_idmust be set. - role_
id str - The ID of the role. If not provided,
namemust be set.
- description String
- Description of the role.
- id String
- The provider-assigned unique ID for this managed resource.
- permissions List<Property Map>
- name String
- The name of the role. If not provided,
role_idmust be set. - role
Id String - The ID of the role. If not provided,
namemust be set.
Supporting Types
GetRolePermission
- Description string
- Description of the role.
- Name string
- The name of the role. If not provided,
role_idmust be set. - Resource
Server stringIdentifier - Resource
Server stringName
- Description string
- Description of the role.
- Name string
- The name of the role. If not provided,
role_idmust be set. - Resource
Server stringIdentifier - Resource
Server stringName
- description String
- Description of the role.
- name String
- The name of the role. If not provided,
role_idmust be set. - resource
Server StringIdentifier - resource
Server StringName
- description string
- Description of the role.
- name string
- The name of the role. If not provided,
role_idmust be set. - resource
Server stringIdentifier - resource
Server stringName
- description str
- Description of the role.
- name str
- The name of the role. If not provided,
role_idmust be set. - resource_
server_ stridentifier - resource_
server_ strname
- description String
- Description of the role.
- name String
- The name of the role. If not provided,
role_idmust be set. - resource
Server StringIdentifier - resource
Server StringName
Package Details
- Repository
- Auth0 pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0Terraform Provider.
Viewing docs for Auth0 v2.24.3 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
