1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. getUsers
OVHCloud v0.42.0 published on Tuesday, Apr 9, 2024 by OVHcloud

ovh.CloudProjectDatabase.getUsers

Explore with Pulumi AI

ovh logo
OVHCloud v0.42.0 published on Tuesday, Apr 9, 2024 by OVHcloud

    Use this data source to get the list of users of a database cluster associated with a public cloud project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@pulumi/ovh";
    
    const users = ovh.CloudProjectDatabase.getUsers({
        serviceName: "XXXX",
        engine: "YYYY",
        clusterId: "ZZZ",
    });
    export const userIds = users.then(users => users.userIds);
    
    import pulumi
    import pulumi_ovh as ovh
    
    users = ovh.CloudProjectDatabase.get_users(service_name="XXXX",
        engine="YYYY",
        cluster_id="ZZZ")
    pulumi.export("userIds", users.user_ids)
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProjectDatabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		users, err := CloudProjectDatabase.GetUsers(ctx, &cloudprojectdatabase.GetUsersArgs{
    			ServiceName: "XXXX",
    			Engine:      "YYYY",
    			ClusterId:   "ZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("userIds", users.UserIds)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var users = Ovh.CloudProjectDatabase.GetUsers.Invoke(new()
        {
            ServiceName = "XXXX",
            Engine = "YYYY",
            ClusterId = "ZZZ",
        });
    
        return new Dictionary<string, object?>
        {
            ["userIds"] = users.Apply(getUsersResult => getUsersResult.UserIds),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
    import com.pulumi.ovh.CloudProjectDatabase.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 users = CloudProjectDatabaseFunctions.getUsers(GetUsersArgs.builder()
                .serviceName("XXXX")
                .engine("YYYY")
                .clusterId("ZZZ")
                .build());
    
            ctx.export("userIds", users.applyValue(getUsersResult -> getUsersResult.userIds()));
        }
    }
    
    variables:
      users:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getUsers
          Arguments:
            serviceName: XXXX
            engine: YYYY
            clusterId: ZZZ
    outputs:
      userIds: ${users.userIds}
    

    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(cluster_id: Optional[str] = None,
                  engine: Optional[str] = None,
                  service_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetUsersResult
    def get_users_output(cluster_id: Optional[pulumi.Input[str]] = None,
                  engine: Optional[pulumi.Input[str]] = None,
                  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:CloudProjectDatabase/getUsers:getUsers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    Cluster ID
    Engine string
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ClusterId string
    Cluster ID
    Engine string
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID
    engine String
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId string
    Cluster ID
    engine string
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    cluster_id str
    Cluster ID
    engine str
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID
    engine String
    The engine of the database cluster you want to list users. To get a full list of available engine visit: public documentation.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    getUsers Result

    The following output properties are available:

    ClusterId string
    See Argument Reference above.
    Engine string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceName string
    See Argument Reference above.
    UserIds List<string>
    The list of users ids of the database cluster associated with the project.
    ClusterId string
    See Argument Reference above.
    Engine string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceName string
    See Argument Reference above.
    UserIds []string
    The list of users ids of the database cluster associated with the project.
    clusterId String
    See Argument Reference above.
    engine String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceName String
    See Argument Reference above.
    userIds List<String>
    The list of users ids of the database cluster associated with the project.
    clusterId string
    See Argument Reference above.
    engine string
    See Argument Reference above.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceName string
    See Argument Reference above.
    userIds string[]
    The list of users ids of the database cluster associated with the project.
    cluster_id str
    See Argument Reference above.
    engine str
    See Argument Reference above.
    id str
    The provider-assigned unique ID for this managed resource.
    service_name str
    See Argument Reference above.
    user_ids Sequence[str]
    The list of users ids of the database cluster associated with the project.
    clusterId String
    See Argument Reference above.
    engine String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceName String
    See Argument Reference above.
    userIds List<String>
    The list of users ids of the database cluster associated with the project.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.42.0 published on Tuesday, Apr 9, 2024 by OVHcloud