UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

230 lines (229 loc) 8.28 kB
import * as pulumi from "@pulumi/pulumi"; import * as enums from "./types/enums"; /** * Provides a DigitalOcean database replica resource. * * ## Example Usage * * ### Create a new PostgreSQL database replica * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", { * name: "example-postgres-cluster", * engine: "pg", * version: "15", * size: digitalocean.DatabaseSlug.DB_1VPCU1GB, * region: digitalocean.Region.NYC1, * nodeCount: 1, * }); * const replica_example = new digitalocean.DatabaseReplica("replica-example", { * clusterId: postgres_example.id, * name: "replica-example", * size: digitalocean.DatabaseSlug.DB_1VPCU1GB, * region: digitalocean.Region.NYC1, * }); * export const UUID = replica_example.uuid; * // Create firewall rule for database replica * const example_fw = new digitalocean.DatabaseFirewall("example-fw", { * clusterId: replica_example.uuid, * rules: [{ * type: "ip_addr", * value: "192.168.1.1", * }], * }); * ``` * * ## Import * * Database replicas can be imported using the `id` of the source database cluster * * and the `name` of the replica joined with a comma. For example: * * ```sh * $ pulumi import digitalocean:index/databaseReplica:DatabaseReplica read-replica 245bcfd0-7f31-4ce6-a2bc-475a116cca97,read-replica * ``` */ export declare class DatabaseReplica extends pulumi.CustomResource { /** * Get an existing DatabaseReplica 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?: DatabaseReplicaState, opts?: pulumi.CustomResourceOptions): DatabaseReplica; /** * Returns true if the given object is an instance of DatabaseReplica. 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 DatabaseReplica; /** * The ID of the original source database cluster. */ readonly clusterId: pulumi.Output<string>; /** * Name of the replica's default database. */ readonly database: pulumi.Output<string>; /** * Database replica's hostname. */ readonly host: pulumi.Output<string>; /** * The name for the database replica. */ readonly name: pulumi.Output<string>; /** * Password for the replica's default user. */ readonly password: pulumi.Output<string>; /** * Network port that the database replica is listening on. */ readonly port: pulumi.Output<number>; /** * Same as `host`, but only accessible from resources within the account and in the same region. */ readonly privateHost: pulumi.Output<string>; /** * The ID of the VPC where the database replica will be located. */ readonly privateNetworkUuid: pulumi.Output<string>; /** * Same as `uri`, but only accessible from resources within the account and in the same region. */ readonly privateUri: pulumi.Output<string>; /** * DigitalOcean region where the replica will reside. */ readonly region: pulumi.Output<string | undefined>; /** * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported. */ readonly size: pulumi.Output<string | undefined>; readonly storageSizeMib: pulumi.Output<string>; /** * A list of tag names to be applied to the database replica. */ readonly tags: pulumi.Output<string[] | undefined>; /** * The full URI for connecting to the database replica. */ readonly uri: pulumi.Output<string>; /** * Username for the replica's default user. */ readonly user: pulumi.Output<string>; /** * The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above. */ readonly uuid: pulumi.Output<string>; /** * Create a DatabaseReplica 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: DatabaseReplicaArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatabaseReplica resources. */ export interface DatabaseReplicaState { /** * The ID of the original source database cluster. */ clusterId?: pulumi.Input<string>; /** * Name of the replica's default database. */ database?: pulumi.Input<string>; /** * Database replica's hostname. */ host?: pulumi.Input<string>; /** * The name for the database replica. */ name?: pulumi.Input<string>; /** * Password for the replica's default user. */ password?: pulumi.Input<string>; /** * Network port that the database replica is listening on. */ port?: pulumi.Input<number>; /** * Same as `host`, but only accessible from resources within the account and in the same region. */ privateHost?: pulumi.Input<string>; /** * The ID of the VPC where the database replica will be located. */ privateNetworkUuid?: pulumi.Input<string>; /** * Same as `uri`, but only accessible from resources within the account and in the same region. */ privateUri?: pulumi.Input<string>; /** * DigitalOcean region where the replica will reside. */ region?: pulumi.Input<string | enums.Region>; /** * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported. */ size?: pulumi.Input<string | enums.DatabaseSlug>; storageSizeMib?: pulumi.Input<string>; /** * A list of tag names to be applied to the database replica. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * The full URI for connecting to the database replica. */ uri?: pulumi.Input<string>; /** * Username for the replica's default user. */ user?: pulumi.Input<string>; /** * The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above. */ uuid?: pulumi.Input<string>; } /** * The set of arguments for constructing a DatabaseReplica resource. */ export interface DatabaseReplicaArgs { /** * The ID of the original source database cluster. */ clusterId: pulumi.Input<string>; /** * The name for the database replica. */ name?: pulumi.Input<string>; /** * The ID of the VPC where the database replica will be located. */ privateNetworkUuid?: pulumi.Input<string>; /** * DigitalOcean region where the replica will reside. */ region?: pulumi.Input<string | enums.Region>; /** * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported. */ size?: pulumi.Input<string | enums.DatabaseSlug>; storageSizeMib?: pulumi.Input<string>; /** * A list of tag names to be applied to the database replica. */ tags?: pulumi.Input<pulumi.Input<string>[]>; }