OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud
ovh.CloudProjectDatabase.getPostgresSqlUser
Explore with Pulumi AI
Use this data source to get information about a user of a postgresql cluster associated with a public cloud project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const pguser = ovh.CloudProjectDatabase.getPostgresSqlUser({
serviceName: "XXX",
clusterId: "YYY",
name: "ZZZ",
});
export const pguserRoles = pguser.then(pguser => pguser.roles);
import pulumi
import pulumi_ovh as ovh
pguser = ovh.CloudProjectDatabase.get_postgres_sql_user(service_name="XXX",
cluster_id="YYY",
name="ZZZ")
pulumi.export("pguserRoles", pguser.roles)
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 {
pguser, err := CloudProjectDatabase.GetPostgresSqlUser(ctx, &cloudprojectdatabase.GetPostgresSqlUserArgs{
ServiceName: "XXX",
ClusterId: "YYY",
Name: "ZZZ",
}, nil)
if err != nil {
return err
}
ctx.Export("pguserRoles", pguser.Roles)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var pguser = Ovh.CloudProjectDatabase.GetPostgresSqlUser.Invoke(new()
{
ServiceName = "XXX",
ClusterId = "YYY",
Name = "ZZZ",
});
return new Dictionary<string, object?>
{
["pguserRoles"] = pguser.Apply(getPostgresSqlUserResult => getPostgresSqlUserResult.Roles),
};
});
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.GetPostgresSqlUserArgs;
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 pguser = CloudProjectDatabaseFunctions.getPostgresSqlUser(GetPostgresSqlUserArgs.builder()
.serviceName("XXX")
.clusterId("YYY")
.name("ZZZ")
.build());
ctx.export("pguserRoles", pguser.applyValue(getPostgresSqlUserResult -> getPostgresSqlUserResult.roles()));
}
}
variables:
pguser:
fn::invoke:
Function: ovh:CloudProjectDatabase:getPostgresSqlUser
Arguments:
serviceName: XXX
clusterId: YYY
name: ZZZ
outputs:
pguserRoles: ${pguser.roles}
Using getPostgresSqlUser
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 getPostgresSqlUser(args: GetPostgresSqlUserArgs, opts?: InvokeOptions): Promise<GetPostgresSqlUserResult>
function getPostgresSqlUserOutput(args: GetPostgresSqlUserOutputArgs, opts?: InvokeOptions): Output<GetPostgresSqlUserResult>
def get_postgres_sql_user(cluster_id: Optional[str] = None,
name: Optional[str] = None,
service_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPostgresSqlUserResult
def get_postgres_sql_user_output(cluster_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPostgresSqlUserResult]
func GetPostgresSqlUser(ctx *Context, args *GetPostgresSqlUserArgs, opts ...InvokeOption) (*GetPostgresSqlUserResult, error)
func GetPostgresSqlUserOutput(ctx *Context, args *GetPostgresSqlUserOutputArgs, opts ...InvokeOption) GetPostgresSqlUserResultOutput
> Note: This function is named GetPostgresSqlUser
in the Go SDK.
public static class GetPostgresSqlUser
{
public static Task<GetPostgresSqlUserResult> InvokeAsync(GetPostgresSqlUserArgs args, InvokeOptions? opts = null)
public static Output<GetPostgresSqlUserResult> Invoke(GetPostgresSqlUserInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPostgresSqlUserResult> getPostgresSqlUser(GetPostgresSqlUserArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: ovh:CloudProjectDatabase/getPostgresSqlUser:getPostgresSqlUser
arguments:
# arguments dictionary
The following arguments are supported:
- Cluster
Id string - Cluster ID
- Name string
- Name of the user.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- Cluster
Id string - Cluster ID
- Name string
- Name of the user.
- Service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id String - Cluster ID
- name String
- Name of the user.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id string - Cluster ID
- name string
- Name of the user.
- service
Name string - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster_
id str - Cluster ID
- name str
- Name of the user.
- service_
name str - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- cluster
Id String - Cluster ID
- name String
- Name of the user.
- service
Name String - The id of the public cloud project. If omitted,
the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
getPostgresSqlUser Result
The following output properties are available:
- Cluster
Id string - See Argument Reference above.
- Created
At string - Date of the creation of the user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the user.
- Roles List<string>
- Roles the user belongs to.
- Service
Name string - Current status of the user.
- Status string
- Current status of the user.
- Cluster
Id string - See Argument Reference above.
- Created
At string - Date of the creation of the user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the user.
- Roles []string
- Roles the user belongs to.
- Service
Name string - Current status of the user.
- Status string
- Current status of the user.
- cluster
Id String - See Argument Reference above.
- created
At String - Date of the creation of the user.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the user.
- roles List<String>
- Roles the user belongs to.
- service
Name String - Current status of the user.
- status String
- Current status of the user.
- cluster
Id string - See Argument Reference above.
- created
At string - Date of the creation of the user.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Name of the user.
- roles string[]
- Roles the user belongs to.
- service
Name string - Current status of the user.
- status string
- Current status of the user.
- cluster_
id str - See Argument Reference above.
- created_
at str - Date of the creation of the user.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Name of the user.
- roles Sequence[str]
- Roles the user belongs to.
- service_
name str - Current status of the user.
- status str
- Current status of the user.
- cluster
Id String - See Argument Reference above.
- created
At String - Date of the creation of the user.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the user.
- roles List<String>
- Roles the user belongs to.
- service
Name String - Current status of the user.
- status String
- Current status of the user.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.