Nutanix v0.7.4 published on Friday, Mar 21, 2025 by Piers Karsenbarg
nutanix.getUsers
Explore with Pulumi AI
Provides a datasource to retrieve all the users.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pierskarsenbarg/nutanix";
import * as nutanix from "@pulumi/nutanix";
const user = new nutanix.User("user", {directoryServiceUser: {
    directoryServiceReference: {
        uuid: "<directory-service-uuid>",
    },
    userPrincipalName: "test-user@ntnxlab.local",
}});
const users = nutanix.getUser({});
import pulumi
import pulumi_nutanix as nutanix
user = nutanix.User("user", directory_service_user={
    "directory_service_reference": {
        "uuid": "<directory-service-uuid>",
    },
    "user_principal_name": "test-user@ntnxlab.local",
})
users = nutanix.get_user()
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 {
		_, err := nutanix.NewUser(ctx, "user", &nutanix.UserArgs{
			DirectoryServiceUser: &nutanix.UserDirectoryServiceUserArgs{
				DirectoryServiceReference: &nutanix.UserDirectoryServiceUserDirectoryServiceReferenceArgs{
					Uuid: pulumi.String("<directory-service-uuid>"),
				},
				UserPrincipalName: pulumi.String("test-user@ntnxlab.local"),
			},
		})
		if err != nil {
			return err
		}
		_, err = nutanix.LookupUser(ctx, &nutanix.LookupUserArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = PiersKarsenbarg.Nutanix;
using Nutanix = Pulumi.Nutanix;
return await Deployment.RunAsync(() => 
{
    var user = new Nutanix.User("user", new()
    {
        DirectoryServiceUser = new Nutanix.Inputs.UserDirectoryServiceUserArgs
        {
            DirectoryServiceReference = new Nutanix.Inputs.UserDirectoryServiceUserDirectoryServiceReferenceArgs
            {
                Uuid = "<directory-service-uuid>",
            },
            UserPrincipalName = "test-user@ntnxlab.local",
        },
    });
    var users = Nutanix.GetUser.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.User;
import com.pulumi.nutanix.UserArgs;
import com.pulumi.nutanix.inputs.UserDirectoryServiceUserArgs;
import com.pulumi.nutanix.inputs.UserDirectoryServiceUserDirectoryServiceReferenceArgs;
import com.pulumi.nutanix.NutanixFunctions;
import com.pulumi.nutanix.inputs.GetUserArgs;
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 user = new User("user", UserArgs.builder()
            .directoryServiceUser(UserDirectoryServiceUserArgs.builder()
                .directoryServiceReference(UserDirectoryServiceUserDirectoryServiceReferenceArgs.builder()
                    .uuid("<directory-service-uuid>")
                    .build())
                .userPrincipalName("test-user@ntnxlab.local")
                .build())
            .build());
        final var users = NutanixFunctions.getUser();
    }
}
resources:
  user:
    type: nutanix:User
    properties:
      directoryServiceUser:
        directoryServiceReference:
          uuid: <directory-service-uuid>
        userPrincipalName: test-user@ntnxlab.local
variables:
  users:
    fn::invoke:
      function: nutanix:getUser
      arguments: {}
Using getUsers
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 getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOptions): Output<GetUsersResult>def get_users(metadatas: Optional[Sequence[GetUsersMetadata]] = None,
              opts: Optional[InvokeOptions] = None) -> GetUsersResult
def get_users_output(metadatas: Optional[pulumi.Input[Sequence[pulumi.Input[GetUsersMetadataArgs]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetUsersResult]func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
func GetUsersOutput(ctx *Context, args *GetUsersOutputArgs, opts ...InvokeOption) GetUsersResultOutput> Note: This function is named GetUsers in the Go SDK.
public static class GetUsers 
{
    public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
    public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
public static Output<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
fn::invoke:
  function: nutanix:index/getUsers:getUsers
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Metadatas
List<PiersKarsenbarg. Nutanix. Inputs. Get Users Metadata> 
- The user kind metadata.
 
- Metadatas
[]GetUsers Metadata 
- The user kind metadata.
 
- metadatas
List<GetUsers Metadata> 
- The user kind metadata.
 
- metadatas
GetUsers Metadata[] 
- The user kind metadata.
 
- metadatas
Sequence[GetUsers Metadata] 
- The user kind metadata.
 
- metadatas List<Property Map>
- The user kind metadata.
 
getUsers Result
The following output properties are available:
- ApiVersion string
- The version of the API.
- Entities
List<PiersKarsenbarg. Nutanix. Outputs. Get Users Entity> 
- List of Users
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
List<PiersKarsenbarg. Nutanix. Outputs. Get Users Metadata> 
- The user kind metadata.
 
- ApiVersion string
- The version of the API.
- Entities
[]GetUsers Entity 
- List of Users
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
[]GetUsers Metadata 
- The user kind metadata.
 
- apiVersion String
- The version of the API.
- entities
List<GetUsers Entity> 
- List of Users
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas
List<GetUsers Metadata> 
- The user kind metadata.
 
- apiVersion string
- The version of the API.
- entities
GetUsers Entity[] 
- List of Users
- id string
- The provider-assigned unique ID for this managed resource.
- metadatas
GetUsers Metadata[] 
- The user kind metadata.
 
- api_version str
- The version of the API.
- entities
Sequence[GetUsers Entity] 
- List of Users
- id str
- The provider-assigned unique ID for this managed resource.
- metadatas
Sequence[GetUsers Metadata] 
- The user kind metadata.
 
- apiVersion String
- The version of the API.
- entities List<Property Map>
- List of Users
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas List<Property Map>
- The user kind metadata.
 
Supporting Types
GetUsersEntity  
- AccessControl List<PiersPolicy Reference Lists Karsenbarg. Nutanix. Inputs. Get Users Entity Access Control Policy Reference List> 
- List of ACP references. See #reference for more details.
 
- ApiVersion string
- The version of the API.
- Categories
List<PiersKarsenbarg. Nutanix. Inputs. Get Users Entity Category> 
- (Optional) Categories for the user.
 
- DirectoryService List<PiersUsers Karsenbarg. Nutanix. Inputs. Get Users Entity Directory Service User> 
- (Optional) The directory service user configuration. See below for more information.
 
- DisplayName string
- The display name of the user (common name) provided by the directory service.
 
- IdentityProvider List<PiersUsers Karsenbarg. Nutanix. Inputs. Get Users Entity Identity Provider User> 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- Metadata Dictionary<string, string>
- The user kind metadata.
 
- Name string
- the name(Optional).
 
- OwnerReference Dictionary<string, string>
- (Optional) The reference to a user.
 
- ProjectReference List<PiersLists Karsenbarg. Nutanix. Inputs. Get Users Entity Project Reference List> 
- A list of projects the user is part of. See #reference for more details.
 
- State string
- The state of the entity.
 
- UserType string
- The name of the user.
 
- ProjectReference Dictionary<string, string>
- (Optional) The reference to a project.
 
- AccessControl []GetPolicy Reference Lists Users Entity Access Control Policy Reference List 
- List of ACP references. See #reference for more details.
 
- ApiVersion string
- The version of the API.
- Categories
[]GetUsers Entity Category 
- (Optional) Categories for the user.
 
- DirectoryService []GetUsers Users Entity Directory Service User 
- (Optional) The directory service user configuration. See below for more information.
 
- DisplayName string
- The display name of the user (common name) provided by the directory service.
 
- IdentityProvider []GetUsers Users Entity Identity Provider User 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- Metadata map[string]string
- The user kind metadata.
 
- Name string
- the name(Optional).
 
- OwnerReference map[string]string
- (Optional) The reference to a user.
 
- ProjectReference []GetLists Users Entity Project Reference List 
- A list of projects the user is part of. See #reference for more details.
 
- State string
- The state of the entity.
 
- UserType string
- The name of the user.
 
- ProjectReference map[string]string
- (Optional) The reference to a project.
 
- accessControl List<GetPolicy Reference Lists Users Entity Access Control Policy Reference List> 
- List of ACP references. See #reference for more details.
 
- apiVersion String
- The version of the API.
- categories
List<GetUsers Entity Category> 
- (Optional) Categories for the user.
 
- directoryService List<GetUsers Users Entity Directory Service User> 
- (Optional) The directory service user configuration. See below for more information.
 
- displayName String
- The display name of the user (common name) provided by the directory service.
 
- identityProvider List<GetUsers Users Entity Identity Provider User> 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- metadata Map<String,String>
- The user kind metadata.
 
- name String
- the name(Optional).
 
- ownerReference Map<String,String>
- (Optional) The reference to a user.
 
- projectReference List<GetLists Users Entity Project Reference List> 
- A list of projects the user is part of. See #reference for more details.
 
- state String
- The state of the entity.
 
- userType String
- The name of the user.
 
- projectReference Map<String,String>
- (Optional) The reference to a project.
 
- accessControl GetPolicy Reference Lists Users Entity Access Control Policy Reference List[] 
- List of ACP references. See #reference for more details.
 
- apiVersion string
- The version of the API.
- categories
GetUsers Entity Category[] 
- (Optional) Categories for the user.
 
- directoryService GetUsers Users Entity Directory Service User[] 
- (Optional) The directory service user configuration. See below for more information.
 
- displayName string
- The display name of the user (common name) provided by the directory service.
 
- identityProvider GetUsers Users Entity Identity Provider User[] 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- metadata {[key: string]: string}
- The user kind metadata.
 
- name string
- the name(Optional).
 
- ownerReference {[key: string]: string}
- (Optional) The reference to a user.
 
- projectReference GetLists Users Entity Project Reference List[] 
- A list of projects the user is part of. See #reference for more details.
 
- state string
- The state of the entity.
 
- userType string
- The name of the user.
 
- projectReference {[key: string]: string}
- (Optional) The reference to a project.
 
- access_control_ Sequence[Getpolicy_ reference_ lists Users Entity Access Control Policy Reference List] 
- List of ACP references. See #reference for more details.
 
- api_version str
- The version of the API.
- categories
Sequence[GetUsers Entity Category] 
- (Optional) Categories for the user.
 
- directory_service_ Sequence[Getusers Users Entity Directory Service User] 
- (Optional) The directory service user configuration. See below for more information.
 
- display_name str
- The display name of the user (common name) provided by the directory service.
 
- identity_provider_ Sequence[Getusers Users Entity Identity Provider User] 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- metadata Mapping[str, str]
- The user kind metadata.
 
- name str
- the name(Optional).
 
- owner_reference Mapping[str, str]
- (Optional) The reference to a user.
 
- project_reference_ Sequence[Getlists Users Entity Project Reference List] 
- A list of projects the user is part of. See #reference for more details.
 
- state str
- The state of the entity.
 
- user_type str
- The name of the user.
 
- project_reference Mapping[str, str]
- (Optional) The reference to a project.
 
- accessControl List<Property Map>Policy Reference Lists 
- List of ACP references. See #reference for more details.
 
- apiVersion String
- The version of the API.
- categories List<Property Map>
- (Optional) Categories for the user.
 
- directoryService List<Property Map>Users 
- (Optional) The directory service user configuration. See below for more information.
 
- displayName String
- The display name of the user (common name) provided by the directory service.
 
- identityProvider List<Property Map>Users 
- (Optional) (Optional) The identity provider user configuration. See below for more information.
 
- metadata Map<String>
- The user kind metadata.
 
- name String
- the name(Optional).
 
- ownerReference Map<String>
- (Optional) The reference to a user.
 
- projectReference List<Property Map>Lists 
- A list of projects the user is part of. See #reference for more details.
 
- state String
- The state of the entity.
 
- userType String
- The name of the user.
 
- projectReference Map<String>
- (Optional) The reference to a project.
 
GetUsersEntityAccessControlPolicyReferenceList       
GetUsersEntityCategory   
GetUsersEntityDirectoryServiceUser     
- DefaultUser stringPrincipal Name 
- DirectoryService List<PiersReferences Karsenbarg. Nutanix. Inputs. Get Users Entity Directory Service User Directory Service Reference> 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- UserPrincipal stringName 
- (Optional) The UserPrincipalName of the user from the directory service.
 
- DefaultUser stringPrincipal Name 
- DirectoryService []GetReferences Users Entity Directory Service User Directory Service Reference 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- UserPrincipal stringName 
- (Optional) The UserPrincipalName of the user from the directory service.
 
- defaultUser StringPrincipal Name 
- directoryService List<GetReferences Users Entity Directory Service User Directory Service Reference> 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- userPrincipal StringName 
- (Optional) The UserPrincipalName of the user from the directory service.
 
- defaultUser stringPrincipal Name 
- directoryService GetReferences Users Entity Directory Service User Directory Service Reference[] 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- userPrincipal stringName 
- (Optional) The UserPrincipalName of the user from the directory service.
 
- default_user_ strprincipal_ name 
- directory_service_ Sequence[Getreferences Users Entity Directory Service User Directory Service Reference] 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- user_principal_ strname 
- (Optional) The UserPrincipalName of the user from the directory service.
 
- defaultUser StringPrincipal Name 
- directoryService List<Property Map>References 
- (Optional) The reference to a directory service. See #reference for to look the supported attributes.
 
- userPrincipal StringName 
- (Optional) The UserPrincipalName of the user from the directory service.
 
GetUsersEntityDirectoryServiceUserDirectoryServiceReference        
GetUsersEntityIdentityProviderUser     
- IdentityProvider List<PiersReferences Karsenbarg. Nutanix. Inputs. Get Users Entity Identity Provider User Identity Provider Reference> 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- Username string
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
- IdentityProvider []GetReferences Users Entity Identity Provider User Identity Provider Reference 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- Username string
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
- identityProvider List<GetReferences Users Entity Identity Provider User Identity Provider Reference> 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- username String
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
- identityProvider GetReferences Users Entity Identity Provider User Identity Provider Reference[] 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- username string
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
- identity_provider_ Sequence[Getreferences Users Entity Identity Provider User Identity Provider Reference] 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- username str
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
- identityProvider List<Property Map>References 
- (Optional) The reference to a identity provider. See #reference for to look the supported attributes.
 
- username String
- (Optional) The username from identity provider. Name ID for SAML Identity Provider.
 
GetUsersEntityIdentityProviderUserIdentityProviderReference        
GetUsersEntityProjectReferenceList     
GetUsersMetadata  
- filter str
- kind str
- The kind name. (Default depends on the resource you are referencing)
 
- length int
- offset int
- sort_attribute str
- sort_order str
Package Details
- Repository
- nutanix pierskarsenbarg/pulumi-nutanix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the nutanixTerraform Provider.
