@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
476 lines (475 loc) • 18.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides a Vultr database resource. This can be used to create, read, modify, and delete managed databases on your Vultr account.
*
* ## Example Usage
*
* Create a new database:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myDatabase = new vultr.Database("myDatabase", {
* databaseEngine: "pg",
* databaseEngineVersion: "15",
* label: "my_database_label",
* plan: "vultr-dbaas-startup-cc-1-55-2",
* region: "ewr",
* });
* ```
*
* Create a new database with options:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myDatabase = new vultr.Database("myDatabase", {
* clusterTimeZone: "America/New_York",
* databaseEngine: "pg",
* databaseEngineVersion: "15",
* label: "my_database_label",
* maintenanceDow: "sunday",
* maintenanceTime: "01:00",
* plan: "vultr-dbaas-startup-cc-1-55-2",
* region: "ewr",
* tag: "some tag",
* });
* ```
*
* ## Import
*
* Database can be imported using the database `ID`, e.g.
*
* ```sh
* $ pulumi import vultr:index/database:Database my_database b6a859c5-b299-49dd-8888-b1abbc517d08
* ```
*/
export declare class Database extends pulumi.CustomResource {
/**
* Get an existing Database 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?: DatabaseState, opts?: pulumi.CustomResourceOptions): Database;
/**
* Returns true if the given object is an instance of Database. 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 Database;
/**
* The certificate to authenticate the default user (Kafka engine types only).
*/
readonly accessCert: pulumi.Output<string>;
/**
* The private key to authenticate the default user (Kafka engine types only).
*/
readonly accessKey: pulumi.Output<string>;
/**
* The configured time zone for the Managed Database in TZ database format (e.g. `UTC`, `America/New_York`, `Europe/London`).
*/
readonly clusterTimeZone: pulumi.Output<string>;
/**
* The database engine of the new managed database.
*/
readonly databaseEngine: pulumi.Output<string>;
/**
* The database engine version of the new managed database.
*/
readonly databaseEngineVersion: pulumi.Output<string>;
/**
* The date the managed database was added to your Vultr account.
*/
readonly dateCreated: pulumi.Output<string>;
/**
* The managed database's default logical database.
*/
readonly dbname: pulumi.Output<string>;
/**
* The configuration value for the data eviction policy on the managed database (Valkey engine types only - `noeviction`, `allkeys-lru`, `volatile-lru`, `allkeys-random`, `volatile-random`, `volatile-ttl`, `volatile-lfu`, `allkeys-lfu`).
*/
readonly evictionPolicy: pulumi.Output<string>;
/**
* An associated list of FerretDB connection credentials (FerretDB + PostgreSQL engine types only).
*/
readonly ferretdbCredentials: pulumi.Output<{
[key: string]: string;
}>;
/**
* The hostname assigned to the managed database.
*/
readonly host: pulumi.Output<string>;
/**
* A label for the managed database.
*/
readonly label: pulumi.Output<string>;
/**
* The date of the latest backup available on the managed database.
*/
readonly latestBackup: pulumi.Output<string>;
/**
* The preferred maintenance day of week for the managed database.
*/
readonly maintenanceDow: pulumi.Output<string>;
/**
* The preferred maintenance time for the managed database in 24-hour HH:00 format (e.g. `01:00`, `13:00`, `23:00`).
*/
readonly maintenanceTime: pulumi.Output<string>;
/**
* The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only).
*/
readonly mysqlLongQueryTime: pulumi.Output<number>;
/**
* The configuration value for whether primary keys are required on the managed database (MySQL engine types only).
*/
readonly mysqlRequirePrimaryKey: pulumi.Output<boolean | undefined>;
/**
* The configuration value for slow query logging on the managed database (MySQL engine types only).
*/
readonly mysqlSlowQueryLog: pulumi.Output<boolean>;
/**
* A list of SQL modes to configure for the managed database (MySQL engine types only - `ALLOW_INVALID_DATES`, `ANSI`, `ANSI_QUOTES`, `ERROR_FOR_DIVISION_BY_ZERO`, `HIGH_NOT_PRECEDENCE`, `IGNORE_SPACE`, `NO_AUTO_VALUE_ON_ZERO`, `NO_DIR_IN_CREATE`, `NO_ENGINE_SUBSTITUTION`, `NO_UNSIGNED_SUBTRACTION`, `NO_ZERO_DATE`, `NO_ZERO_IN_DATE`, `ONLY_FULL_GROUP_BY`, `PIPES_AS_CONCAT`, `REAL_AS_FLOAT`, `STRICT_ALL_TABLES`, `STRICT_TRANS_TABLES`, `TIME_TRUNCATE_FRACTIONAL`, `TRADITIONAL`).
*/
readonly mysqlSqlModes: pulumi.Output<string[] | undefined>;
/**
* The password for the managed database's primary admin user.
*/
readonly password: pulumi.Output<string>;
/**
* The ID of the plan that you want the managed database to subscribe to. [See List Managed Database Plans](https://www.vultr.com/api/#tag/managed-databases/operation/list-database-plans)
*/
readonly plan: pulumi.Output<string>;
/**
* The number of brokers available on the managed database (Kafka engine types only).
*/
readonly planBrokers: pulumi.Output<number>;
/**
* The description of the disk(s) on the managed database.
*/
readonly planDisk: pulumi.Output<number>;
/**
* The amount of memory available on the managed database in MB.
*/
readonly planRam: pulumi.Output<number>;
/**
* The number of standby nodes available on the managed database (excluded for Kafka engine types).
*/
readonly planReplicas: pulumi.Output<number>;
/**
* The number of virtual CPUs available on the managed database.
*/
readonly planVcpus: pulumi.Output<number>;
/**
* The connection port for the managed database.
*/
readonly port: pulumi.Output<string>;
/**
* The public hostname assigned to the managed database (VPC-attached only).
*/
readonly publicHost: pulumi.Output<string>;
/**
* A list of read replicas attached to the managed database.
*/
readonly readReplicas: pulumi.Output<outputs.DatabaseReadReplica[]>;
/**
* The ID of the region that the managed database is to be created in. [See List Regions](https://www.vultr.com/api/#operation/list-regions)
*/
readonly region: pulumi.Output<string>;
/**
* The SASL connection port for the managed database (Kafka engine types only).
*/
readonly saslPort: pulumi.Output<string>;
/**
* The current status of the managed database (poweroff, rebuilding, rebalancing, configuring, running).
*/
readonly status: pulumi.Output<string>;
/**
* The tag to assign to the managed database.
*/
readonly tag: pulumi.Output<string | undefined>;
/**
* A list of allowed IP addresses for the managed database.
*/
readonly trustedIps: pulumi.Output<string[] | undefined>;
/**
* The primary admin user for the managed database.
*/
readonly user: pulumi.Output<string>;
/**
* The ID of the VPC Network to attach to the Managed Database.
*/
readonly vpcId: pulumi.Output<string | undefined>;
/**
* Create a Database 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: DatabaseArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Database resources.
*/
export interface DatabaseState {
/**
* The certificate to authenticate the default user (Kafka engine types only).
*/
accessCert?: pulumi.Input<string>;
/**
* The private key to authenticate the default user (Kafka engine types only).
*/
accessKey?: pulumi.Input<string>;
/**
* The configured time zone for the Managed Database in TZ database format (e.g. `UTC`, `America/New_York`, `Europe/London`).
*/
clusterTimeZone?: pulumi.Input<string>;
/**
* The database engine of the new managed database.
*/
databaseEngine?: pulumi.Input<string>;
/**
* The database engine version of the new managed database.
*/
databaseEngineVersion?: pulumi.Input<string>;
/**
* The date the managed database was added to your Vultr account.
*/
dateCreated?: pulumi.Input<string>;
/**
* The managed database's default logical database.
*/
dbname?: pulumi.Input<string>;
/**
* The configuration value for the data eviction policy on the managed database (Valkey engine types only - `noeviction`, `allkeys-lru`, `volatile-lru`, `allkeys-random`, `volatile-random`, `volatile-ttl`, `volatile-lfu`, `allkeys-lfu`).
*/
evictionPolicy?: pulumi.Input<string>;
/**
* An associated list of FerretDB connection credentials (FerretDB + PostgreSQL engine types only).
*/
ferretdbCredentials?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The hostname assigned to the managed database.
*/
host?: pulumi.Input<string>;
/**
* A label for the managed database.
*/
label?: pulumi.Input<string>;
/**
* The date of the latest backup available on the managed database.
*/
latestBackup?: pulumi.Input<string>;
/**
* The preferred maintenance day of week for the managed database.
*/
maintenanceDow?: pulumi.Input<string>;
/**
* The preferred maintenance time for the managed database in 24-hour HH:00 format (e.g. `01:00`, `13:00`, `23:00`).
*/
maintenanceTime?: pulumi.Input<string>;
/**
* The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only).
*/
mysqlLongQueryTime?: pulumi.Input<number>;
/**
* The configuration value for whether primary keys are required on the managed database (MySQL engine types only).
*/
mysqlRequirePrimaryKey?: pulumi.Input<boolean>;
/**
* The configuration value for slow query logging on the managed database (MySQL engine types only).
*/
mysqlSlowQueryLog?: pulumi.Input<boolean>;
/**
* A list of SQL modes to configure for the managed database (MySQL engine types only - `ALLOW_INVALID_DATES`, `ANSI`, `ANSI_QUOTES`, `ERROR_FOR_DIVISION_BY_ZERO`, `HIGH_NOT_PRECEDENCE`, `IGNORE_SPACE`, `NO_AUTO_VALUE_ON_ZERO`, `NO_DIR_IN_CREATE`, `NO_ENGINE_SUBSTITUTION`, `NO_UNSIGNED_SUBTRACTION`, `NO_ZERO_DATE`, `NO_ZERO_IN_DATE`, `ONLY_FULL_GROUP_BY`, `PIPES_AS_CONCAT`, `REAL_AS_FLOAT`, `STRICT_ALL_TABLES`, `STRICT_TRANS_TABLES`, `TIME_TRUNCATE_FRACTIONAL`, `TRADITIONAL`).
*/
mysqlSqlModes?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The password for the managed database's primary admin user.
*/
password?: pulumi.Input<string>;
/**
* The ID of the plan that you want the managed database to subscribe to. [See List Managed Database Plans](https://www.vultr.com/api/#tag/managed-databases/operation/list-database-plans)
*/
plan?: pulumi.Input<string>;
/**
* The number of brokers available on the managed database (Kafka engine types only).
*/
planBrokers?: pulumi.Input<number>;
/**
* The description of the disk(s) on the managed database.
*/
planDisk?: pulumi.Input<number>;
/**
* The amount of memory available on the managed database in MB.
*/
planRam?: pulumi.Input<number>;
/**
* The number of standby nodes available on the managed database (excluded for Kafka engine types).
*/
planReplicas?: pulumi.Input<number>;
/**
* The number of virtual CPUs available on the managed database.
*/
planVcpus?: pulumi.Input<number>;
/**
* The connection port for the managed database.
*/
port?: pulumi.Input<string>;
/**
* The public hostname assigned to the managed database (VPC-attached only).
*/
publicHost?: pulumi.Input<string>;
/**
* A list of read replicas attached to the managed database.
*/
readReplicas?: pulumi.Input<pulumi.Input<inputs.DatabaseReadReplica>[]>;
/**
* The ID of the region that the managed database is to be created in. [See List Regions](https://www.vultr.com/api/#operation/list-regions)
*/
region?: pulumi.Input<string>;
/**
* The SASL connection port for the managed database (Kafka engine types only).
*/
saslPort?: pulumi.Input<string>;
/**
* The current status of the managed database (poweroff, rebuilding, rebalancing, configuring, running).
*/
status?: pulumi.Input<string>;
/**
* The tag to assign to the managed database.
*/
tag?: pulumi.Input<string>;
/**
* A list of allowed IP addresses for the managed database.
*/
trustedIps?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The primary admin user for the managed database.
*/
user?: pulumi.Input<string>;
/**
* The ID of the VPC Network to attach to the Managed Database.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Database resource.
*/
export interface DatabaseArgs {
/**
* The certificate to authenticate the default user (Kafka engine types only).
*/
accessCert?: pulumi.Input<string>;
/**
* The private key to authenticate the default user (Kafka engine types only).
*/
accessKey?: pulumi.Input<string>;
/**
* The configured time zone for the Managed Database in TZ database format (e.g. `UTC`, `America/New_York`, `Europe/London`).
*/
clusterTimeZone?: pulumi.Input<string>;
/**
* The database engine of the new managed database.
*/
databaseEngine: pulumi.Input<string>;
/**
* The database engine version of the new managed database.
*/
databaseEngineVersion: pulumi.Input<string>;
/**
* The configuration value for the data eviction policy on the managed database (Valkey engine types only - `noeviction`, `allkeys-lru`, `volatile-lru`, `allkeys-random`, `volatile-random`, `volatile-ttl`, `volatile-lfu`, `allkeys-lfu`).
*/
evictionPolicy?: pulumi.Input<string>;
/**
* An associated list of FerretDB connection credentials (FerretDB + PostgreSQL engine types only).
*/
ferretdbCredentials?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A label for the managed database.
*/
label: pulumi.Input<string>;
/**
* The preferred maintenance day of week for the managed database.
*/
maintenanceDow?: pulumi.Input<string>;
/**
* The preferred maintenance time for the managed database in 24-hour HH:00 format (e.g. `01:00`, `13:00`, `23:00`).
*/
maintenanceTime?: pulumi.Input<string>;
/**
* The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only).
*/
mysqlLongQueryTime?: pulumi.Input<number>;
/**
* The configuration value for whether primary keys are required on the managed database (MySQL engine types only).
*/
mysqlRequirePrimaryKey?: pulumi.Input<boolean>;
/**
* The configuration value for slow query logging on the managed database (MySQL engine types only).
*/
mysqlSlowQueryLog?: pulumi.Input<boolean>;
/**
* A list of SQL modes to configure for the managed database (MySQL engine types only - `ALLOW_INVALID_DATES`, `ANSI`, `ANSI_QUOTES`, `ERROR_FOR_DIVISION_BY_ZERO`, `HIGH_NOT_PRECEDENCE`, `IGNORE_SPACE`, `NO_AUTO_VALUE_ON_ZERO`, `NO_DIR_IN_CREATE`, `NO_ENGINE_SUBSTITUTION`, `NO_UNSIGNED_SUBTRACTION`, `NO_ZERO_DATE`, `NO_ZERO_IN_DATE`, `ONLY_FULL_GROUP_BY`, `PIPES_AS_CONCAT`, `REAL_AS_FLOAT`, `STRICT_ALL_TABLES`, `STRICT_TRANS_TABLES`, `TIME_TRUNCATE_FRACTIONAL`, `TRADITIONAL`).
*/
mysqlSqlModes?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The password for the managed database's primary admin user.
*/
password?: pulumi.Input<string>;
/**
* The ID of the plan that you want the managed database to subscribe to. [See List Managed Database Plans](https://www.vultr.com/api/#tag/managed-databases/operation/list-database-plans)
*/
plan: pulumi.Input<string>;
/**
* The number of brokers available on the managed database (Kafka engine types only).
*/
planBrokers?: pulumi.Input<number>;
/**
* The description of the disk(s) on the managed database.
*/
planDisk?: pulumi.Input<number>;
/**
* The number of standby nodes available on the managed database (excluded for Kafka engine types).
*/
planReplicas?: pulumi.Input<number>;
/**
* The public hostname assigned to the managed database (VPC-attached only).
*/
publicHost?: pulumi.Input<string>;
/**
* A list of read replicas attached to the managed database.
*/
readReplicas?: pulumi.Input<pulumi.Input<inputs.DatabaseReadReplica>[]>;
/**
* The ID of the region that the managed database is to be created in. [See List Regions](https://www.vultr.com/api/#operation/list-regions)
*/
region: pulumi.Input<string>;
/**
* The SASL connection port for the managed database (Kafka engine types only).
*/
saslPort?: pulumi.Input<string>;
/**
* The tag to assign to the managed database.
*/
tag?: pulumi.Input<string>;
/**
* A list of allowed IP addresses for the managed database.
*/
trustedIps?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the VPC Network to attach to the Managed Database.
*/
vpcId?: pulumi.Input<string>;
}