1. Packages
  2. Auth0 Provider
  3. API Docs
  4. RolePermission
Auth0 v3.17.0 published on Wednesday, Apr 9, 2025 by Pulumi

auth0.RolePermission

Explore with Pulumi AI

With this resource, you can manage role permissions (1-1).

!> This resource appends a permission to a role. In contrast, the auth0.RolePermissions resource manages all the permissions assigned to a role. To avoid potential issues, it is recommended not to use this resource in conjunction with the auth0.RolePermissions resource when managing permissions for the same role id.

Create RolePermission Resource

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

Constructor syntax

new RolePermission(name: string, args: RolePermissionArgs, opts?: CustomResourceOptions);
@overload
def RolePermission(resource_name: str,
                   args: RolePermissionArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def RolePermission(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   permission: Optional[str] = None,
                   resource_server_identifier: Optional[str] = None,
                   role_id: Optional[str] = None)
func NewRolePermission(ctx *Context, name string, args RolePermissionArgs, opts ...ResourceOption) (*RolePermission, error)
public RolePermission(string name, RolePermissionArgs args, CustomResourceOptions? opts = null)
public RolePermission(String name, RolePermissionArgs args)
public RolePermission(String name, RolePermissionArgs args, CustomResourceOptions options)
type: auth0:RolePermission
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RolePermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RolePermissionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RolePermissionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RolePermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RolePermissionArgs
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 rolePermissionResource = new Auth0.RolePermission("rolePermissionResource", new()
{
    Permission = "string",
    ResourceServerIdentifier = "string",
    RoleId = "string",
});
Copy
example, err := auth0.NewRolePermission(ctx, "rolePermissionResource", &auth0.RolePermissionArgs{
	Permission:               pulumi.String("string"),
	ResourceServerIdentifier: pulumi.String("string"),
	RoleId:                   pulumi.String("string"),
})
Copy
var rolePermissionResource = new RolePermission("rolePermissionResource", RolePermissionArgs.builder()
    .permission("string")
    .resourceServerIdentifier("string")
    .roleId("string")
    .build());
Copy
role_permission_resource = auth0.RolePermission("rolePermissionResource",
    permission="string",
    resource_server_identifier="string",
    role_id="string")
Copy
const rolePermissionResource = new auth0.RolePermission("rolePermissionResource", {
    permission: "string",
    resourceServerIdentifier: "string",
    roleId: "string",
});
Copy
type: auth0:RolePermission
properties:
    permission: string
    resourceServerIdentifier: string
    roleId: string
Copy

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

Permission
This property is required.
Changes to this property will trigger replacement.
string
Name of the permission.
ResourceServerIdentifier
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the resource server that the permission is associated with.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
ID of the role to associate the permission to.
Permission
This property is required.
Changes to this property will trigger replacement.
string
Name of the permission.
ResourceServerIdentifier
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the resource server that the permission is associated with.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
ID of the role to associate the permission to.
permission
This property is required.
Changes to this property will trigger replacement.
String
Name of the permission.
resourceServerIdentifier
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the resource server that the permission is associated with.
roleId
This property is required.
Changes to this property will trigger replacement.
String
ID of the role to associate the permission to.
permission
This property is required.
Changes to this property will trigger replacement.
string
Name of the permission.
resourceServerIdentifier
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the resource server that the permission is associated with.
roleId
This property is required.
Changes to this property will trigger replacement.
string
ID of the role to associate the permission to.
permission
This property is required.
Changes to this property will trigger replacement.
str
Name of the permission.
resource_server_identifier
This property is required.
Changes to this property will trigger replacement.
str
Identifier of the resource server that the permission is associated with.
role_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the role to associate the permission to.
permission
This property is required.
Changes to this property will trigger replacement.
String
Name of the permission.
resourceServerIdentifier
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the resource server that the permission is associated with.
roleId
This property is required.
Changes to this property will trigger replacement.
String
ID of the role to associate the permission to.

Outputs

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

Description string
Description of the permission.
Id string
The provider-assigned unique ID for this managed resource.
ResourceServerName string
Name of the resource server that the permission is associated with.
Description string
Description of the permission.
Id string
The provider-assigned unique ID for this managed resource.
ResourceServerName string
Name of the resource server that the permission is associated with.
description String
Description of the permission.
id String
The provider-assigned unique ID for this managed resource.
resourceServerName String
Name of the resource server that the permission is associated with.
description string
Description of the permission.
id string
The provider-assigned unique ID for this managed resource.
resourceServerName string
Name of the resource server that the permission is associated with.
description str
Description of the permission.
id str
The provider-assigned unique ID for this managed resource.
resource_server_name str
Name of the resource server that the permission is associated with.
description String
Description of the permission.
id String
The provider-assigned unique ID for this managed resource.
resourceServerName String
Name of the resource server that the permission is associated with.

Look up Existing RolePermission Resource

Get an existing RolePermission 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?: RolePermissionState, opts?: CustomResourceOptions): RolePermission
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        permission: Optional[str] = None,
        resource_server_identifier: Optional[str] = None,
        resource_server_name: Optional[str] = None,
        role_id: Optional[str] = None) -> RolePermission
