1. Registry
  2. Packages
  3. Descope Provider
  4. API Docs
  5. AppRole
Viewing docs for Descope v1.0.1
published on Sunday, Oct 11, 2026 by Descope
descope logo Descope
Viewing docs for Descope v1.0.1
published on Sunday, Oct 11, 2026 by Descope

    Manages a single role scoped to a federated application. Roles reference application permissions by id via permissionIds, and project-level roles by id via roleMappings.

    Create AppRole Resource

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

    Constructor syntax

    new AppRole(name: string, args: AppRoleArgs, opts?: CustomResourceOptions);
    @overload
    def AppRole(resource_name: str,
                args: AppRoleArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def AppRole(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                app_id: Optional[str] = None,
                project_id: Optional[str] = None,
                description: Optional[str] = None,
                name: Optional[str] = None,
                permission_ids: Optional[Sequence[str]] = None,
                role_mappings: Optional[Sequence[str]] = None)
    func NewAppRole(ctx *Context, name string, args AppRoleArgs, opts ...ResourceOption) (*AppRole, error)
    public AppRole(string name, AppRoleArgs args, CustomResourceOptions? opts = null)
    public AppRole(String name, AppRoleArgs args)
    public AppRole(String name, AppRoleArgs args, CustomResourceOptions options)
    
    type: descope:AppRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "descope_app_role" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AppRoleArgs
    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 AppRoleArgs
    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 AppRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AppRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AppRoleArgs
    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 appRoleResource = new Descope.AppRole("appRoleResource", new()
    {
        AppId = "string",
        ProjectId = "string",
        Description = "string",
        Name = "string",
        PermissionIds = new[]
        {
            "string",
        },
        RoleMappings = new[]
        {
            "string",
        },
    });
    
    example, err := descope.NewAppRole(ctx, "appRoleResource", &descope.AppRoleArgs{
    	AppId:       pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	PermissionIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RoleMappings: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "descope_app_role" "appRoleResource" {
      lifecycle {
        create_before_destroy = true
      }
      app_id         = "string"
      project_id     = "string"
      description    = "string"
      name           = "string"
      permission_ids = ["string"]
      role_mappings  = ["string"]
    }
    
    var appRoleResource = new AppRole("appRoleResource", AppRoleArgs.builder()
        .appId("string")
        .projectId("string")
        .description("string")
        .name("string")
        .permissionIds("string")
        .roleMappings("string")
        .build());
    
    app_role_resource = descope.AppRole("appRoleResource",
        app_id="string",
        project_id="string",
        description="string",
        name="string",
        permission_ids=["string"],
        role_mappings=["string"])
    
    const appRoleResource = new descope.AppRole("appRoleResource", {
        appId: "string",
        projectId: "string",
        description: "string",
        name: "string",
        permissionIds: ["string"],
        roleMappings: ["string"],
    });
    
    type: descope:AppRole
    properties:
        appId: string
        description: string
        name: string
        permissionIds:
            - string
        projectId: string
        roleMappings:
            - string
    

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

    AppId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    ProjectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    Description string
    An optional description for the role.
    Name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    PermissionIds List<string>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    RoleMappings List<string>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    AppId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    ProjectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    Description string
    An optional description for the role.
    Name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    PermissionIds []string
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    RoleMappings []string
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    app_id string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    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.
    description string
    An optional description for the role.
    name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permission_ids list(string)
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    role_mappings list(string)
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId String
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    projectId String
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    description String
    An optional description for the role.
    name String
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds List<String>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    roleMappings List<String>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    projectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    description string
    An optional description for the role.
    name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds string[]
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    roleMappings string[]
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    app_id str
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    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.
    description str
    An optional description for the role.
    name str
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permission_ids Sequence[str]
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    role_mappings Sequence[str]
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId String
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    projectId String
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    description String
    An optional description for the role.
    name String
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds List<String>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    roleMappings List<String>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AppRole 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 AppRole Resource

    Get an existing AppRole 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?: AppRoleState, opts?: CustomResourceOptions): AppRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            permission_ids: Optional[Sequence[str]] = None,
            project_id: Optional[str] = None,
            role_mappings: Optional[Sequence[str]] = None) -> AppRole
    func GetAppRole(ctx *Context, name string, id IDInput, state *AppRoleState, opts ...ResourceOption) (*AppRole, error)
    public static AppRole Get(string name, Input<string> id, AppRoleState? state, CustomResourceOptions? opts = null)
    public static AppRole get(String name, Output<String> id, AppRoleState state, CustomResourceOptions options)
    resources:  existingAppRole:    type: descope:AppRole    get:      id: ${id}
    import {
      to = descope_app_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 AppRoleState
    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 AppRoleState
    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 AppRoleState
    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 AppRoleState
    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.
    The following state arguments are supported:
    AppId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    Description string
    An optional description for the role.
    Name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    PermissionIds List<string>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    ProjectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    RoleMappings List<string>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    AppId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    Description string
    An optional description for the role.
    Name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    PermissionIds []string
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    ProjectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    RoleMappings []string
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    app_id string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    description string
    An optional description for the role.
    name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permission_ids list(string)
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    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.
    role_mappings list(string)
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId String
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    description String
    An optional description for the role.
    name String
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds List<String>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    projectId String
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    roleMappings List<String>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId string
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    description string
    An optional description for the role.
    name string
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds string[]
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    projectId string
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    roleMappings string[]
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    app_id str
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    description str
    An optional description for the role.
    name str
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permission_ids Sequence[str]
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    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.
    role_mappings Sequence[str]
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).
    appId String
    The ID of the federated application that this role is scoped to. Reference the id attribute of the application resource (e.g., descope_oidc_app.example.id). Changing this value will require the resource to be deleted and recreated.
    description String
    An optional description for the role.
    name String
    The name of the role. Role names must be unique per application, and a role is renamed in place, so user assignments and service account references to it are preserved.
    permissionIds List<String>
    The IDs of the application permissions this role grants. Reference the id attribute of descope.AppPermission resources on the same application (e.g., descope_app_permission.example.id) so that Terraform orders the operations correctly.
    projectId String
    The ID of the project that this role belongs to. Changing this value will require the resource to be deleted and recreated.
    roleMappings List<String>
    The IDs of project-level roles that map users to this application role at login. Reference the id attribute of descope.Role resources (e.g., descope_role.example.id).

    Package Details

    Repository
    descope descope/pulumi-descope
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the descope Terraform Provider.
    descope logo Descope
    Viewing docs for Descope v1.0.1
    published on Sunday, Oct 11, 2026 by Descope

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial