import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * ## Example Usage * * Minimum settings for each engine (region choice is up to the user): * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ovh from "@ovhcloud/pulumi-ovh"; * * const cassandradb = new ovh.cloudproject.Database("cassandradb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-cassandra", * engine: "cassandra", * version: "4.0", * plan: "essential", * nodes: [ * { * region: "BHS", * }, * { * region: "BHS", * }, * { * region: "BHS", * }, * ], * flavor: "db1-4", * }); * const kafkadb = new ovh.cloudproject.Database("kafkadb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-kafka", * engine: "kafka", * version: "3.8", * flavor: "db1-4", * plan: "business", * kafkaRestApi: true, * kafkaSchemaRegistry: true, * nodes: [ * { * region: "DE", * }, * { * region: "DE", * }, * { * region: "DE", * }, * ], * }); * const m3db = new ovh.cloudproject.Database("m3db", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-m3db", * engine: "m3db", * version: "1.2", * plan: "essential", * nodes: [{ * region: "BHS", * }], * flavor: "db1-7", * }); * const mongodb = new ovh.cloudproject.Database("mongodb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-mongodb", * engine: "mongodb", * version: "5.0", * plan: "discovery", * nodes: [{ * region: "GRA", * }], * flavor: "db1-2", * }); * const mysqldb = new ovh.cloudproject.Database("mysqldb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-mysql", * engine: "mysql", * version: "8", * plan: "essential", * nodes: [{ * region: "SBG", * }], * flavor: "db1-4", * advancedConfiguration: { * "mysql.sql_mode": "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES", * "mysql.sql_require_primary_key": "true", * }, * }); * const opensearchdb = new ovh.cloudproject.Database("opensearchdb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-opensearch", * engine: "opensearch", * version: "1", * plan: "essential", * opensearchAclsEnabled: true, * nodes: [{ * region: "UK", * }], * flavor: "db1-4", * }); * const pgsqldb = new ovh.cloudproject.Database("pgsqldb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-postgresql", * engine: "postgresql", * version: "14", * plan: "essential", * nodes: [{ * region: "WAW", * }], * flavor: "db1-4", * ipRestrictions: [ * { * description: "ip 1", * ip: "178.97.6.0/24", * }, * { * description: "ip 2", * ip: "178.97.7.0/24", * }, * ], * }); * const redisdb = new ovh.cloudproject.Database("redisdb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-redis", * engine: "redis", * version: "6.2", * plan: "essential", * nodes: [{ * region: "BHS", * }], * flavor: "db1-4", * }); * const grafana = new ovh.cloudproject.Database("grafana", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-grafana", * engine: "grafana", * version: "9.1", * plan: "essential", * nodes: [{ * region: "GRA", * }], * flavor: "db1-4", * }); * const valkeydb = new ovh.cloudproject.Database("valkeydb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-valkey", * engine: "valkey", * version: "8.0", * plan: "essential", * nodes: [{ * region: "BHS", * }], * flavor: "db1-4", * }); * ``` * * To deploy a business PostgreSQL service with two nodes on public network: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ovh from "@ovhcloud/pulumi-ovh"; * * const postgresql = new ovh.cloudproject.Database("postgresql", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-postgresql", * engine: "postgresql", * version: "14", * plan: "business", * nodes: [ * { * region: "GRA", * }, * { * region: "GRA", * }, * ], * flavor: "db1-15", * }); * ``` * * To deploy an enterprise MongoDB service with three nodes on private network: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ovh from "@ovhcloud/pulumi-ovh"; * * const mongodb = new ovh.cloudproject.Database("mongodb", { * serviceName: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * description: "my-first-mongodb", * engine: "mongodb", * version: "5.0", * plan: "production", * nodes: [ * { * region: "SBG", * subnetId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * networkId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * }, * { * region: "SBG", * subnetId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * networkId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * }, * { * region: "SBG", * subnetId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * networkId: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", * }, * ], * flavor: "db1-30", * }); * ``` * * ## Import * * OVHcloud Managed database clusters can be imported using the `service_name`, `engine`, `id` of the cluster, separated by "/" E.g., * * bash * * ```sh * $ pulumi import ovh:CloudProject/database:Database my_database_cluster service_name/engine/id * ``` */ 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, 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; /** * Advanced configuration key / value. */ readonly advancedConfiguration: pulumi.Output<{ [key: string]: string; }>; /** * List of region where backups are pushed. Not more than 1 regions for MongoDB. Not more than 2 regions for the other engines with one being the same as the nodes[].region field */ readonly backupRegions: pulumi.Output; /** * Time on which backups start every day (this parameter is not usable on the following engines: "m3db", "grafana", "kafka", "kafkaconnect", "kafkamirrormaker", "opensearch", "m3aggregator"). */ readonly backupTime: pulumi.Output; /** * Date of the creation of the cluster. */ readonly createdAt: pulumi.Output; /** * Enable deletion protection */ readonly deletionProtection: pulumi.Output; /** * Small description of the database service. */ readonly description: pulumi.Output; /** * The disk size (in GB) of the database service. */ readonly diskSize: pulumi.Output; /** * Defines the disk type of the database service. */ readonly diskType: pulumi.Output; /** * List of all endpoints objects of the service. */ readonly endpoints: pulumi.Output; /** * The database engine you want to deploy. To get a full list of available engine visit. [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases). */ readonly engine: pulumi.Output; /** * A valid OVHcloud public cloud database flavor name in which the nodes will be started. Ex: "db1-7". Changing this value upgrade the nodes with the new flavor. You can find the list of flavor names: https://www.ovhcloud.com/fr/public-cloud/prices/ */ readonly flavor: pulumi.Output; /** * IP Blocks authorized to access to the cluster. */ readonly ipRestrictions: pulumi.Output; /** * Defines whether the REST API is enabled on a kafka cluster */ readonly kafkaRestApi: pulumi.Output; /** * Defines whether the schema registry is enabled on a Kafka cluster */ readonly kafkaSchemaRegistry: pulumi.Output; /** * Time on which maintenances can start every day. */ readonly maintenanceTime: pulumi.Output; /** * Type of network of the cluster. */ readonly networkType: pulumi.Output; /** * List of nodes object. Multi region cluster are not yet available, all node should be identical. */ readonly nodes: pulumi.Output; /** * Defines whether the ACLs are enabled on an OpenSearch cluster */ readonly opensearchAclsEnabled: pulumi.Output; /** * Plan of the cluster. * * MongoDB: Enum: "discovery", "production", "advanced". * * Mysql, PosgreSQL, Cassandra, M3DB, : Enum: "essential", "business", "enterprise". * * M3 Aggregator: "business", "enterprise". * * Redis: "essential", "business". * * Valkey: "essential", "business". */ readonly plan: pulumi.Output; /** * The id of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ readonly serviceName: pulumi.Output; /** * Current status of the cluster. */ readonly status: pulumi.Output; /** * The version of the engine in which the service should be deployed */ readonly version: pulumi.Output; /** * 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 { /** * Advanced configuration key / value. */ advancedConfiguration?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * List of region where backups are pushed. Not more than 1 regions for MongoDB. Not more than 2 regions for the other engines with one being the same as the nodes[].region field */ backupRegions?: pulumi.Input[]>; /** * Time on which backups start every day (this parameter is not usable on the following engines: "m3db", "grafana", "kafka", "kafkaconnect", "kafkamirrormaker", "opensearch", "m3aggregator"). */ backupTime?: pulumi.Input; /** * Date of the creation of the cluster. */ createdAt?: pulumi.Input; /** * Enable deletion protection */ deletionProtection?: pulumi.Input; /** * Small description of the database service. */ description?: pulumi.Input; /** * The disk size (in GB) of the database service. */ diskSize?: pulumi.Input; /** * Defines the disk type of the database service. */ diskType?: pulumi.Input; /** * List of all endpoints objects of the service. */ endpoints?: pulumi.Input[]>; /** * The database engine you want to deploy. To get a full list of available engine visit. [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases). */ engine?: pulumi.Input; /** * A valid OVHcloud public cloud database flavor name in which the nodes will be started. Ex: "db1-7". Changing this value upgrade the nodes with the new flavor. You can find the list of flavor names: https://www.ovhcloud.com/fr/public-cloud/prices/ */ flavor?: pulumi.Input; /** * IP Blocks authorized to access to the cluster. */ ipRestrictions?: pulumi.Input[]>; /** * Defines whether the REST API is enabled on a kafka cluster */ kafkaRestApi?: pulumi.Input; /** * Defines whether the schema registry is enabled on a Kafka cluster */ kafkaSchemaRegistry?: pulumi.Input; /** * Time on which maintenances can start every day. */ maintenanceTime?: pulumi.Input; /** * Type of network of the cluster. */ networkType?: pulumi.Input; /** * List of nodes object. Multi region cluster are not yet available, all node should be identical. */ nodes?: pulumi.Input[]>; /** * Defines whether the ACLs are enabled on an OpenSearch cluster */ opensearchAclsEnabled?: pulumi.Input; /** * Plan of the cluster. * * MongoDB: Enum: "discovery", "production", "advanced". * * Mysql, PosgreSQL, Cassandra, M3DB, : Enum: "essential", "business", "enterprise". * * M3 Aggregator: "business", "enterprise". * * Redis: "essential", "business". * * Valkey: "essential", "business". */ plan?: pulumi.Input; /** * The id of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ serviceName?: pulumi.Input; /** * Current status of the cluster. */ status?: pulumi.Input; /** * The version of the engine in which the service should be deployed */ version?: pulumi.Input; } /** * The set of arguments for constructing a Database resource. */ export interface DatabaseArgs { /** * Advanced configuration key / value. */ advancedConfiguration?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * List of region where backups are pushed. Not more than 1 regions for MongoDB. Not more than 2 regions for the other engines with one being the same as the nodes[].region field */ backupRegions?: pulumi.Input[]>; /** * Time on which backups start every day (this parameter is not usable on the following engines: "m3db", "grafana", "kafka", "kafkaconnect", "kafkamirrormaker", "opensearch", "m3aggregator"). */ backupTime?: pulumi.Input; /** * Enable deletion protection */ deletionProtection?: pulumi.Input; /** * Small description of the database service. */ description?: pulumi.Input; /** * The disk size (in GB) of the database service. */ diskSize?: pulumi.Input; /** * The database engine you want to deploy. To get a full list of available engine visit. [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases). */ engine: pulumi.Input; /** * A valid OVHcloud public cloud database flavor name in which the nodes will be started. Ex: "db1-7". Changing this value upgrade the nodes with the new flavor. You can find the list of flavor names: https://www.ovhcloud.com/fr/public-cloud/prices/ */ flavor: pulumi.Input; /** * IP Blocks authorized to access to the cluster. */ ipRestrictions?: pulumi.Input[]>; /** * Defines whether the REST API is enabled on a kafka cluster */ kafkaRestApi?: pulumi.Input; /** * Defines whether the schema registry is enabled on a Kafka cluster */ kafkaSchemaRegistry?: pulumi.Input; /** * Time on which maintenances can start every day. */ maintenanceTime?: pulumi.Input; /** * List of nodes object. Multi region cluster are not yet available, all node should be identical. */ nodes: pulumi.Input[]>; /** * Defines whether the ACLs are enabled on an OpenSearch cluster */ opensearchAclsEnabled?: pulumi.Input; /** * Plan of the cluster. * * MongoDB: Enum: "discovery", "production", "advanced". * * Mysql, PosgreSQL, Cassandra, M3DB, : Enum: "essential", "business", "enterprise". * * M3 Aggregator: "business", "enterprise". * * Redis: "essential", "business". * * Valkey: "essential", "business". */ plan: pulumi.Input; /** * The id of the public cloud project. If omitted, the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. */ serviceName?: pulumi.Input; /** * The version of the engine in which the service should be deployed */ version: pulumi.Input; }