import * as pulumi from "@pulumi/pulumi"; /** * 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. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as auth0 from "@pulumi/auth0"; * import * as std from "@pulumi/std"; * * // Example: * const resourceServer = new auth0.ResourceServer("resource_server", { * name: "test", * identifier: "test.example.com", * }); * const resourceServerScopes = new auth0.ResourceServerScopes("resource_server_scopes", { * resourceServerIdentifier: resourceServer.identifier, * scopes: [ * { * name: "store:create", * }, * { * name: "store:read", * }, * { * name: "store:update", * }, * { * name: "store:delete", * }, * ], * }); * const myRole = new auth0.Role("my_role", {name: "My Role"}); * const scopesList = resourceServerScopes.scopes.apply(scopes => scopes.map(scope => (scope.name))); * const myRolePerm: auth0.RolePermission[] = []; * for (const range = {value: 0}; range.value < std.index.toset({ * input: scopesList, * }).result; range.value++) { * myRolePerm.push(new auth0.RolePermission(`my_role_perm-${range.value}`, { * roleId: myRole.id, * resourceServerIdentifier: resourceServer.identifier, * permission: range.value, * })); * } * ``` * * ## Import * * This resource can be imported by specifying the * * role ID, resource identifier, and permission name separated by "::" (note the double colon) * * :::: * * Example: * * ```sh * $ pulumi import auth0:index/rolePermission:RolePermission permission "rol_XXXXXXXXXXXXX::https://example.com::read:foo" * ``` */ export declare class RolePermission extends pulumi.CustomResource { /** * Get an existing RolePermission resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: RolePermissionState, opts?: pulumi.CustomResourceOptions): RolePermission; /** * Returns true if the given object is an instance of RolePermission. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RolePermission; /** * Description of the permission. */ readonly description: pulumi.Output; /** * Name of the permission. */ readonly permission: pulumi.Output; /** * Identifier of the resource server that the permission is associated with. */ readonly resourceServerIdentifier: pulumi.Output; /** * Name of the resource server that the permission is associated with. */ readonly resourceServerName: pulumi.Output; /** * ID of the role to associate the permission to. */ readonly roleId: pulumi.Output; /** * Create a RolePermission resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RolePermissionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RolePermission resources. */ export interface RolePermissionState { /** * Description of the permission. */ description?: pulumi.Input; /** * Name of the permission. */ permission?: pulumi.Input; /** * Identifier of the resource server that the permission is associated with. */ resourceServerIdentifier?: pulumi.Input; /** * Name of the resource server that the permission is associated with. */ resourceServerName?: pulumi.Input; /** * ID of the role to associate the permission to. */ roleId?: pulumi.Input; } /** * The set of arguments for constructing a RolePermission resource. */ export interface RolePermissionArgs { /** * Name of the permission. */ permission: pulumi.Input; /** * Identifier of the resource server that the permission is associated with. */ resourceServerIdentifier: pulumi.Input; /** * ID of the role to associate the permission to. */ roleId: pulumi.Input; }