get Flexible Server
Use this data source to access information about an existing PostgreSQL Flexible Server.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.postgresql.getFlexibleServer({
name: "existing-postgresql-fs",
resourceGroupName: "existing-postgresql-resgroup",
});
export const id = example.then(example => example.id);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.postgresql.get_flexible_server(name="existing-postgresql-fs",
resource_group_name="existing-postgresql-resgroup")
pulumi.export("id", example.id)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.PostgreSql.GetFlexibleServer.Invoke(new()
{
Name = "existing-postgresql-fs",
ResourceGroupName = "existing-postgresql-resgroup",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/postgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := postgresql.LookupFlexibleServer(ctx, &postgresql.LookupFlexibleServerArgs{
Name: "existing-postgresql-fs",
ResourceGroupName: "existing-postgresql-resgroup",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.postgresql.PostgresqlFunctions;
import com.pulumi.azure.postgresql.inputs.GetFlexibleServerArgs;
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 = PostgresqlFunctions.getFlexibleServer(GetFlexibleServerArgs.builder()
.name("existing-postgresql-fs")
.resourceGroupName("existing-postgresql-resgroup")
.build());
ctx.export("id", example.id());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:postgresql:getFlexibleServer
arguments:
name: existing-postgresql-fs
resourceGroupName: existing-postgresql-resgroup
outputs:
id: ${example.id}
Content copied to clipboard
API Providers
This data source uses the following Azure API Providers:
Microsoft.DBforPostgreSQL
: 2024-08-01
Return
A collection of values returned by getFlexibleServer.
Parameters
argument
A collection of arguments for invoking getFlexibleServer.
Return
A collection of values returned by getFlexibleServer.
Parameters
name
The name of this PostgreSQL Flexible Server.
resource Group Name
The name of the Resource Group where the PostgreSQL Flexible Server exists.
See also
suspend fun getFlexibleServer(argument: suspend GetFlexibleServerPlainArgsBuilder.() -> Unit): GetFlexibleServerResult
Return
A collection of values returned by getFlexibleServer.
Parameters
argument
Builder for com.pulumi.azure.postgresql.kotlin.inputs.GetFlexibleServerPlainArgs.