1. Packages
  2. Linode Provider
  3. API Docs
  4. getDatabasePostgresqlV2
Linode v4.37.0 published on Thursday, Apr 10, 2025 by Pulumi

linode.getDatabasePostgresqlV2

Explore with Pulumi AI

Provides information about a Linode PostgreSQL Database. For more information, see the Linode APIv4 docs.

Example Usage

Get information about a PostgreSQL database:

import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const my_db = linode.getDatabasePostgresqlV2({
    id: "12345",
});
Copy
import pulumi
import pulumi_linode as linode

my_db = linode.get_database_postgresql_v2(id="12345")
Copy
package main

import (
	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.LookupDatabasePostgresqlV2(ctx, &linode.LookupDatabasePostgresqlV2Args{
			Id: "12345",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var my_db = Linode.GetDatabasePostgresqlV2.Invoke(new()
    {
        Id = "12345",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabasePostgresqlV2Args;
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 my-db = LinodeFunctions.getDatabasePostgresqlV2(GetDatabasePostgresqlV2Args.builder()
            .id("12345")
            .build());

    }
}
Copy
variables:
  my-db:
    fn::invoke:
      function: linode:getDatabasePostgresqlV2
      arguments:
        id: 12345
Copy

pending_updates

The following arguments are exposed by each entry in the pending_updates attribute:

  • deadline - The time when a mandatory update needs to be applied.

  • description - A description of the update.

  • planned_for - The date and time a maintenance update will be applied.

updates

The following arguments are supported in the updates specification block:

  • day_of_week - The day to perform maintenance. (monday, tuesday, …)

  • duration - The maximum maintenance window time in hours. (1..3)

  • frequency - The frequency at which maintenance occurs. (weekly)

  • hour_of_day - The hour to begin maintenance based in UTC time. (0..23)

Using getDatabasePostgresqlV2

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 getDatabasePostgresqlV2(args: GetDatabasePostgresqlV2Args, opts?: InvokeOptions): Promise<GetDatabasePostgresqlV2Result>
function getDatabasePostgresqlV2Output(args: GetDatabasePostgresqlV2OutputArgs, opts?: InvokeOptions): Output<GetDatabasePostgresqlV2Result>
Copy
def get_database_postgresql_v2(id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetDatabasePostgresqlV2Result
def get_database_postgresql_v2_output(id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetDatabasePostgresqlV2Result]
Copy
func LookupDatabasePostgresqlV2(ctx *Context, args *LookupDatabasePostgresqlV2Args, opts ...InvokeOption) (*LookupDatabasePostgresqlV2Result, error)
func LookupDatabasePostgresqlV2Output(ctx *Context, args *LookupDatabasePostgresqlV2OutputArgs, opts ...InvokeOption) LookupDatabasePostgresqlV2ResultOutput
Copy

> Note: This function is named LookupDatabasePostgresqlV2 in the Go SDK.

public static class GetDatabasePostgresqlV2 
{
    public static Task<GetDatabasePostgresqlV2Result> InvokeAsync(GetDatabasePostgresqlV2Args args, InvokeOptions? opts = null)
    public static Output<GetDatabasePostgresqlV2Result> Invoke(GetDatabasePostgresqlV2InvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabasePostgresqlV2Result> getDatabasePostgresqlV2(GetDatabasePostgresqlV2Args args, InvokeOptions options)
public static Output<GetDatabasePostgresqlV2Result> getDatabasePostgresqlV2(GetDatabasePostgresqlV2Args args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getDatabasePostgresqlV2:getDatabasePostgresqlV2
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id This property is required. string
The ID of the PostgreSQL database.
Id This property is required. string
The ID of the PostgreSQL database.
id This property is required. String
The ID of the PostgreSQL database.
id This property is required. string
The ID of the PostgreSQL database.
id This property is required. str
The ID of the PostgreSQL database.
id This property is required. String
The ID of the PostgreSQL database.

getDatabasePostgresqlV2 Result

The following output properties are available:

AllowLists List<string>
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
CaCert string
The base64-encoded SSL CA certificate for the Managed Database.
ClusterSize int
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
Created string
When this Managed Database was created.
Encrypted bool
Whether the Managed Databases is encrypted.
Engine string
The Managed Database engine. (e.g. postgresql)
EngineId string
The Managed Database engine in engine/version format. (e.g. postgresql/16)
ForkRestoreTime string
The database timestamp from which it was restored.
ForkSource int
The ID of the database that was forked from.
HostPrimary string
The primary host for the Managed Database.
HostSecondary string
The secondary/private host for the managed database.
Id string
Label string
A unique, user-defined string referring to the Managed Database.
Members Dictionary<string, string>
OldestRestoreTime string
PendingUpdates List<GetDatabasePostgresqlV2PendingUpdate>
Platform string
The back-end platform for relational databases used by the service.
Port int
The access port for this Managed Database.
Region string
The region to use for the Managed Database.
RootPassword string
The randomly-generated root password for the Managed Database instance.
RootUsername string
The root username for the Managed Database instance.
SslConnection bool
Whether to require SSL credentials to establish a connection to the Managed Database.
Status string
The operating status of the Managed Database.
Suspended bool
Whether this Managed Database is suspended.
Type string
The Linode Instance type used for the nodes of the Managed Database.
Updated string
When this Managed Database was last updated.
Updates GetDatabasePostgresqlV2Updates
Version string
The Managed Database engine version. (e.g. 13.2)
AllowLists []string
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
CaCert string
The base64-encoded SSL CA certificate for the Managed Database.
ClusterSize int
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
Created string
When this Managed Database was created.
Encrypted bool
Whether the Managed Databases is encrypted.
Engine string
The Managed Database engine. (e.g. postgresql)
EngineId string
The Managed Database engine in engine/version format. (e.g. postgresql/16)
ForkRestoreTime string
The database timestamp from which it was restored.
ForkSource int
The ID of the database that was forked from.
HostPrimary string
The primary host for the Managed Database.
HostSecondary string
The secondary/private host for the managed database.
Id string
Label string
A unique, user-defined string referring to the Managed Database.
Members map[string]string
OldestRestoreTime string
PendingUpdates []GetDatabasePostgresqlV2PendingUpdate
Platform string
The back-end platform for relational databases used by the service.
Port int
The access port for this Managed Database.
Region string
The region to use for the Managed Database.
RootPassword string
The randomly-generated root password for the Managed Database instance.
RootUsername string
The root username for the Managed Database instance.
SslConnection bool
Whether to require SSL credentials to establish a connection to the Managed Database.
Status string
The operating status of the Managed Database.
Suspended bool
Whether this Managed Database is suspended.
Type string
The Linode Instance type used for the nodes of the Managed Database.
Updated string
When this Managed Database was last updated.
Updates GetDatabasePostgresqlV2Updates
Version string
The Managed Database engine version. (e.g. 13.2)
allowLists List<String>
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
caCert String
The base64-encoded SSL CA certificate for the Managed Database.
clusterSize Integer
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
created String
When this Managed Database was created.
encrypted Boolean
Whether the Managed Databases is encrypted.
engine String
The Managed Database engine. (e.g. postgresql)
engineId String
The Managed Database engine in engine/version format. (e.g. postgresql/16)
forkRestoreTime String
The database timestamp from which it was restored.
forkSource Integer
The ID of the database that was forked from.
hostPrimary String
The primary host for the Managed Database.
hostSecondary String
The secondary/private host for the managed database.
id String
label String
A unique, user-defined string referring to the Managed Database.
members Map<String,String>
oldestRestoreTime String
pendingUpdates List<GetDatabasePostgresqlV2PendingUpdate>
platform String
The back-end platform for relational databases used by the service.
port Integer
The access port for this Managed Database.
region String
The region to use for the Managed Database.
rootPassword String
The randomly-generated root password for the Managed Database instance.
rootUsername String
The root username for the Managed Database instance.
sslConnection Boolean
Whether to require SSL credentials to establish a connection to the Managed Database.
status String
The operating status of the Managed Database.
suspended Boolean
Whether this Managed Database is suspended.
type String
The Linode Instance type used for the nodes of the Managed Database.
updated String
When this Managed Database was last updated.
updates GetDatabasePostgresqlV2Updates
version String
The Managed Database engine version. (e.g. 13.2)
allowLists string[]
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
caCert string
The base64-encoded SSL CA certificate for the Managed Database.
clusterSize number
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
created string
When this Managed Database was created.
encrypted boolean
Whether the Managed Databases is encrypted.
engine string
The Managed Database engine. (e.g. postgresql)
engineId string
The Managed Database engine in engine/version format. (e.g. postgresql/16)
forkRestoreTime string
The database timestamp from which it was restored.
forkSource number
The ID of the database that was forked from.
hostPrimary string
The primary host for the Managed Database.
hostSecondary string
The secondary/private host for the managed database.
id string
label string
A unique, user-defined string referring to the Managed Database.
members {[key: string]: string}
oldestRestoreTime string
pendingUpdates GetDatabasePostgresqlV2PendingUpdate[]
platform string
The back-end platform for relational databases used by the service.
port number
The access port for this Managed Database.
region string
The region to use for the Managed Database.
rootPassword string
The randomly-generated root password for the Managed Database instance.
rootUsername string
The root username for the Managed Database instance.
sslConnection boolean
Whether to require SSL credentials to establish a connection to the Managed Database.
status string
The operating status of the Managed Database.
suspended boolean
Whether this Managed Database is suspended.
type string
The Linode Instance type used for the nodes of the Managed Database.
updated string
When this Managed Database was last updated.
updates GetDatabasePostgresqlV2Updates
version string
The Managed Database engine version. (e.g. 13.2)
allow_lists Sequence[str]
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
ca_cert str
The base64-encoded SSL CA certificate for the Managed Database.
cluster_size int
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
created str
When this Managed Database was created.
encrypted bool
Whether the Managed Databases is encrypted.
engine str
The Managed Database engine. (e.g. postgresql)
engine_id str
The Managed Database engine in engine/version format. (e.g. postgresql/16)
fork_restore_time str
The database timestamp from which it was restored.
fork_source int
The ID of the database that was forked from.
host_primary str
The primary host for the Managed Database.
host_secondary str
The secondary/private host for the managed database.
id str
label str
A unique, user-defined string referring to the Managed Database.
members Mapping[str, str]
oldest_restore_time str
pending_updates Sequence[GetDatabasePostgresqlV2PendingUpdate]
platform str
The back-end platform for relational databases used by the service.
port int
The access port for this Managed Database.
region str
The region to use for the Managed Database.
root_password str
The randomly-generated root password for the Managed Database instance.
root_username str
The root username for the Managed Database instance.
ssl_connection bool
Whether to require SSL credentials to establish a connection to the Managed Database.
status str
The operating status of the Managed Database.
suspended bool
Whether this Managed Database is suspended.
type str
The Linode Instance type used for the nodes of the Managed Database.
updated str
When this Managed Database was last updated.
updates GetDatabasePostgresqlV2Updates
version str
The Managed Database engine version. (e.g. 13.2)
allowLists List<String>
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode.DatabaseAccessControls to manage your allow list separately.
caCert String
The base64-encoded SSL CA certificate for the Managed Database.
clusterSize Number
The number of Linode Instance nodes deployed to the Managed Database. (default 1)
created String
When this Managed Database was created.
encrypted Boolean
Whether the Managed Databases is encrypted.
engine String
The Managed Database engine. (e.g. postgresql)
engineId String
The Managed Database engine in engine/version format. (e.g. postgresql/16)
forkRestoreTime String
The database timestamp from which it was restored.
forkSource Number
The ID of the database that was forked from.
hostPrimary String
The primary host for the Managed Database.
hostSecondary String
The secondary/private host for the managed database.
id String
label String
A unique, user-defined string referring to the Managed Database.
members Map<String>
oldestRestoreTime String
pendingUpdates List<Property Map>
platform String
The back-end platform for relational databases used by the service.
port Number
The access port for this Managed Database.
region String
The region to use for the Managed Database.
rootPassword String
The randomly-generated root password for the Managed Database instance.
rootUsername String
The root username for the Managed Database instance.
sslConnection Boolean
Whether to require SSL credentials to establish a connection to the Managed Database.
status String
The operating status of the Managed Database.
suspended Boolean
Whether this Managed Database is suspended.
type String
The Linode Instance type used for the nodes of the Managed Database.
updated String
When this Managed Database was last updated.
updates Property Map
version String
The Managed Database engine version. (e.g. 13.2)

Supporting Types

GetDatabasePostgresqlV2PendingUpdate

Deadline This property is required. string
Description This property is required. string
PlannedFor This property is required. string
Deadline This property is required. string
Description This property is required. string
PlannedFor This property is required. string
deadline This property is required. String
description This property is required. String
plannedFor This property is required. String
deadline This property is required. string
description This property is required. string
plannedFor This property is required. string
deadline This property is required. str
description This property is required. str
planned_for This property is required. str
deadline This property is required. String
description This property is required. String
plannedFor This property is required. String

GetDatabasePostgresqlV2Updates

DayOfWeek This property is required. int
Duration This property is required. int
Frequency This property is required. string
HourOfDay This property is required. int
DayOfWeek This property is required. int
Duration This property is required. int
Frequency This property is required. string
HourOfDay This property is required. int
dayOfWeek This property is required. Integer
duration This property is required. Integer
frequency This property is required. String
hourOfDay This property is required. Integer
dayOfWeek This property is required. number
duration This property is required. number
frequency This property is required. string
hourOfDay This property is required. number
day_of_week This property is required. int
duration This property is required. int
frequency This property is required. str
hour_of_day This property is required. int
dayOfWeek This property is required. Number
duration This property is required. Number
frequency This property is required. String
hourOfDay This property is required. Number

Package Details

Repository
Linode pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.