1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getUser
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getUser

Explore with Pulumi AI

The User data source can be used to search for and return existing users. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

Example Usage

By ID

import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";

const example = ionoscloud.getUser({
    id: "user_id",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_user(id="user_id")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ionoscloud.LookupUser(ctx, &ionoscloud.LookupUserArgs{
			Id: pulumi.StringRef("user_id"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;

return await Deployment.RunAsync(() => 
{
    var example = Ionoscloud.GetUser.Invoke(new()
    {
        Id = "user_id",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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) {
        final var example = IonoscloudFunctions.getUser(GetUserArgs.builder()
            .id("user_id")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getUser
      arguments:
        id: user_id
Copy

By Email

import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";

const example = ionoscloud.getUser({
    email: "example@email.com",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_user(email="example@email.com")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ionoscloud.LookupUser(ctx, &ionoscloud.LookupUserArgs{
			Email: pulumi.StringRef("example@email.com"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;

return await Deployment.RunAsync(() => 
{
    var example = Ionoscloud.GetUser.Invoke(new()
    {
        Email = "example@email.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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) {
        final var example = IonoscloudFunctions.getUser(GetUserArgs.builder()
            .email("example@email.com")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getUser
      arguments:
        email: example@email.com
Copy

By Email from Env Variables - Current User

data “ionoscloud.User” “example” { }

Using getUser

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 getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
function getUserOutput(args: GetUserOutputArgs, opts?: InvokeOptions): Output<GetUserResult>
Copy
def get_user(email: Optional[str] = None,
             id: Optional[str] = None,
             timeouts: Optional[GetUserTimeouts] = None,
             opts: Optional[InvokeOptions] = None) -> GetUserResult
def get_user_output(email: Optional[pulumi.Input[str]] = None,
             id: Optional[pulumi.Input[str]] = None,
             timeouts: Optional[pulumi.Input[GetUserTimeoutsArgs]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
Copy
func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)
func LookupUserOutput(ctx *Context, args *LookupUserOutputArgs, opts ...InvokeOption) LookupUserResultOutput
Copy

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

public static class GetUser 
{
    public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
    public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
public static Output<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ionoscloud:index/getUser:getUser
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Email string
Email of an existing user that you want to search for.
Id string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

Timeouts GetUserTimeouts
Email string
Email of an existing user that you want to search for.
Id string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

Timeouts GetUserTimeouts
email String
Email of an existing user that you want to search for.
id String

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

timeouts GetUserTimeouts
email string
Email of an existing user that you want to search for.
id string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

timeouts GetUserTimeouts
email str
Email of an existing user that you want to search for.
id str

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

timeouts GetUserTimeouts
email String
Email of an existing user that you want to search for.
id String

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

timeouts Property Map

getUser Result

The following output properties are available:

Active bool
Indicates if the user is active
Administrator bool
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
FirstName string
The first name for the user.
ForceSecAuth bool
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
Groups List<GetUserGroup>
Shows the id and name of the groups that the user is a member of
Id string
The id of the user.
LastName string
The last name for the user.
S3CanonicalUserId string
Canonical (S3) id of the user for a given identity
SecAuthActive bool
Indicates if secure authentication is active for the user or not
Email string
The e-mail address for the user.
Timeouts GetUserTimeouts
Active bool
Indicates if the user is active
Administrator bool
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
FirstName string
The first name for the user.
ForceSecAuth bool
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
Groups []GetUserGroup
Shows the id and name of the groups that the user is a member of
Id string
The id of the user.
LastName string
The last name for the user.
S3CanonicalUserId string
Canonical (S3) id of the user for a given identity
SecAuthActive bool
Indicates if secure authentication is active for the user or not
Email string
The e-mail address for the user.
Timeouts GetUserTimeouts
active Boolean
Indicates if the user is active
administrator Boolean
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
firstName String
The first name for the user.
forceSecAuth Boolean
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
groups List<GetUserGroup>
Shows the id and name of the groups that the user is a member of
id String
The id of the user.
lastName String
The last name for the user.
s3CanonicalUserId String
Canonical (S3) id of the user for a given identity
secAuthActive Boolean
Indicates if secure authentication is active for the user or not
email String
The e-mail address for the user.
timeouts GetUserTimeouts
active boolean
Indicates if the user is active
administrator boolean
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
firstName string
The first name for the user.
forceSecAuth boolean
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
groups GetUserGroup[]
Shows the id and name of the groups that the user is a member of
id string
The id of the user.
lastName string
The last name for the user.
s3CanonicalUserId string
Canonical (S3) id of the user for a given identity
secAuthActive boolean
Indicates if secure authentication is active for the user or not
email string
The e-mail address for the user.
timeouts GetUserTimeouts
active bool
Indicates if the user is active
administrator bool
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
first_name str
The first name for the user.
force_sec_auth bool
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
groups Sequence[GetUserGroup]
Shows the id and name of the groups that the user is a member of
id str
The id of the user.
last_name str
The last name for the user.
s3_canonical_user_id str
Canonical (S3) id of the user for a given identity
sec_auth_active bool
Indicates if secure authentication is active for the user or not
email str
The e-mail address for the user.
timeouts GetUserTimeouts
active Boolean
Indicates if the user is active
administrator Boolean
Indicates if the user has administrative rights. Administrators do not need to be managed in groups, as they automatically have access to all resources associated with the contract.
firstName String
The first name for the user.
forceSecAuth Boolean
Indicates if secure (two-factor) authentication should be forced for the user (true) or not (false).
groups List<Property Map>
Shows the id and name of the groups that the user is a member of
id String
The id of the user.
lastName String
The last name for the user.
s3CanonicalUserId String
Canonical (S3) id of the user for a given identity
secAuthActive Boolean
Indicates if secure authentication is active for the user or not
email String
The e-mail address for the user.
timeouts Property Map

Supporting Types

GetUserGroup

Id This property is required. string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

Name This property is required. string
Id This property is required. string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

Name This property is required. string
id This property is required. String

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

name This property is required. String
id This property is required. string

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

name This property is required. string
id This property is required. str

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

name This property is required. str
id This property is required. String

ID of the user you want to search for.

Either email or id can be provided. If no argument is set, the provider will search for the email that was provided for the configuration. If none is found, the provider will return an error.

name This property is required. String

GetUserTimeouts

Create string
Default string
Delete string
Update string
Create string
Default string
Delete string
Update string
create String
default_ String
delete String
update String
create string
default string
delete string
update string
create String
default String
delete String
update String

Package Details

Repository
ionoscloud ionos-cloud/terraform-provider-ionoscloud
License
Notes
This Pulumi package is based on the ionoscloud Terraform Provider.