We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.postgresql.getFlexibleServer
Explore with Pulumi AI
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.applyValue(getFlexibleServerResult -> getFlexibleServerResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:postgresql:getFlexibleServer
      arguments:
        name: existing-postgresql-fs
        resourceGroupName: existing-postgresql-resgroup
outputs:
  id: ${example.id}
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.
- ResourceGroup stringName 
- The name of the Resource Group where the PostgreSQL Flexible Server exists.
- Name string
- The name of this PostgreSQL Flexible Server.
- ResourceGroup stringName 
- The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name String
- The name of this PostgreSQL Flexible Server.
- resourceGroup StringName 
- The name of the Resource Group where the PostgreSQL Flexible Server exists.
- name string
- The name of this PostgreSQL Flexible Server.
- resourceGroup 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.
- resourceGroup StringName 
- The name of the Resource Group where the PostgreSQL Flexible Server exists.
getFlexibleServer Result
The following output properties are available:
- AdministratorLogin string
- The Administrator login for the PostgreSQL Flexible Server.
- AutoGrow boolEnabled 
- Is the storage auto grow for PostgreSQL Flexible Server enabled?
- BackupRetention intDays 
- The backup retention days for the PostgreSQL Flexible Server.
- DelegatedSubnet stringId 
- The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- Fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- Name string
- PublicNetwork boolAccess Enabled 
- Is public network access enabled?
- ResourceGroup stringName 
- SkuName 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).
- StorageMb 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.
- AdministratorLogin string
- The Administrator login for the PostgreSQL Flexible Server.
- AutoGrow boolEnabled 
- Is the storage auto grow for PostgreSQL Flexible Server enabled?
- BackupRetention intDays 
- The backup retention days for the PostgreSQL Flexible Server.
- DelegatedSubnet stringId 
- The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- Fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- Name string
- PublicNetwork boolAccess Enabled 
- Is public network access enabled?
- ResourceGroup stringName 
- SkuName 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).
- StorageMb 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.
- administratorLogin String
- The Administrator login for the PostgreSQL Flexible Server.
- autoGrow BooleanEnabled 
- Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backupRetention IntegerDays 
- The backup retention days for the PostgreSQL Flexible Server.
- delegatedSubnet StringId 
- The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn String
- The FQDN of the PostgreSQL Flexible Server.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the PostgreSQL Flexible Server exists.
- name String
- publicNetwork BooleanAccess Enabled 
- Is public network access enabled?
- resourceGroup StringName 
- skuName 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).
- storageMb 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.
- administratorLogin string
- The Administrator login for the PostgreSQL Flexible Server.
- autoGrow booleanEnabled 
- Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backupRetention numberDays 
- The backup retention days for the PostgreSQL Flexible Server.
- delegatedSubnet stringId 
- The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn string
- The FQDN of the PostgreSQL Flexible Server.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region where the PostgreSQL Flexible Server exists.
- name string
- publicNetwork booleanAccess Enabled 
- Is public network access enabled?
- resourceGroup stringName 
- skuName 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).
- storageMb 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.
- 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.
- 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.
- administratorLogin String
- The Administrator login for the PostgreSQL Flexible Server.
- autoGrow BooleanEnabled 
- Is the storage auto grow for PostgreSQL Flexible Server enabled?
- backupRetention NumberDays 
- The backup retention days for the PostgreSQL Flexible Server.
- delegatedSubnet StringId 
- The ID of the virtual network subnet to create the PostgreSQL Flexible Server.
- fqdn String
- The FQDN of the PostgreSQL Flexible Server.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the PostgreSQL Flexible Server exists.
- name String
- publicNetwork BooleanAccess Enabled 
- Is public network access enabled?
- resourceGroup StringName 
- skuName 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).
- storageMb 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.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.