1. Packages
  2. Nutanix
  3. API Docs
  4. getRole
Nutanix v0.11.0 published on Monday, Nov 24, 2025 by Piers Karsenbarg
nutanix logo
Nutanix v0.11.0 published on Monday, Nov 24, 2025 by Piers Karsenbarg

    Describes a Role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pierskarsenbarg/nutanix";
    
    const testRole = new nutanix.Role("test", {
        name: "NAME",
        description: "DESCRIPTION",
        permissionReferenceLists: [{
            kind: "permission",
            uuid: "ID OF PERMISSION",
        }],
    });
    const test = nutanix.getRoleOutput({
        roleId: testRole.id,
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    test_role = nutanix.Role("test",
        name="NAME",
        description="DESCRIPTION",
        permission_reference_lists=[{
            "kind": "permission",
            "uuid": "ID OF PERMISSION",
        }])
    test = nutanix.get_role_output(role_id=test_role.id)
    
    package main
    
    import (
    	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testRole, err := nutanix.NewRole(ctx, "test", &nutanix.RoleArgs{
    			Name:        pulumi.String("NAME"),
    			Description: pulumi.String("DESCRIPTION"),
    			PermissionReferenceLists: nutanix.RolePermissionReferenceListArray{
    				&nutanix.RolePermissionReferenceListArgs{
    					Kind: pulumi.String("permission"),
    					Uuid: pulumi.String("ID OF PERMISSION"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = nutanix.LookupRoleOutput(ctx, nutanix.GetRoleOutputArgs{
    			RoleId: testRole.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = PiersKarsenbarg.Nutanix;
    using Nutanix = Pulumi.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        var testRole = new Nutanix.Role("test", new()
        {
            Name = "NAME",
            Description = "DESCRIPTION",
            PermissionReferenceLists = new[]
            {
                new Nutanix.Inputs.RolePermissionReferenceListArgs
                {
                    Kind = "permission",
                    Uuid = "ID OF PERMISSION",
                },
            },
        });
    
        var test = Nutanix.GetRole.Invoke(new()
        {
            RoleId = testRole.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nutanix.Role;
    import com.pulumi.nutanix.RoleArgs;
    import com.pulumi.nutanix.inputs.RolePermissionReferenceListArgs;
    import com.pulumi.nutanix.NutanixFunctions;
    import com.pulumi.nutanix.inputs.GetRoleArgs;
    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) {
            var testRole = new Role("testRole", RoleArgs.builder()
                .name("NAME")
                .description("DESCRIPTION")
                .permissionReferenceLists(RolePermissionReferenceListArgs.builder()
                    .kind("permission")
                    .uuid("ID OF PERMISSION")
                    .build())
                .build());
    
            final var test = NutanixFunctions.getRole(GetRoleArgs.builder()
                .roleId(testRole.id())
                .build());
    
        }
    }
    
    resources:
      testRole:
        type: nutanix:Role
        name: test
        properties:
          name: NAME
          description: DESCRIPTION
          permissionReferenceLists:
            - kind: permission
              uuid: ID OF PERMISSION
    variables:
      test:
        fn::invoke:
          function: nutanix:getRole
          arguments:
            roleId: ${testRole.id}
    

    Using getRole

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
    function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
    def get_role(categories: Optional[Sequence[GetRoleCategory]] = None,
                 role_id: Optional[str] = None,
                 role_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(categories: Optional[pulumi.Input[Sequence[pulumi.Input[GetRoleCategoryArgs]]]] = None,
                 role_id: Optional[pulumi.Input[str]] = None,
                 role_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
    func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
    func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput

    > Note: This function is named LookupRole in the Go SDK.

    public static class GetRole 
    {
        public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nutanix:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Categories List<PiersKarsenbarg.Nutanix.Inputs.GetRoleCategory>
    • Categories for the Role.
    RoleId string
    • (Optional) The UUID of a Role.
    RoleName string
    • (Optional) The name of a Role.
    Categories []GetRoleCategory
    • Categories for the Role.
    RoleId string
    • (Optional) The UUID of a Role.
    RoleName string
    • (Optional) The name of a Role.
    categories List<GetRoleCategory>
    • Categories for the Role.
    roleId String
    • (Optional) The UUID of a Role.
    roleName String
    • (Optional) The name of a Role.
    categories GetRoleCategory[]
    • Categories for the Role.
    roleId string
    • (Optional) The UUID of a Role.
    roleName string
    • (Optional) The name of a Role.
    categories Sequence[GetRoleCategory]
    • Categories for the Role.
    role_id str
    • (Optional) The UUID of a Role.
    role_name str
    • (Optional) The name of a Role.
    categories List<Property Map>
    • Categories for the Role.
    roleId String
    • (Optional) The UUID of a Role.
    roleName String
    • (Optional) The name of a Role.

    getRole Result

    The following output properties are available:

    ApiVersion string
    The version of the API.
    Categories List<PiersKarsenbarg.Nutanix.Outputs.GetRoleCategory>
    • Categories for the Role.
    Description string
    • The description of the Role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, string>
    • The role kind metadata.
    Name string
    • the name(Optional).
    OwnerReference Dictionary<string, string>
    • The reference to a user.
    PermissionReferenceLists List<PiersKarsenbarg.Nutanix.Outputs.GetRolePermissionReferenceList>
    • (Required) List of permission references.
    ProjectReference Dictionary<string, string>
    • The reference to a project.
    State string
    • The state of the role.
    RoleId string
    RoleName string
    ApiVersion string
    The version of the API.
    Categories []GetRoleCategory
    • Categories for the Role.
    Description string
    • The description of the Role.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]string
    • The role kind metadata.
    Name string
    • the name(Optional).
    OwnerReference map[string]string
    • The reference to a user.
    PermissionReferenceLists []GetRolePermissionReferenceList
    • (Required) List of permission references.
    ProjectReference map[string]string
    • The reference to a project.
    State string
    • The state of the role.
    RoleId string
    RoleName string
    apiVersion String
    The version of the API.
    categories List<GetRoleCategory>
    • Categories for the Role.
    description String
    • The description of the Role.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,String>
    • The role kind metadata.
    name String
    • the name(Optional).
    ownerReference Map<String,String>
    • The reference to a user.
    permissionReferenceLists List<GetRolePermissionReferenceList>
    • (Required) List of permission references.
    projectReference Map<String,String>
    • The reference to a project.
    state String
    • The state of the role.
    roleId String
    roleName String
    apiVersion string
    The version of the API.
    categories GetRoleCategory[]
    • Categories for the Role.
    description string
    • The description of the Role.
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: string}
    • The role kind metadata.
    name string
    • the name(Optional).
    ownerReference {[key: string]: string}
    • The reference to a user.
    permissionReferenceLists GetRolePermissionReferenceList[]
    • (Required) List of permission references.
    projectReference {[key: string]: string}
    • The reference to a project.
    state string
    • The state of the role.
    roleId string
    roleName string
    api_version str
    The version of the API.
    categories Sequence[GetRoleCategory]
    • Categories for the Role.
    description str
    • The description of the Role.
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, str]
    • The role kind metadata.
    name str
    • the name(Optional).
    owner_reference Mapping[str, str]
    • The reference to a user.
    permission_reference_lists Sequence[GetRolePermissionReferenceList]
    • (Required) List of permission references.
    project_reference Mapping[str, str]
    • The reference to a project.
    state str
    • The state of the role.
    role_id str
    role_name str
    apiVersion String
    The version of the API.
    categories List<Property Map>
    • Categories for the Role.
    description String
    • The description of the Role.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String>
    • The role kind metadata.
    name String
    • the name(Optional).
    ownerReference Map<String>
    • The reference to a user.
    permissionReferenceLists List<Property Map>
    • (Required) List of permission references.
    projectReference Map<String>
    • The reference to a project.
    state String
    • The state of the role.
    roleId String
    roleName String

    Supporting Types

    GetRoleCategory

    Name string
    • the name(Optional).
    Value string
    • value of the key.
    Name string
    • the name(Optional).
    Value string
    • value of the key.
    name String
    • the name(Optional).
    value String
    • value of the key.
    name string
    • the name(Optional).
    value string
    • value of the key.
    name str
    • the name(Optional).
    value str
    • value of the key.
    name String
    • the name(Optional).
    value String
    • value of the key.

    GetRolePermissionReferenceList

    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • the name(Optional).
    Uuid string
    • the UUID(Required).
    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • the name(Optional).
    Uuid string
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • the name(Optional).
    uuid String
    • the UUID(Required).
    kind string
    • The kind name (Default value: project)(Required).
    name string
    • the name(Optional).
    uuid string
    • the UUID(Required).
    kind str
    • The kind name (Default value: project)(Required).
    name str
    • the name(Optional).
    uuid str
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • the name(Optional).
    uuid String
    • the UUID(Required).

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.11.0 published on Monday, Nov 24, 2025 by Piers Karsenbarg
      Meet Neo: Your AI Platform Teammate