published on Sunday, Oct 11, 2026 by Descope
published on Sunday, Oct 11, 2026 by Descope
Manages a single role in a Descope project. Roles reference permissions by name, and the referenced permissions must exist when the role is applied.
Create Role Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);@overload
def Role(resource_name: str,
args: RoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Role(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
default: Optional[bool] = None,
description: Optional[str] = None,
name: Optional[str] = None,
permissions: Optional[Sequence[str]] = None,
private: Optional[bool] = None)func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)type: descope:Role
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "descope_role" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleArgs
- 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 roleResource = new Descope.Role("roleResource", new()
{
ProjectId = "string",
Default = false,
Description = "string",
Name = "string",
Permissions = new[]
{
"string",
},
Private = false,
});
example, err := descope.NewRole(ctx, "roleResource", &descope.RoleArgs{
ProjectId: pulumi.String("string"),
Default: pulumi.Bool(false),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Permissions: pulumi.StringArray{
pulumi.String("string"),
},
Private: pulumi.Bool(false),
})
resource "descope_role" "roleResource" {
lifecycle {
create_before_destroy = true
}
project_id = "string"
default = false
description = "string"
name = "string"
permissions = ["string"]
private = false
}
var roleResource = new Role("roleResource", RoleArgs.builder()
.projectId("string")
.default_(false)
.description("string")
.name("string")
.permissions("string")
.private_(false)
.build());
role_resource = descope.Role("roleResource",
project_id="string",
default=False,
description="string",
name="string",
permissions=["string"],
private=False)
const roleResource = new descope.Role("roleResource", {
projectId: "string",
"default": false,
description: "string",
name: "string",
permissions: ["string"],
"private": false,
});
type: descope:Role
properties:
default: false
description: string
name: string
permissions:
- string
private: false
projectId: string
Role 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 Role resource accepts the following input properties:
- Project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- Default bool
- Whether this role is a default role in the project.
- Description string
- An optional description for the role.
- Name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- Permissions List<string>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - Private bool
- Whether this role is private.
- Project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- Default bool
- Whether this role is a default role in the project.
- Description string
- An optional description for the role.
- Name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- Permissions []string
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - Private bool
- Whether this role is private.
- project_
id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default bool
- Whether this role is a default role in the project.
- description string
- An optional description for the role.
- name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions list(string)
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private bool
- Whether this role is private.
- project
Id String - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default_ Boolean
- Whether this role is a default role in the project.
- description String
- An optional description for the role.
- name String
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions List<String>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private_ Boolean
- Whether this role is private.
- project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default boolean
- Whether this role is a default role in the project.
- description string
- An optional description for the role.
- name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions string[]
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private boolean
- Whether this role is private.
- project_
id str - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default bool
- Whether this role is a default role in the project.
- description str
- An optional description for the role.
- name str
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions Sequence[str]
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private bool
- Whether this role is private.
- project
Id String - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default Boolean
- Whether this role is a default role in the project.
- description String
- An optional description for the role.
- name String
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions List<String>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private Boolean
- Whether this role is private.
Outputs
All input properties are implicitly available as output properties. Additionally, the Role resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Role Resource
Get an existing Role 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?: RoleState, opts?: CustomResourceOptions): Role@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default: Optional[bool] = None,
description: Optional[str] = None,
name: Optional[str] = None,
permissions: Optional[Sequence[str]] = None,
private: Optional[bool] = None,
project_id: Optional[str] = None) -> Rolefunc GetRole(ctx *Context, name string, id IDInput, state *RoleState, opts ...ResourceOption) (*Role, error)public static Role Get(string name, Input<string> id, RoleState? state, CustomResourceOptions? opts = null)public static Role get(String name, Output<String> id, RoleState state, CustomResourceOptions options)resources: existingRole: type: descope:Role get: id: ${id}import {
to = descope_role.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state RoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state RoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state RoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state RoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Default bool
- Whether this role is a default role in the project.
- Description string
- An optional description for the role.
- Name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- Permissions List<string>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - Private bool
- Whether this role is private.
- Project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- Default bool
- Whether this role is a default role in the project.
- Description string
- An optional description for the role.
- Name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- Permissions []string
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - Private bool
- Whether this role is private.
- Project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default bool
- Whether this role is a default role in the project.
- description string
- An optional description for the role.
- name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions list(string)
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private bool
- Whether this role is private.
- project_
id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default_ Boolean
- Whether this role is a default role in the project.
- description String
- An optional description for the role.
- name String
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions List<String>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private_ Boolean
- Whether this role is private.
- project
Id String - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default boolean
- Whether this role is a default role in the project.
- description string
- An optional description for the role.
- name string
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions string[]
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private boolean
- Whether this role is private.
- project
Id string - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default bool
- Whether this role is a default role in the project.
- description str
- An optional description for the role.
- name str
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions Sequence[str]
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private bool
- Whether this role is private.
- project_
id str - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
- default Boolean
- Whether this role is a default role in the project.
- description String
- An optional description for the role.
- name String
- The name of the role. Role names must be unique in the project, and a role can be renamed freely without affecting resources that reference it.
- permissions List<String>
- The names of the permissions this role grants. Permissions are referenced by name, and their existence is validated when the role is created or updated. Reference the
nameattribute ofdescope.Permissionresources (e.g.,descope_permission.example.name) so that Terraform orders the operations correctly. Note that if a permission is deleted, it is silently removed from any roles that still reference it. - private Boolean
- Whether this role is private.
- project
Id String - The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
Package Details
- Repository
- descope descope/pulumi-descope
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
descopeTerraform Provider.
published on Sunday, Oct 11, 2026 by Descope