OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud
ovh.CloudProject.getUsers
Explore with Pulumi AI
Get the list of all users of a public cloud project.
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];
export const userId = s3UserId;
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]
pulumi.export("userId", s3_user_id)
package main
import (
	"github.com/ovh/pulumi-ovh/sdk/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]
		ctx.Export("userId", s3UserId)
		return nil
	})
}
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];
    return new Dictionary<string, object?>
    {
        ["userId"] = s3UserId,
    };
});
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 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];
        ctx.export("userId", s3UserId);
    }
}
Coming soon!
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(service_name: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetUsersResult
def get_users_output(service_name: Optional[pulumi.Input[str]] = 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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: ovh:CloudProject/getUsers:getUsers
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Service
Name string - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- Service
Name string - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- service
Name String - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- service
Name string - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- service_
name str - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- service
Name String - The ID of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
getUsers Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Service
Name string - Users
List<Get
Users User>  - The list of users of a public cloud project.
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Service
Name string - Users
[]Get
Users User  - The list of users of a public cloud project.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - service
Name String - users
List<Get
Users User>  - The list of users of a public cloud project.
 
- id string
 - The provider-assigned unique ID for this managed resource.
 - service
Name string - users
Get
Users User[]  - The list of users of a public cloud project.
 
- id str
 - The provider-assigned unique ID for this managed resource.
 - service_
name str - users
Sequence[cloudproject.
Get Users User]  - The list of users of a public cloud project.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - service
Name String - users List<Property Map>
 - The list of users of a public cloud project.
 
Supporting Types
GetUsersUser  
- Creation
Date string - the date the user was created.
 - Description string
 - description of the role
 - Roles
List<Get
Users User Role>  - A list of roles associated with the user.
 - Status string
 - the status of the user. should be normally set to 'ok'.
 - User
Id string - The ID of a public cloud project's user.
 - Username string
 - the username generated for the user. This username can be used with the Openstack API.
 
- Creation
Date string - the date the user was created.
 - Description string
 - description of the role
 - Roles
[]Get
Users User Role  - A list of roles associated with the user.
 - Status string
 - the status of the user. should be normally set to 'ok'.
 - User
Id string - The ID of a public cloud project's user.
 - Username string
 - the username generated for the user. This username can be used with the Openstack API.
 
- creation
Date String - the date the user was created.
 - description String
 - description of the role
 - roles
List<Get
Users User Role>  - A list of roles associated with the user.
 - status String
 - the status of the user. should be normally set to 'ok'.
 - user
Id String - The ID of a public cloud project's user.
 - username String
 - the username generated for the user. This username can be used with the Openstack API.
 
- creation
Date string - the date the user was created.
 - description string
 - description of the role
 - roles
Get
Users User Role[]  - A list of roles associated with the user.
 - status string
 - the status of the user. should be normally set to 'ok'.
 - user
Id string - The ID of a public cloud project's user.
 - 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
 - roles
Sequence[cloudproject.
Get Users User Role]  - A list of roles associated with the user.
 - status str
 - the status of the user. should be normally set to 'ok'.
 - user_
id str - The ID of a public cloud project's user.
 - username str
 - the username generated for the user. This username can be used with the Openstack API.
 
- creation
Date String - the date the user was created.
 - description String
 - description of the role
 - roles List<Property Map>
 - A list of roles associated with the user.
 - status String
 - the status of the user. should be normally set to 'ok'.
 - user
Id String - The ID of a public cloud project's user.
 - username String
 - the username generated for the user. This username can be used with the Openstack API.
 
GetUsersUserRole   
- Description string
 - description of the role
 - Id string
 - id of the role
 - Name string
 - name of the role
 - Permissions List<string>
 - list of permissions associated with the role
 
- Description string
 - description of the role
 - Id string
 - id of the role
 - Name string
 - name of the role
 - Permissions []string
 - list of permissions associated with the role
 
- description String
 - description of the role
 - id String
 - id of the role
 - name String
 - name of the role
 - permissions List<String>
 - list of permissions associated with the role
 
- description string
 - description of the role
 - id string
 - id of the role
 - name string
 - name of the role
 - permissions string[]
 - list of permissions associated with the role
 
- description str
 - description of the role
 - id str
 - id of the role
 - name str
 - name of the role
 - permissions Sequence[str]
 - list of permissions associated with the role
 
- description String
 - description of the role
 - id String
 - id of the role
 - name String
 - name of the role
 - permissions 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 
ovhTerraform Provider.