UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

165 lines (164 loc) 5.83 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a virtual resource that can be used to start an online migration * for a DigitalOcean managed database cluster. Migrating a cluster establishes a * connection with an existing cluster and replicates its contents to the target * cluster. If the existing database is continuously being written to, the migration * process will continue for up to two weeks unless it is manually stopped. * Online migration is only available for MySQL, PostgreSQL, Caching, and Valkey clusters. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const source = new digitalocean.DatabaseCluster("source", { * name: "st01", * engine: "mysql", * version: "8", * size: digitalocean.DatabaseSlug.DB_1VPCU1GB, * region: digitalocean.Region.NYC1, * nodeCount: 1, * tags: ["production"], * }); * const destination = new digitalocean.DatabaseCluster("destination", { * name: "dt01", * engine: "mysql", * version: "8", * size: digitalocean.DatabaseSlug.DB_1VPCU1GB, * region: digitalocean.Region.NYC1, * nodeCount: 1, * tags: ["production"], * }); * const sourceDb = new digitalocean.DatabaseDb("source_db", { * clusterId: source.id, * name: "terraform-db-om-source", * }); * const foobar = new digitalocean.DatabaseOnlineMigration("foobar", { * clusterId: destination.id, * source: { * host: source.host, * dbName: sourceDb.name, * port: source.port, * username: source.user, * password: source.password, * }, * }, { * dependsOn: [ * destination, * source, * sourceDb, * ], * }); * ``` * * ## Import * * A MySQL database cluster's online_migration can be imported using the `id` the parent cluster, e.g. * * ```sh * $ pulumi import digitalocean:index/databaseOnlineMigration:DatabaseOnlineMigration example 4b62829a-9c42-465b-aaa3-84051048e712 * ``` */ export declare class DatabaseOnlineMigration extends pulumi.CustomResource { /** * Get an existing DatabaseOnlineMigration 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?: DatabaseOnlineMigrationState, opts?: pulumi.CustomResourceOptions): DatabaseOnlineMigration; /** * Returns true if the given object is an instance of DatabaseOnlineMigration. 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 DatabaseOnlineMigration; /** * The ID of the target MySQL cluster. */ readonly clusterId: pulumi.Output<string>; /** * The date and time when the online migration was created */ readonly createdAt: pulumi.Output<string>; /** * When set to true, enables SSL encryption when connecting to the source database. */ readonly disableSsl: pulumi.Output<boolean | undefined>; /** * A list of databases that should be ignored during migration. */ readonly ignoreDbs: pulumi.Output<string[] | undefined>; /** * Configuration for migration */ readonly source: pulumi.Output<outputs.DatabaseOnlineMigrationSource>; /** * The status of the online migration */ readonly status: pulumi.Output<string>; /** * Create a DatabaseOnlineMigration 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: DatabaseOnlineMigrationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatabaseOnlineMigration resources. */ export interface DatabaseOnlineMigrationState { /** * The ID of the target MySQL cluster. */ clusterId?: pulumi.Input<string>; /** * The date and time when the online migration was created */ createdAt?: pulumi.Input<string>; /** * When set to true, enables SSL encryption when connecting to the source database. */ disableSsl?: pulumi.Input<boolean>; /** * A list of databases that should be ignored during migration. */ ignoreDbs?: pulumi.Input<pulumi.Input<string>[]>; /** * Configuration for migration */ source?: pulumi.Input<inputs.DatabaseOnlineMigrationSource>; /** * The status of the online migration */ status?: pulumi.Input<string>; } /** * The set of arguments for constructing a DatabaseOnlineMigration resource. */ export interface DatabaseOnlineMigrationArgs { /** * The ID of the target MySQL cluster. */ clusterId: pulumi.Input<string>; /** * When set to true, enables SSL encryption when connecting to the source database. */ disableSsl?: pulumi.Input<boolean>; /** * A list of databases that should be ignored during migration. */ ignoreDbs?: pulumi.Input<pulumi.Input<string>[]>; /** * Configuration for migration */ source: pulumi.Input<inputs.DatabaseOnlineMigrationSource>; }