We recommend using Azure Native.
Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
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);
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)
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
})
}
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),
};
});
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());
}
}
variables:
example:
fn::invoke:
function: azure:postgresql:getFlexibleServer
arguments:
name: existing-postgresql-fs
resourceGroupName: existing-postgresql-resgroup
outputs:
id: ${example.id}
API Providers
This data source uses the following Azure API Providers:
Microsoft.DBforPostgreSQL- 2024-08-01
Using getFlexibleServer
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 getFlexibleServer(args: GetFlexibleServerArgs, opts?: InvokeOptions): Promise<GetFlexibleServerResult>
function getFlexibleServerOutput(args: GetFlexibleServerOutputArgs, opts?: InvokeOptions): Output<GetFlexibleServerResult>def get_flexible_server(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFlexibleServerResult
def get_flexible_server_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFlexibleServerResult]func LookupFlexibleServer(ctx *Context, args *LookupFlexibleServerArgs, opts ...InvokeOption) (*LookupFlexibleServerResult, error)
func LookupFlexibleServerOutput(ctx *Context, args *LookupFlexibleServerOutputArgs, opts ...InvokeOption) LookupFlexibleServerResultOutput> Note: This function is named LookupFlexibleServer in the Go SDK.
public static class GetFlexibleServer
{
public static Task<GetFlexibleServerResult> InvokeAsync(GetFlexibleServerArgs args, InvokeOptions? opts = null)
public static Output<GetFlexibleServerResult> Invoke(GetFlexibleServerInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
public static Output<GetFlexibleServerResult> getFlexibleServer(GetFlexibleServerArgs args, InvokeOptions options)
fn::invoke:
function: azure:postgresql/getFlexibleServer:getFlexibleServer
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of this PostgreSQL Flexible Server.
- Resource
Group stringName - The name of the Resource Group where the PostgreSQL Flexible Server exists.
- Name string
- The name of this PostgreSQL Flexible Server.
- Resource
Group stringName - The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name String
- The name of this PostgreSQL Flexible Server.
- resource
Group StringName - The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name string
- The name of this PostgreSQL Flexible Server.
- resource
Group stringName - The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name str
- The name of this PostgreSQL Flexible Server.
- resource_
group_ strname - The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name String
- The name of this PostgreSQL Flexible Server.
- resource
Group StringName - The name of the Resource Group where the PostgreSQL Flexible Server exists.
getFlexibleServer Result
The following output properties are available:
- Administrator
Login string - The Administrator login for the PostgreSQL Flexible Server.
- Auto
Grow boolEnabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- Backup
Retention intDays - The backup retention days for the PostgreSQL Flexible Server.
- Delegated
Subnet stringId - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- Fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- High
Availabilities List<GetFlexible Server High Availability> - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- Name string
- Public
Network boolAccess Enabled - Is public network access enabled?
- Resource
Group stringName - Sku
Name string - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - Storage
Mb int - The max storage allowed for the PostgreSQL Flexible Server.
- Dictionary<string, string>
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- Version string
- The version of PostgreSQL Flexible Server to use.
- Zone string
- The Availability Zones where this PostgreSQL Flexible Server is located.
- Administrator
Login string - The Administrator login for the PostgreSQL Flexible Server.
- Auto
Grow boolEnabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- Backup
Retention intDays - The backup retention days for the PostgreSQL Flexible Server.
- Delegated
Subnet stringId - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- Fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- High
Availabilities []GetFlexible Server High Availability - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- Name string
- Public
Network boolAccess Enabled - Is public network access enabled?
- Resource
Group stringName - Sku
Name string - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - Storage
Mb int - The max storage allowed for the PostgreSQL Flexible Server.
- map[string]string
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- Version string
- The version of PostgreSQL Flexible Server to use.
- Zone string
- The Availability Zones where this PostgreSQL Flexible Server is located.
- administrator
Login String - The Administrator login for the PostgreSQL Flexible Server.
- auto
Grow BooleanEnabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backup
Retention IntegerDays - The backup retention days for the PostgreSQL Flexible Server.
- delegated
Subnet StringId - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn String
- The FQDN of the PostgreSQL Flexible Server.
- high
Availabilities List<GetFlexible Server High Availability> - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the PostgreSQL Flexible Server exists.
- name String
- public
Network BooleanAccess Enabled - Is public network access enabled?
- resource
Group StringName - sku
Name String - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - storage
Mb Integer - The max storage allowed for the PostgreSQL Flexible Server.
- Map<String,String>
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- version String
- The version of PostgreSQL Flexible Server to use.
- zone String
- The Availability Zones where this PostgreSQL Flexible Server is located.
- administrator
Login string - The Administrator login for the PostgreSQL Flexible Server.
- auto
Grow booleanEnabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backup
Retention numberDays - The backup retention days for the PostgreSQL Flexible Server.
- delegated
Subnet stringId - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- high
Availabilities GetFlexible Server High Availability[] - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- name string
- public
Network booleanAccess Enabled - Is public network access enabled?
- resource
Group stringName - sku
Name string - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - storage
Mb number - The max storage allowed for the PostgreSQL Flexible Server.
- {[key: string]: string}
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- version string
- The version of PostgreSQL Flexible Server to use.
- zone string
- The Availability Zones where this PostgreSQL Flexible Server is located.
- administrator_
login str - The Administrator login for the PostgreSQL Flexible Server.
- auto_
grow_ boolenabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backup_
retention_ intdays - The backup retention days for the PostgreSQL Flexible Server.
- delegated_
subnet_ strid - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn str
- The FQDN of the PostgreSQL Flexible Server.
- high_
availabilities Sequence[GetFlexible Server High Availability] - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region where the PostgreSQL Flexible Server exists.
- name str
- public_
network_ boolaccess_ enabled - Is public network access enabled?
- resource_
group_ strname - sku_
name str - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - storage_
mb int - The max storage allowed for the PostgreSQL Flexible Server.
- Mapping[str, str]
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- version str
- The version of PostgreSQL Flexible Server to use.
- zone str
- The Availability Zones where this PostgreSQL Flexible Server is located.
- administrator
Login String - The Administrator login for the PostgreSQL Flexible Server.
- auto
Grow BooleanEnabled - Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backup
Retention NumberDays - The backup retention days for the PostgreSQL Flexible Server.
- delegated
Subnet StringId - The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn String
- The FQDN of the PostgreSQL Flexible Server.
- high
Availabilities List<Property Map> - A
high_availabilityblock for this PostgreSQL Flexible Server as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the PostgreSQL Flexible Server exists.
- name String
- public
Network BooleanAccess Enabled - Is public network access enabled?
- resource
Group StringName - sku
Name String - The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the
tier+namepattern (e.g.B_Standard_B1ms,GP_Standard_D2s_v3,MO_Standard_E4s_v3). - storage
Mb Number - The max storage allowed for the PostgreSQL Flexible Server.
- Map<String>
- A mapping of tags assigned to the PostgreSQL Flexible Server.
- version String
- The version of PostgreSQL Flexible Server to use.
- zone String
- The Availability Zones where this PostgreSQL Flexible Server is located.
Supporting Types
GetFlexibleServerHighAvailability
- Mode string
- The high availability mode of the PostgreSQL Flexible Server.
- Standby
Availability stringZone - The availability zone of the standby Flexible Server.
- Mode string
- The high availability mode of the PostgreSQL Flexible Server.
- Standby
Availability stringZone - The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the PostgreSQL Flexible Server.
- standby
Availability StringZone - The availability zone of the standby Flexible Server.
- mode string
- The high availability mode of the PostgreSQL Flexible Server.
- standby
Availability stringZone - The availability zone of the standby Flexible Server.
- mode str
- The high availability mode of the PostgreSQL Flexible Server.
- standby_
availability_ strzone - The availability zone of the standby Flexible Server.
- mode String
- The high availability mode of the PostgreSQL Flexible Server.
- standby
Availability StringZone - The availability zone of the standby Flexible Server.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
