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

linode.getDatabasePostgresql

Explore with Pulumi AI

DEPRECATION NOTICE: This data source has been deprecated. Please use linode.DatabasePostgresqlV2 for all future implementations.

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.getDatabasePostgresql({
    id: 12345,
});
Copy
import pulumi
import pulumi_linode as linode

my_db = linode.get_database_postgresql(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.LookupDatabasePostgresql(ctx, &linode.LookupDatabasePostgresqlArgs{
			Id: pulumi.IntRef(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.GetDatabasePostgresql.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.GetDatabasePostgresqlArgs;
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.getDatabasePostgresql(GetDatabasePostgresqlArgs.builder()
            .id(12345)
            .build());

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

updates

The following arguments are exported by 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 - Whether maintenance occurs on a weekly or monthly basis. (weekly, monthly)

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

  • week_of_month - The week of the month to perform monthly frequency updates. Required for monthly frequency updates. (1..4)

Using getDatabasePostgresql

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 getDatabasePostgresql(args: GetDatabasePostgresqlArgs, opts?: InvokeOptions): Promise<GetDatabasePostgresqlResult>
function getDatabasePostgresqlOutput(args: GetDatabasePostgresqlOutputArgs, opts?: InvokeOptions): Output<GetDatabasePostgresqlResult>
Copy
def get_database_postgresql(database_id: Optional[int] = None,
                            id: Optional[int] = None,
                            opts: Optional[InvokeOptions] = None) -> GetDatabasePostgresqlResult
def get_database_postgresql_output(database_id: Optional[pulumi.Input[int]] = None,
                            id: Optional[pulumi.Input[int]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetDatabasePostgresqlResult]
Copy
func LookupDatabasePostgresql(ctx *Context, args *LookupDatabasePostgresqlArgs, opts ...InvokeOption) (*LookupDatabasePostgresqlResult, error)
func LookupDatabasePostgresqlOutput(ctx *Context, args *LookupDatabasePostgresqlOutputArgs, opts ...InvokeOption) LookupDatabasePostgresqlResultOutput
Copy

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

public static class GetDatabasePostgresql 
{
    public static Task<GetDatabasePostgresqlResult> InvokeAsync(GetDatabasePostgresqlArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabasePostgresqlResult> Invoke(GetDatabasePostgresqlInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabasePostgresqlResult> getDatabasePostgresql(GetDatabasePostgresqlArgs args, InvokeOptions options)
public static Output<GetDatabasePostgresqlResult> getDatabasePostgresql(GetDatabasePostgresqlArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getDatabasePostgresql:getDatabasePostgresql
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DatabaseId int
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

Id int
The ID of the PostgreSQL database. Mutually exclusive with database_id.
DatabaseId int
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

Id int
The ID of the PostgreSQL database. Mutually exclusive with database_id.
databaseId Integer
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id Integer
The ID of the PostgreSQL database. Mutually exclusive with database_id.
databaseId number
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id number
The ID of the PostgreSQL database. Mutually exclusive with database_id.
database_id int
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id int
The ID of the PostgreSQL database. Mutually exclusive with database_id.
databaseId Number
The ID of the PostgreSQL database. Deprecated: Use id instead.

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id Number
The ID of the PostgreSQL database. Mutually exclusive with database_id.

getDatabasePostgresql 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.
CaCert string
The base64-encoded SSL CA certificate for the Managed Database instance.
ClusterSize int
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
HostPrimary string
The primary host for the Managed Database.
HostSecondary string
The secondary/private network host for the Managed Database.
Label string
A unique, user-defined string referring to the Managed Database.
Port int
Region string
The region that hosts this Linode Managed Database.
ReplicationCommitType string
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
ReplicationType string
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
Type string
The Linode Instance type used for the nodes of the Managed Database instance.
Updated string
When this Managed Database was last updated.
Updates List<GetDatabasePostgresqlUpdate>
Version string
The Managed Database engine version. (e.g. v8.0.26)
DatabaseId int

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

Id int
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.
CaCert string
The base64-encoded SSL CA certificate for the Managed Database instance.
ClusterSize int
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
HostPrimary string
The primary host for the Managed Database.
HostSecondary string
The secondary/private network host for the Managed Database.
Label string
A unique, user-defined string referring to the Managed Database.
Port int
Region string
The region that hosts this Linode Managed Database.
ReplicationCommitType string
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
ReplicationType string
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
Type string
The Linode Instance type used for the nodes of the Managed Database instance.
Updated string
When this Managed Database was last updated.
Updates []GetDatabasePostgresqlUpdate
Version string
The Managed Database engine version. (e.g. v8.0.26)
DatabaseId int

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

Id int
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.
caCert String
The base64-encoded SSL CA certificate for the Managed Database instance.
clusterSize Integer
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
hostPrimary String
The primary host for the Managed Database.
hostSecondary String
The secondary/private network host for the Managed Database.
label String
A unique, user-defined string referring to the Managed Database.
port Integer
region String
The region that hosts this Linode Managed Database.
replicationCommitType String
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
replicationType String
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
type String
The Linode Instance type used for the nodes of the Managed Database instance.
updated String
When this Managed Database was last updated.
updates List<GetDatabasePostgresqlUpdate>
version String
The Managed Database engine version. (e.g. v8.0.26)
databaseId Integer

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id Integer
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.
caCert string
The base64-encoded SSL CA certificate for the Managed Database instance.
clusterSize number
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
hostPrimary string
The primary host for the Managed Database.
hostSecondary string
The secondary/private network host for the Managed Database.
label string
A unique, user-defined string referring to the Managed Database.
port number
region string
The region that hosts this Linode Managed Database.
replicationCommitType string
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
replicationType string
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
type string
The Linode Instance type used for the nodes of the Managed Database instance.
updated string
When this Managed Database was last updated.
updates GetDatabasePostgresqlUpdate[]
version string
The Managed Database engine version. (e.g. v8.0.26)
databaseId number

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id number
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.
ca_cert str
The base64-encoded SSL CA certificate for the Managed Database instance.
cluster_size int
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
host_primary str
The primary host for the Managed Database.
host_secondary str
The secondary/private network host for the Managed Database.
label str
A unique, user-defined string referring to the Managed Database.
port int
region str
The region that hosts this Linode Managed Database.
replication_commit_type str
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
replication_type str
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
type str
The Linode Instance type used for the nodes of the Managed Database instance.
updated str
When this Managed Database was last updated.
updates Sequence[GetDatabasePostgresqlUpdate]
version str
The Managed Database engine version. (e.g. v8.0.26)
database_id int

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id int
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.
caCert String
The base64-encoded SSL CA certificate for the Managed Database instance.
clusterSize Number
The number of Linode Instance nodes deployed to the Managed Database.
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/13.2)
hostPrimary String
The primary host for the Managed Database.
hostSecondary String
The secondary/private network host for the Managed Database.
label String
A unique, user-defined string referring to the Managed Database.
port Number
region String
The region that hosts this Linode Managed Database.
replicationCommitType String
(Optional) The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off)
replicationType String
The replication method used for the Managed Database. (none, asynch, semi_synch)
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.
type String
The Linode Instance type used for the nodes of the Managed Database instance.
updated String
When this Managed Database was last updated.
updates List<Property Map>
version String
The Managed Database engine version. (e.g. v8.0.26)
databaseId Number

Deprecated: Configure id instead. This attribute will be removed in the next major version of the provider.

id Number

Supporting Types

GetDatabasePostgresqlUpdate

DayOfWeek This property is required. string
Duration This property is required. int
Frequency This property is required. string
HourOfDay This property is required. int
WeekOfMonth This property is required. int
DayOfWeek This property is required. string
Duration This property is required. int
Frequency This property is required. string
HourOfDay This property is required. int
WeekOfMonth This property is required. int
dayOfWeek This property is required. String
duration This property is required. Integer
frequency This property is required. String
hourOfDay This property is required. Integer
weekOfMonth This property is required. Integer
dayOfWeek This property is required. string
duration This property is required. number
frequency This property is required. string
hourOfDay This property is required. number
weekOfMonth This property is required. number
day_of_week This property is required. str
duration This property is required. int
frequency This property is required. str
hour_of_day This property is required. int
week_of_month This property is required. int
dayOfWeek This property is required. String
duration This property is required. Number
frequency This property is required. String
hourOfDay This property is required. Number
weekOfMonth 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.