1. Packages
  2. Powerscale Provider
  3. API Docs
  4. Role
powerscale 1.7.1 published on Wednesday, Apr 30, 2025 by dell

powerscale.Role

Explore with Pulumi AI

powerscale logo
powerscale 1.7.1 published on Wednesday, Apr 30, 2025 by dell

    This resource is used to manage the role entity of PowerScale Array. We can Create, Update and Delete the role using this resource. We can also import an existing role from PowerScale array.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as powerscale from "@pulumi/powerscale";
    
    // PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
    const roleTest = new powerscale.Role("roleTest", {
        description: "role_test_description",
        members: [
            {
                id: "UID:10",
            },
            {
                id: "UID:0",
            },
            {
                id: "GID:31",
            },
        ],
        privileges: [
            {
                id: "ISI_PRIV_SYS_SUPPORT",
                permission: "r",
            },
            {
                id: "ISI_PRIV_SYS_SHUTDOWN",
                permission: "r",
            },
        ],
        zone: "System",
    });
    
    import pulumi
    import pulumi_powerscale as powerscale
    
    # PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
    role_test = powerscale.Role("roleTest",
        description="role_test_description",
        members=[
            {
                "id": "UID:10",
            },
            {
                "id": "UID:0",
            },
            {
                "id": "GID:31",
            },
        ],
        privileges=[
            {
                "id": "ISI_PRIV_SYS_SUPPORT",
                "permission": "r",
            },
            {
                "id": "ISI_PRIV_SYS_SHUTDOWN",
                "permission": "r",
            },
        ],
        zone="System")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/powerscale/powerscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
    		_, err := powerscale.NewRole(ctx, "roleTest", &powerscale.RoleArgs{
    			Description: pulumi.String("role_test_description"),
    			Members: powerscale.RoleMemberArray{
    				&powerscale.RoleMemberArgs{
    					Id: pulumi.String("UID:10"),
    				},
    				&powerscale.RoleMemberArgs{
    					Id: pulumi.String("UID:0"),
    				},
    				&powerscale.RoleMemberArgs{
    					Id: pulumi.String("GID:31"),
    				},
    			},
    			Privileges: powerscale.RolePrivilegeArray{
    				&powerscale.RolePrivilegeArgs{
    					Id:         pulumi.String("ISI_PRIV_SYS_SUPPORT"),
    					Permission: pulumi.String("r"),
    				},
    				&powerscale.RolePrivilegeArgs{
    					Id:         pulumi.String("ISI_PRIV_SYS_SHUTDOWN"),
    					Permission: pulumi.String("r"),
    				},
    			},
    			Zone: pulumi.String("System"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Powerscale = Pulumi.Powerscale;
    
    return await Deployment.RunAsync(() => 
    {
        // PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
        var roleTest = new Powerscale.Role("roleTest", new()
        {
            Description = "role_test_description",
            Members = new[]
            {
                new Powerscale.Inputs.RoleMemberArgs
                {
                    Id = "UID:10",
                },
                new Powerscale.Inputs.RoleMemberArgs
                {
                    Id = "UID:0",
                },
                new Powerscale.Inputs.RoleMemberArgs
                {
                    Id = "GID:31",
                },
            },
            Privileges = new[]
            {
                new Powerscale.Inputs.RolePrivilegeArgs
                {
                    Id = "ISI_PRIV_SYS_SUPPORT",
                    Permission = "r",
                },
                new Powerscale.Inputs.RolePrivilegeArgs
                {
                    Id = "ISI_PRIV_SYS_SHUTDOWN",
                    Permission = "r",
                },
            },
            Zone = "System",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.powerscale.Role;
    import com.pulumi.powerscale.RoleArgs;
    import com.pulumi.powerscale.inputs.RoleMemberArgs;
    import com.pulumi.powerscale.inputs.RolePrivilegeArgs;
    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) {
            // PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
            var roleTest = new Role("roleTest", RoleArgs.builder()
                .description("role_test_description")
                .members(            
                    RoleMemberArgs.builder()
                        .id("UID:10")
                        .build(),
                    RoleMemberArgs.builder()
                        .id("UID:0")
                        .build(),
                    RoleMemberArgs.builder()
                        .id("GID:31")
                        .build())
                .privileges(            
                    RolePrivilegeArgs.builder()
                        .id("ISI_PRIV_SYS_SUPPORT")
                        .permission("r")
                        .build(),
                    RolePrivilegeArgs.builder()
                        .id("ISI_PRIV_SYS_SHUTDOWN")
                        .permission("r")
                        .build())
                .zone("System")
                .build());
    
        }
    }
    
    resources:
      # PowerScale role allows you to permit and limit access to administrative areas of your cluster on a per-user basis through roles.
      roleTest:
        type: powerscale:Role
        properties:
          # Optional fields both for creating and updating
          description: role_test_description
          # To add members, the uid/gid is required. Please use user/user_group datasource to look up the uid/gid needed.
          members:
            - id: UID:10
            - id: UID:0
            - id: GID:31
          # To add privileges, the id is required. Please use role privilege datasource to look up the role privilege id needed.
          privileges:
            - id: ISI_PRIV_SYS_SUPPORT
              permission: r
            - id: ISI_PRIV_SYS_SHUTDOWN
              permission: r
          # Optional fields only for creating
          zone: System
    

    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: Optional[RoleArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Role(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             description: Optional[str] = None,
             members: Optional[Sequence[RoleMemberArgs]] = None,
             name: Optional[str] = None,
             privileges: Optional[Sequence[RolePrivilegeArgs]] = None,
             zone: Optional[str] = None)
    func NewRole(ctx *Context, name string, args *RoleArgs, opts ...ResourceOption) (*Role, error)
    public Role(string name, RoleArgs? args = null, CustomResourceOptions? opts = null)
    public Role(String name, RoleArgs args)
    public Role(String name, RoleArgs args, CustomResourceOptions options)
    
    type: powerscale:Role
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    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 Powerscale.Role("roleResource", new()
    {
        Description = "string",
        Members = new[]
        {
            new Powerscale.Inputs.RoleMemberArgs
            {
                Id = "string",
                Name = "string",
                Type = "string",
            },
        },
        Name = "string",
        Privileges = new[]
        {
            new Powerscale.Inputs.RolePrivilegeArgs
            {
                Id = "string",
                Name = "string",
                Permission = "string",
            },
        },
        Zone = "string",
    });
    
    example, err := powerscale.NewRole(ctx, "roleResource", &powerscale.RoleArgs{
    	Description: pulumi.String("string"),
    	Members: powerscale.RoleMemberArray{
    		&powerscale.RoleMemberArgs{
    			Id:   pulumi.String("string"),
    			Name: pulumi.String("string"),
    			Type: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	Privileges: powerscale.RolePrivilegeArray{
    		&powerscale.RolePrivilegeArgs{
    			Id:         pulumi.String("string"),
    			Name:       pulumi.String("string"),
    			Permission: pulumi.String("string"),
    		},
    	},
    	Zone: pulumi.String("string"),
    })
    
    var roleResource = new Role("roleResource", RoleArgs.builder()
        .description("string")
        .members(RoleMemberArgs.builder()
            .id("string")
            .name("string")
            .type("string")
            .build())
        .name("string")
        .privileges(RolePrivilegeArgs.builder()
            .id("string")
            .name("string")
            .permission("string")
            .build())
        .zone("string")
        .build());
    
    role_resource = powerscale.Role("roleResource",
        description="string",
        members=[{
            "id": "string",
            "name": "string",
            "type": "string",
        }],
        name="string",
        privileges=[{
            "id": "string",
            "name": "string",
            "permission": "string",
        }],
        zone="string")
    
    const roleResource = new powerscale.Role("roleResource", {
        description: "string",
        members: [{
            id: "string",
            name: "string",
            type: "string",
        }],
        name: "string",
        privileges: [{
            id: "string",
            name: "string",
            permission: "string",
        }],
        zone: "string",
    });
    
    type: powerscale:Role
    properties:
        description: string
        members:
            - id: string
              name: string
              type: string
        name: string
        privileges:
            - id: string
              name: string
              permission: string
        zone: 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:

    Description string
    Specifies the description of the role.
    Members List<RoleMember>
    Specifies the users or groups that have this role.
    Name string
    Specifies the name of the role.
    Privileges List<RolePrivilege>
    Specifies the privileges granted by this role.
    Zone string
    Specifies which access zone to use.
    Description string
    Specifies the description of the role.
    Members []RoleMemberArgs
    Specifies the users or groups that have this role.
    Name string
    Specifies the name of the role.
    Privileges []RolePrivilegeArgs
    Specifies the privileges granted by this role.
    Zone string
    Specifies which access zone to use.
    description String
    Specifies the description of the role.
    members List<RoleMember>
    Specifies the users or groups that have this role.
    name String
    Specifies the name of the role.
    privileges List<RolePrivilege>
    Specifies the privileges granted by this role.
    zone String
    Specifies which access zone to use.
    description string
    Specifies the description of the role.
    members RoleMember[]
    Specifies the users or groups that have this role.
    name string
    Specifies the name of the role.
    privileges RolePrivilege[]
    Specifies the privileges granted by this role.
    zone string
    Specifies which access zone to use.
    description str
    Specifies the description of the role.
    members Sequence[RoleMemberArgs]
    Specifies the users or groups that have this role.
    name str
    Specifies the name of the role.
    privileges Sequence[RolePrivilegeArgs]
    Specifies the privileges granted by this role.
    zone str
    Specifies which access zone to use.
    description String
    Specifies the description of the role.
    members List<Property Map>
    Specifies the users or groups that have this role.
    name String
    Specifies the name of the role.
    privileges List<Property Map>
    Specifies the privileges granted by this role.
    zone String
    Specifies which access zone to use.

    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 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,
            description: Optional[str] = None,
            members: Optional[Sequence[RoleMemberArgs]] = None,
            name: Optional[str] = None,
            privileges: Optional[Sequence[RolePrivilegeArgs]] = None,
            zone: Optional[str] = None) -> Role
    func 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:  _:    type: powerscale:Role    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    Specifies the description of the role.
    Members List<RoleMember>
    Specifies the users or groups that have this role.
    Name string
    Specifies the name of the role.
    Privileges List<RolePrivilege>
    Specifies the privileges granted by this role.
    Zone string
    Specifies which access zone to use.
    Description string
    Specifies the description of the role.
    Members []RoleMemberArgs
    Specifies the users or groups that have this role.
    Name string
    Specifies the name of the role.
    Privileges []RolePrivilegeArgs
    Specifies the privileges granted by this role.
    Zone string
    Specifies which access zone to use.
    description String
    Specifies the description of the role.
    members List<RoleMember>
    Specifies the users or groups that have this role.
    name String
    Specifies the name of the role.
    privileges List<RolePrivilege>
    Specifies the privileges granted by this role.
    zone String
    Specifies which access zone to use.
    description string
    Specifies the description of the role.
    members RoleMember[]
    Specifies the users or groups that have this role.
    name string
    Specifies the name of the role.
    privileges RolePrivilege[]
    Specifies the privileges granted by this role.
    zone string
    Specifies which access zone to use.
    description str
    Specifies the description of the role.
    members Sequence[RoleMemberArgs]
    Specifies the users or groups that have this role.
    name str
    Specifies the name of the role.
    privileges Sequence[RolePrivilegeArgs]
    Specifies the privileges granted by this role.
    zone str
    Specifies which access zone to use.
    description String
    Specifies the description of the role.
    members List<Property Map>
    Specifies the users or groups that have this role.
    name String
    Specifies the name of the role.
    privileges List<Property Map>
    Specifies the privileges granted by this role.
    zone String
    Specifies which access zone to use.

    Supporting Types

    RoleMember, RoleMemberArgs

    Id string
    Specifies the serialized form of a persona, which can be 'UID:0'
    Name string
    Specifies the persona name, which must be combined with a type.
    Type string
    Specifies the type of persona, which must be combined with a name.
    Id string
    Specifies the serialized form of a persona, which can be 'UID:0'
    Name string
    Specifies the persona name, which must be combined with a type.
    Type string
    Specifies the type of persona, which must be combined with a name.
    id String
    Specifies the serialized form of a persona, which can be 'UID:0'
    name String
    Specifies the persona name, which must be combined with a type.
    type String
    Specifies the type of persona, which must be combined with a name.
    id string
    Specifies the serialized form of a persona, which can be 'UID:0'
    name string
    Specifies the persona name, which must be combined with a type.
    type string
    Specifies the type of persona, which must be combined with a name.
    id str
    Specifies the serialized form of a persona, which can be 'UID:0'
    name str
    Specifies the persona name, which must be combined with a type.
    type str
    Specifies the type of persona, which must be combined with a name.
    id String
    Specifies the serialized form of a persona, which can be 'UID:0'
    name String
    Specifies the persona name, which must be combined with a type.
    type String
    Specifies the type of persona, which must be combined with a name.

    RolePrivilege, RolePrivilegeArgs

    Id string
    Specifies the ID of the privilege.
    Name string
    Specifies the name of the privilege.
    Permission string
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission
    Id string
    Specifies the ID of the privilege.
    Name string
    Specifies the name of the privilege.
    Permission string
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission
    id String
    Specifies the ID of the privilege.
    name String
    Specifies the name of the privilege.
    permission String
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission
    id string
    Specifies the ID of the privilege.
    name string
    Specifies the name of the privilege.
    permission string
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission
    id str
    Specifies the ID of the privilege.
    name str
    Specifies the name of the privilege.
    permission str
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission
    id String
    Specifies the ID of the privilege.
    name String
    Specifies the name of the privilege.
    permission String
    permission of the privilege, 'r' = read , 'x' = read-execute, 'w' = read-execute-write, '-' = no permission

    Import

    Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.

    Licensed under the Mozilla Public License Version 2.0 (the “License”);

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/
    

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an “AS IS” BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

    The command is

    $ pulumi import powerscale:index/role:Role role_test [<zone_id>:]<role_id>
    

    Example1, <zone_id> is Optional, defaults to System:

    $ pulumi import powerscale:index/role:Role role_test role_id
    

    Example2:

    $ pulumi import powerscale:index/role:Role role_test zone_id:role_id
    

    after running this command, populate the name field and other required parameters in the config file to start managing this resource.

    Note: running “terraform show” after importing shows the current config/state of the resource. You can copy/paste that config to make it easier to manage the resource.

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

    Package Details

    Repository
    powerscale dell/terraform-provider-powerscale
    License
    Notes
    This Pulumi package is based on the powerscale Terraform Provider.
    powerscale logo
    powerscale 1.7.1 published on Wednesday, Apr 30, 2025 by dell