1. Packages
  2. Scaleway
  3. API Docs
  4. iam
  5. getUser
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.iam.getUser

Explore with Pulumi AI

Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

Use this data source to get information on an existing IAM user based on its ID or email address. For more information refer to the IAM API documentation.

Example Usage

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

// Get info by user id
const findById = scaleway.iam.getUser({
    userId: "11111111-1111-1111-1111-111111111111",
});
// Get info by email address
const findByEmail = scaleway.iam.getUser({
    email: "foo@bar.com",
});
Copy
import pulumi
import pulumi_scaleway as scaleway

# Get info by user id
find_by_id = scaleway.iam.get_user(user_id="11111111-1111-1111-1111-111111111111")
# Get info by email address
find_by_email = scaleway.iam.get_user(email="foo@bar.com")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/iam"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Get info by user id
		_, err := iam.LookupUser(ctx, &iam.LookupUserArgs{
			UserId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
		}, nil)
		if err != nil {
			return err
		}
		// Get info by email address
		_, err = iam.LookupUser(ctx, &iam.LookupUserArgs{
			Email: pulumi.StringRef("foo@bar.com"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    // Get info by user id
    var findById = Scaleway.Iam.GetUser.Invoke(new()
    {
        UserId = "11111111-1111-1111-1111-111111111111",
    });

    // Get info by email address
    var findByEmail = Scaleway.Iam.GetUser.Invoke(new()
    {
        Email = "foo@bar.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.iam.IamFunctions;
import com.pulumi.scaleway.iam.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) {
        // Get info by user id
        final var findById = IamFunctions.getUser(GetUserArgs.builder()
            .userId("11111111-1111-1111-1111-111111111111")
            .build());

        // Get info by email address
        final var findByEmail = IamFunctions.getUser(GetUserArgs.builder()
            .email("foo@bar.com")
            .build());

    }
}
Copy
variables:
  # Get info by user id
  findById:
    fn::invoke:
      function: scaleway:iam:getUser
      arguments:
        userId: 11111111-1111-1111-1111-111111111111
  # Get info by email address
  findByEmail:
    fn::invoke:
      function: scaleway:iam:getUser
      arguments:
        email: foo@bar.com
Copy

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,
             organization_id: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             user_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetUserResult
def get_user_output(email: Optional[pulumi.Input[str]] = None,
             organization_id: Optional[pulumi.Input[str]] = None,
             tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
             user_id: Optional[pulumi.Input[str]] = 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: scaleway:iam/getUser:getUser
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Email string
The email address of the IAM user.
OrganizationId string
organization_id) The ID of the organization the user is associated with.
Tags List<string>
The tags associated with the user.
UserId string

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

Email string
The email address of the IAM user.
OrganizationId string
organization_id) The ID of the organization the user is associated with.
Tags []string
The tags associated with the user.
UserId string

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

email String
The email address of the IAM user.
organizationId String
organization_id) The ID of the organization the user is associated with.
tags List<String>
The tags associated with the user.
userId String

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

email string
The email address of the IAM user.
organizationId string
organization_id) The ID of the organization the user is associated with.
tags string[]
The tags associated with the user.
userId string

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

email str
The email address of the IAM user.
organization_id str
organization_id) The ID of the organization the user is associated with.
tags Sequence[str]
The tags associated with the user.
user_id str

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

email String
The email address of the IAM user.
organizationId String
organization_id) The ID of the organization the user is associated with.
tags List<String>
The tags associated with the user.
userId String

The ID of the IAM user.

Note You must specify at least one: name and/or user_id.

getUser Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Email string
OrganizationId string
Tags List<string>
The tags associated with the user.
UserId string
Id string
The provider-assigned unique ID for this managed resource.
Email string
OrganizationId string
Tags []string
The tags associated with the user.
UserId string
id String
The provider-assigned unique ID for this managed resource.
email String
organizationId String
tags List<String>
The tags associated with the user.
userId String
id string
The provider-assigned unique ID for this managed resource.
email string
organizationId string
tags string[]
The tags associated with the user.
userId string
id str
The provider-assigned unique ID for this managed resource.
email str
organization_id str
tags Sequence[str]
The tags associated with the user.
user_id str
id String
The provider-assigned unique ID for this managed resource.
email String
organizationId String
tags List<String>
The tags associated with the user.
userId String

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse