GetServer

Use this data source to access information about an existing PostgreSQL Azure Database Server.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.PostgreSql.GetServer.InvokeAsync(new Azure.PostgreSql.GetServerArgs
        {
            Name = "postgresql-server-1",
            ResourceGroupName = "api-rg-pro",
        }));
        this.PostgresqlServerId = example.Apply(example => example.Id);
    }

    [Output("postgresqlServerId")]
    public Output<string> PostgresqlServerId { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/postgresql"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := postgresql.LookupServer(ctx, &postgresql.LookupServerArgs{
            Name:              "postgresql-server-1",
            ResourceGroupName: "api-rg-pro",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("postgresqlServerId", example.Id)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.postgresql.get_server(name="postgresql-server-1",
    resource_group_name="api-rg-pro")
pulumi.export("postgresqlServerId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.postgresql.getServer({
    name: "postgresql-server-1",
    resourceGroupName: "api-rg-pro",
});
export const postgresqlServerId = example.then(example => example.id);

Using GetServer

function getServer(args: GetServerArgs, opts?: InvokeOptions): Promise<GetServerResult>
function  get_server(name=None, resource_group_name=None, opts=None)
func LookupServer(ctx *Context, args *LookupServerArgs, opts ...InvokeOption) (*LookupServerResult, error)

Note: This function is named LookupServer in the Go SDK.

public static class GetServer {
    public static Task<GetServerResult> InvokeAsync(GetServerArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the PostgreSQL Server.

ResourceGroupName string

Specifies the name of the Resource Group where the PostgreSQL Server exists.

Name string

The name of the PostgreSQL Server.

ResourceGroupName string

Specifies the name of the Resource Group where the PostgreSQL Server exists.

name string

The name of the PostgreSQL Server.

resourceGroupName string

Specifies the name of the Resource Group where the PostgreSQL Server exists.

name str

The name of the PostgreSQL Server.

resource_group_name str

Specifies the name of the Resource Group where the PostgreSQL Server exists.

GetServer Result

The following output properties are available:

AdministratorLogin string

The administrator username of the PostgreSQL Server.

Fqdn string

The fully qualified domain name of the PostgreSQL Server.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The location of the Resource Group in which the PostgreSQL Server exists.

Name string
ResourceGroupName string
Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

Version string

The version of the PostgreSQL Server.

AdministratorLogin string

The administrator username of the PostgreSQL Server.

Fqdn string

The fully qualified domain name of the PostgreSQL Server.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The location of the Resource Group in which the PostgreSQL Server exists.

Name string
ResourceGroupName string
Tags map[string]string

A mapping of tags assigned to the resource.

Version string

The version of the PostgreSQL Server.

administratorLogin string

The administrator username of the PostgreSQL Server.

fqdn string

The fully qualified domain name of the PostgreSQL Server.

id string

The provider-assigned unique ID for this managed resource.

location string

The location of the Resource Group in which the PostgreSQL Server exists.

name string
resourceGroupName string
tags {[key: string]: string}

A mapping of tags assigned to the resource.

version string

The version of the PostgreSQL Server.

administrator_login str

The administrator username of the PostgreSQL Server.

fqdn str

The fully qualified domain name of the PostgreSQL Server.

id str

The provider-assigned unique ID for this managed resource.

location str

The location of the Resource Group in which the PostgreSQL Server exists.

name str
resource_group_name str
tags Dict[str, str]

A mapping of tags assigned to the resource.

version str

The version of the PostgreSQL Server.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.