func GetRolePermission(ctx *Context, name string, id IDInput, state *RolePermissionState, opts ...ResourceOption) (*RolePermission, error)
public static RolePermission Get(string name, Input<string> id, RolePermissionState? state, CustomResourceOptions? opts = null)
public static RolePermission get(String name, Output<String> id, RolePermissionState state, CustomResourceOptions options)
resources:  _:    type: auth0:RolePermission    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
Description of the permission.
Permission Changes to this property will trigger replacement. string
Name of the permission.
ResourceServerIdentifier Changes to this property will trigger replacement. string
Identifier of the resource server that the permission is associated with.
ResourceServerName string
Name of the resource server that the permission is associated with.
RoleId Changes to this property will trigger replacement. string
ID of the role to associate the permission to.
Description string
Description of the permission.
Permission Changes to this property will trigger replacement. string
Name of the permission.
ResourceServerIdentifier Changes to this property will trigger replacement. string
Identifier of the resource server that the permission is associated with.
ResourceServerName string
Name of the resource server that the permission is associated with.
RoleId Changes to this property will trigger replacement. string
ID of the role to associate the permission to.
description String
Description of the permission.
permission Changes to this property will trigger replacement. String
Name of the permission.
resourceServerIdentifier Changes to this property will trigger replacement. String
Identifier of the resource server that the permission is associated with.
resourceServerName String
Name of the resource server that the permission is associated with.
roleId Changes to this property will trigger replacement. String
ID of the role to associate the permission to.
description string
Description of the permission.
permission Changes to this property will trigger replacement. string
Name of the permission.
resourceServerIdentifier Changes to this property will trigger replacement. string
Identifier of the resource server that the permission is associated with.
resourceServerName string
Name of the resource server that the permission is associated with.
roleId Changes to this property will trigger replacement. string
ID of the role to associate the permission to.
description str
Description of the permission.
permission Changes to this property will trigger replacement. str
Name of the permission.
resource_server_identifier Changes to this property will trigger replacement. str
Identifier of the resource server that the permission is associated with.
resource_server_name str
Name of the resource server that the permission is associated with.
role_id Changes to this property will trigger replacement. str
ID of the role to associate the permission to.
description String
Description of the permission.
permission Changes to this property will trigger replacement. String
Name of the permission.
resourceServerIdentifier Changes to this property will trigger replacement. String
Identifier of the resource server that the permission is associated with.
resourceServerName String
Name of the resource server that the permission is associated with.
roleId Changes to this property will trigger replacement. String
ID of the role to associate the permission to.

Import

This resource can be imported by specifying the

role ID, resource identifier, and permission name separated by “::” (note the double colon)

::::

Example:

$ pulumi import auth0:index/rolePermission:RolePermission permission "rol_XXXXXXXXXXXXX::https://example.com::read:foo"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Auth0 pulumi/pulumi-auth0
License
Apache-2.0
Notes
This Pulumi package is based on the auth0 Terraform Provider.