1. Packages
  2. Ionoscloud
  3. API Docs
  4. dbaas
  5. getPSQLUser
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.dbaas.getPSQLUser

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

    The PgSql User data source can be used to search for and return an existing PgSql user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLUser({
        clusterId: "cluster_id",
        username: "username",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psqluser(cluster_id="cluster_id",
        username="username")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.LookupPSQLUser(ctx, &dbaas.LookupPSQLUserArgs{
    			ClusterId: "cluster_id",
    			Username:  "username",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Dbaas.GetPSQLUser.Invoke(new()
        {
            ClusterId = "cluster_id",
            Username = "username",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.dbaas.DbaasFunctions;
    import com.pulumi.ionoscloud.dbaas.inputs.GetPSQLUserArgs;
    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 = DbaasFunctions.getPSQLUser(GetPSQLUserArgs.builder()
                .clusterId("cluster_id")
                .username("username")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLUser
          arguments:
            clusterId: cluster_id
            username: username
    

    Using getPSQLUser

    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 getPSQLUser(args: GetPSQLUserArgs, opts?: InvokeOptions): Promise<GetPSQLUserResult>
    function getPSQLUserOutput(args: GetPSQLUserOutputArgs, opts?: InvokeOptions): Output<GetPSQLUserResult>
    def get_psqluser(cluster_id: Optional[str] = None,
                     username: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetPSQLUserResult
    def get_psqluser_output(cluster_id: Optional[pulumi.Input[str]] = None,
                     username: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetPSQLUserResult]
    func LookupPSQLUser(ctx *Context, args *LookupPSQLUserArgs, opts ...InvokeOption) (*LookupPSQLUserResult, error)
    func LookupPSQLUserOutput(ctx *Context, args *LookupPSQLUserOutputArgs, opts ...InvokeOption) LookupPSQLUserResultOutput

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

    public static class GetPSQLUser 
    {
        public static Task<GetPSQLUserResult> InvokeAsync(GetPSQLUserArgs args, InvokeOptions? opts = null)
        public static Output<GetPSQLUserResult> Invoke(GetPSQLUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPSQLUserResult> getPSQLUser(GetPSQLUserArgs args, InvokeOptions options)
    public static Output<GetPSQLUserResult> getPSQLUser(GetPSQLUserArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:dbaas/getPSQLUser:getPSQLUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    [string] The ID of the cluster.
    Username string
    [string] Name of an existing user that you want to search for.
    ClusterId string
    [string] The ID of the cluster.
    Username string
    [string] Name of an existing user that you want to search for.
    clusterId String
    [string] The ID of the cluster.
    username String
    [string] Name of an existing user that you want to search for.
    clusterId string
    [string] The ID of the cluster.
    username string
    [string] Name of an existing user that you want to search for.
    cluster_id str
    [string] The ID of the cluster.
    username str
    [string] Name of an existing user that you want to search for.
    clusterId String
    [string] The ID of the cluster.
    username String
    [string] Name of an existing user that you want to search for.

    getPSQLUser Result

    The following output properties are available:

    ClusterId string
    Id string
    [string] The id of the user.
    IsSystemUser bool
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    Username string
    ClusterId string
    Id string
    [string] The id of the user.
    IsSystemUser bool
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    Username string
    clusterId String
    id String
    [string] The id of the user.
    isSystemUser Boolean
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    username String
    clusterId string
    id string
    [string] The id of the user.
    isSystemUser boolean
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    username string
    cluster_id str
    id str
    [string] The id of the user.
    is_system_user bool
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    username str
    clusterId String
    id String
    [string] The id of the user.
    isSystemUser Boolean
    [bool] Describes whether this user is a system user or not. A system user cannot be updated or deleted.
    username String

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud