@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
368 lines (367 loc) • 13.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* > **DEPRECATION NOTICE:** This resource has been deprecated. Please use linode.DatabasePostgresqlV2 for all future implementations.
*
* Provides a Linode PostgreSQL Database resource. This can be used to create, modify, and delete Linode PostgreSQL Databases.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instances).
*
* Please keep in mind that Managed Databases can take up to an hour to provision.
*
* ## Example Usage
*
* Creating a simple PostgreSQL database instance:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const foobar = new linode.DatabasePostgresql("foobar", {
* label: "mydatabase",
* engineId: "postgresql/13.2",
* region: "us-southeast",
* type: "g6-nanode-1",
* });
* ```
*
* Creating a complex PostgreSQL database instance:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const foobar = new linode.DatabasePostgresql("foobar", {
* label: "mydatabase",
* engineId: "postgresql/13.2",
* region: "us-southeast",
* type: "g6-nanode-1",
* allowLists: ["0.0.0.0/0"],
* clusterSize: 3,
* encrypted: true,
* replicationType: "semi_synch",
* replicationCommitType: "remote_write",
* sslConnection: true,
* updates: {
* dayOfWeek: "saturday",
* duration: 1,
* frequency: "monthly",
* hourOfDay: 22,
* weekOfMonth: 2,
* },
* });
* ```
*
* ## updates
*
* The following arguments are supported in the `updates` specification block:
*
* * `dayOfWeek` - (Required) The day to perform maintenance. (`monday`, `tuesday`, ...)
*
* * `duration` - (Required) The maximum maintenance window time in hours. (`1`..`3`)
*
* * `frequency` - (Required) Whether maintenance occurs on a weekly or monthly basis. (`weekly`, `monthly`)
*
* * `hourOfDay` - (Required) The hour to begin maintenance based in UTC time. (`0`..`23`)
*
* * `weekOfMonth` - (Optional) The week of the month to perform monthly frequency updates. Required for `monthly` frequency updates. (`1`..`4`)
*
* ## Import
*
* Linode PostgreSQL Databases can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import linode:index/databasePostgresql:DatabasePostgresql foobar 1234567
* ```
*/
export declare class DatabasePostgresql extends pulumi.CustomResource {
/**
* Get an existing DatabasePostgresql resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabasePostgresqlState, opts?: pulumi.CustomResourceOptions): DatabasePostgresql;
/**
* Returns true if the given object is an instance of DatabasePostgresql. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is DatabasePostgresql;
/**
* 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.
*/
readonly allowLists: pulumi.Output<string[]>;
/**
* The base64-encoded SSL CA certificate for the Managed Database instance.
*/
readonly caCert: pulumi.Output<string>;
/**
* The number of Linode Instance nodes deployed to the Managed Database. (default `1`)
*/
readonly clusterSize: pulumi.Output<number | undefined>;
/**
* When this Managed Database was created.
*/
readonly created: pulumi.Output<string>;
/**
* Whether the Managed Databases is encrypted. (default `false`)
*/
readonly encrypted: pulumi.Output<boolean | undefined>;
/**
* The Managed Database engine. (e.g. `postgresql`)
*/
readonly engine: pulumi.Output<string>;
/**
* The Managed Database engine in engine/version format. (e.g. `postgresql/13.2`)
*/
readonly engineId: pulumi.Output<string>;
/**
* The primary host for the Managed Database.
*/
readonly hostPrimary: pulumi.Output<string>;
/**
* The secondary/private network host for the Managed Database.
*/
readonly hostSecondary: pulumi.Output<string>;
/**
* A unique, user-defined string referring to the Managed Database.
*/
readonly label: pulumi.Output<string>;
/**
* The access port for this Managed Database.
*/
readonly port: pulumi.Output<number>;
/**
* The region to use for the Managed Database.
*/
readonly region: pulumi.Output<string>;
/**
* The synchronization level of the replicating server. (`on`, `local`, `remoteWrite`, `remoteApply`, `off`; default `off`)
*
* * Must be `local` or `off` for the `asynch` replication type.
*
* * Must be `on`, `remoteWrite`, or `remoteApply` for the `semiSynch` replication type.
*/
readonly replicationCommitType: pulumi.Output<string | undefined>;
/**
* The replication method used for the Managed Database. (`none`, `asynch`, `semiSynch`; default `none`)
*
* * Must be `none` for a single node cluster.
*
* * Must be `asynch` or `semiSynch` for a high availability cluster.
*/
readonly replicationType: pulumi.Output<string | undefined>;
/**
* The randomly-generated root password for the Managed Database instance.
*/
readonly rootPassword: pulumi.Output<string>;
/**
* The root username for the Managed Database instance.
*/
readonly rootUsername: pulumi.Output<string>;
/**
* Whether to require SSL credentials to establish a connection to the Managed Database. (default `false`)
*
* * `updates` - (Optional) Configuration settings for automated patch update maintenance for the Managed Database.
*/
readonly sslConnection: pulumi.Output<boolean | undefined>;
/**
* The operating status of the Managed Database.
*/
readonly status: pulumi.Output<string>;
/**
* The Linode Instance type used for the nodes of the Managed Database instance.
*
* - - -
*/
readonly type: pulumi.Output<string>;
/**
* When this Managed Database was last updated.
*/
readonly updated: pulumi.Output<string>;
/**
* Configuration settings for automated patch update maintenance for the Managed Database.
*/
readonly updates: pulumi.Output<outputs.DatabasePostgresqlUpdates>;
/**
* The Managed Database engine version. (e.g. `13.2`)
*/
readonly version: pulumi.Output<string>;
/**
* Create a DatabasePostgresql resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DatabasePostgresqlArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DatabasePostgresql resources.
*/
export interface DatabasePostgresqlState {
/**
* 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.
*/
allowLists?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The base64-encoded SSL CA certificate for the Managed Database instance.
*/
caCert?: pulumi.Input<string>;
/**
* The number of Linode Instance nodes deployed to the Managed Database. (default `1`)
*/
clusterSize?: pulumi.Input<number>;
/**
* When this Managed Database was created.
*/
created?: pulumi.Input<string>;
/**
* Whether the Managed Databases is encrypted. (default `false`)
*/
encrypted?: pulumi.Input<boolean>;
/**
* The Managed Database engine. (e.g. `postgresql`)
*/
engine?: pulumi.Input<string>;
/**
* The Managed Database engine in engine/version format. (e.g. `postgresql/13.2`)
*/
engineId?: pulumi.Input<string>;
/**
* The primary host for the Managed Database.
*/
hostPrimary?: pulumi.Input<string>;
/**
* The secondary/private network host for the Managed Database.
*/
hostSecondary?: pulumi.Input<string>;
/**
* A unique, user-defined string referring to the Managed Database.
*/
label?: pulumi.Input<string>;
/**
* The access port for this Managed Database.
*/
port?: pulumi.Input<number>;
/**
* The region to use for the Managed Database.
*/
region?: pulumi.Input<string>;
/**
* The synchronization level of the replicating server. (`on`, `local`, `remoteWrite`, `remoteApply`, `off`; default `off`)
*
* * Must be `local` or `off` for the `asynch` replication type.
*
* * Must be `on`, `remoteWrite`, or `remoteApply` for the `semiSynch` replication type.
*/
replicationCommitType?: pulumi.Input<string>;
/**
* The replication method used for the Managed Database. (`none`, `asynch`, `semiSynch`; default `none`)
*
* * Must be `none` for a single node cluster.
*
* * Must be `asynch` or `semiSynch` for a high availability cluster.
*/
replicationType?: pulumi.Input<string>;
/**
* The randomly-generated root password for the Managed Database instance.
*/
rootPassword?: pulumi.Input<string>;
/**
* The root username for the Managed Database instance.
*/
rootUsername?: pulumi.Input<string>;
/**
* Whether to require SSL credentials to establish a connection to the Managed Database. (default `false`)
*
* * `updates` - (Optional) Configuration settings for automated patch update maintenance for the Managed Database.
*/
sslConnection?: pulumi.Input<boolean>;
/**
* The operating status of the Managed Database.
*/
status?: pulumi.Input<string>;
/**
* The Linode Instance type used for the nodes of the Managed Database instance.
*
* - - -
*/
type?: pulumi.Input<string>;
/**
* When this Managed Database was last updated.
*/
updated?: pulumi.Input<string>;
/**
* Configuration settings for automated patch update maintenance for the Managed Database.
*/
updates?: pulumi.Input<inputs.DatabasePostgresqlUpdates>;
/**
* The Managed Database engine version. (e.g. `13.2`)
*/
version?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DatabasePostgresql resource.
*/
export interface DatabasePostgresqlArgs {
/**
* 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.
*/
allowLists?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The number of Linode Instance nodes deployed to the Managed Database. (default `1`)
*/
clusterSize?: pulumi.Input<number>;
/**
* Whether the Managed Databases is encrypted. (default `false`)
*/
encrypted?: pulumi.Input<boolean>;
/**
* The Managed Database engine in engine/version format. (e.g. `postgresql/13.2`)
*/
engineId: pulumi.Input<string>;
/**
* A unique, user-defined string referring to the Managed Database.
*/
label: pulumi.Input<string>;
/**
* The region to use for the Managed Database.
*/
region: pulumi.Input<string>;
/**
* The synchronization level of the replicating server. (`on`, `local`, `remoteWrite`, `remoteApply`, `off`; default `off`)
*
* * Must be `local` or `off` for the `asynch` replication type.
*
* * Must be `on`, `remoteWrite`, or `remoteApply` for the `semiSynch` replication type.
*/
replicationCommitType?: pulumi.Input<string>;
/**
* The replication method used for the Managed Database. (`none`, `asynch`, `semiSynch`; default `none`)
*
* * Must be `none` for a single node cluster.
*
* * Must be `asynch` or `semiSynch` for a high availability cluster.
*/
replicationType?: pulumi.Input<string>;
/**
* Whether to require SSL credentials to establish a connection to the Managed Database. (default `false`)
*
* * `updates` - (Optional) Configuration settings for automated patch update maintenance for the Managed Database.
*/
sslConnection?: pulumi.Input<boolean>;
/**
* The Linode Instance type used for the nodes of the Managed Database instance.
*
* - - -
*/
type: pulumi.Input<string>;
/**
* Configuration settings for automated patch update maintenance for the Managed Database.
*/
updates?: pulumi.Input<inputs.DatabasePostgresqlUpdates>;
}