1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. getUser
OVHCloud v2.1.0 published on Friday, Mar 28, 2025 by OVHcloud

ovh.CloudProject.getUser

Explore with Pulumi AI

OVHCloud v2.1.0 published on Friday, Mar 28, 2025 by OVHcloud

Get the user details of a previously created public cloud project user.

Example Usage

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

const projectUsers = ovh.CloudProject.getUsers({
    serviceName: "XXX",
});
// Get the user ID of a previously created user with the description "S3-User"
const users = projectUsers.then(projectUsers => .filter(user => user.description == "S3-User").map(user => (user.userId)));
const s3UserId = users[0];
const myUser = Promise.all([projectUsers, s3UserId]).then(([projectUsers, s3UserId]) => ovh.CloudProject.getUser({
    serviceName: projectUsers.serviceName,
    userId: s3UserId,
}));
Copy
import pulumi
import pulumi_ovh as ovh

project_users = ovh.CloudProject.get_users(service_name="XXX")
# Get the user ID of a previously created user with the description "S3-User"
users = [user.user_id for user in project_users.users if user.description == "S3-User"]
s3_user_id = users[0]
my_user = ovh.CloudProject.get_user(service_name=project_users.service_name,
    user_id=s3_user_id)
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/cloudproject"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		projectUsers, err := cloudproject.GetUsers(ctx, &cloudproject.GetUsersArgs{
			ServiceName: "XXX",
		}, nil)
		if err != nil {
			return err
		}
		// Get the user ID of a previously created user with the description "S3-User"
		users := "TODO: For expression"
		s3UserId := users[0]
		_, err = cloudproject.GetUser(ctx, &cloudproject.GetUserArgs{
			ServiceName: projectUsers.ServiceName,
			UserId:      s3UserId,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var projectUsers = Ovh.CloudProject.GetUsers.Invoke(new()
    {
        ServiceName = "XXX",
    });

    // Get the user ID of a previously created user with the description "S3-User"
    var users = .Where(user => user.Description == "S3-User").Select(user => 
    {
        return user.UserId;
    }).ToList();

    var s3UserId = users[0];

    var myUser = Ovh.CloudProject.GetUser.Invoke(new()
    {
        ServiceName = projectUsers.Apply(getUsersResult => getUsersResult.ServiceName),
        UserId = s3UserId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.CloudProject.CloudProjectFunctions;
import com.pulumi.ovh.CloudProject.inputs.GetUsersArgs;
import com.pulumi.ovh.CloudProject.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 projectUsers = CloudProjectFunctions.getUsers(GetUsersArgs.builder()
            .serviceName("XXX")
            .build());

        // Get the user ID of a previously created user with the description "S3-User"
        final var users = "TODO: ForExpression";

        final var s3UserId = users[0];

        final var myUser = CloudProjectFunctions.getUser(GetUserArgs.builder()
            .serviceName(projectUsers.applyValue(getUsersResult -> getUsersResult.serviceName()))
            .userId(s3UserId)
            .build());

    }
}
Copy
Coming soon!

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(service_name: Optional[str] = None,
             user_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetUserResult
def get_user_output(service_name: Optional[pulumi.Input[str]] = None,
             user_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
Copy
func GetUser(ctx *Context, args *GetUserArgs, opts ...InvokeOption) (*GetUserResult, error)
func GetUserOutput(ctx *Context, args *GetUserOutputArgs, opts ...InvokeOption) GetUserResultOutput
Copy

> Note: This function is named GetUser 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: ovh:CloudProject/getUser:getUser
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
UserId
This property is required.
Changes to this property will trigger replacement.
string
The ID of a public cloud project's user.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
UserId
This property is required.
Changes to this property will trigger replacement.
string
The ID of a public cloud project's user.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
userId
This property is required.
Changes to this property will trigger replacement.
String
The ID of a public cloud project's user.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
userId
This property is required.
Changes to this property will trigger replacement.
string
The ID of a public cloud project's user.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
user_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of a public cloud project's user.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The ID of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
userId
This property is required.
Changes to this property will trigger replacement.
String
The ID of a public cloud project's user.

getUser Result

The following output properties are available:

CreationDate string
the date the user was created.
Description string
description of the role
Id string
The provider-assigned unique ID for this managed resource.
Roles List<GetUserRole>
A list of roles associated with the user.
ServiceName string
Status string
the status of the user. should be normally set to 'ok'.
UserId string
Username string
the username generated for the user. This username can be used with the Openstack API.
CreationDate string
the date the user was created.
Description string
description of the role
Id string
The provider-assigned unique ID for this managed resource.
Roles []GetUserRole
A list of roles associated with the user.
ServiceName string
Status string
the status of the user. should be normally set to 'ok'.
UserId string
Username string
the username generated for the user. This username can be used with the Openstack API.
creationDate String
the date the user was created.
description String
description of the role
id String
The provider-assigned unique ID for this managed resource.
roles List<GetUserRole>
A list of roles associated with the user.
serviceName String
status String
the status of the user. should be normally set to 'ok'.
userId String
username String
the username generated for the user. This username can be used with the Openstack API.
creationDate string
the date the user was created.
description string
description of the role
id string
The provider-assigned unique ID for this managed resource.
roles GetUserRole[]
A list of roles associated with the user.
serviceName string
status string
the status of the user. should be normally set to 'ok'.
userId string
username string
the username generated for the user. This username can be used with the Openstack API.
creation_date str
the date the user was created.
description str
description of the role
id str
The provider-assigned unique ID for this managed resource.
roles Sequence[cloudproject.GetUserRole]
A list of roles associated with the user.
service_name str
status str
the status of the user. should be normally set to 'ok'.
user_id str
username str
the username generated for the user. This username can be used with the Openstack API.
creationDate String
the date the user was created.
description String
description of the role
id String
The provider-assigned unique ID for this managed resource.
roles List<Property Map>
A list of roles associated with the user.
serviceName String
status String
the status of the user. should be normally set to 'ok'.
userId String
username String
the username generated for the user. This username can be used with the Openstack API.

Supporting Types

GetUserRole

Description This property is required. string
description of the role
Id This property is required. string
id of the role
Name This property is required. string
name of the role
Permissions This property is required. List<string>
list of permissions associated with the role
Description This property is required. string
description of the role
Id This property is required. string
id of the role
Name This property is required. string
name of the role
Permissions This property is required. []string
list of permissions associated with the role
description This property is required. String
description of the role
id This property is required. String
id of the role
name This property is required. String
name of the role
permissions This property is required. List<String>
list of permissions associated with the role
description This property is required. string
description of the role
id This property is required. string
id of the role
name This property is required. string
name of the role
permissions This property is required. string[]
list of permissions associated with the role
description This property is required. str
description of the role
id This property is required. str
id of the role
name This property is required. str
name of the role
permissions This property is required. Sequence[str]
list of permissions associated with the role
description This property is required. String
description of the role
id This property is required. String
id of the role
name This property is required. String
name of the role
permissions This property is required. List<String>
list of permissions associated with the role

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.
OVHCloud v2.1.0 published on Friday, Mar 28, 2025 by OVHcloud