UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

203 lines (202 loc) 7.15 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages Read Replicas. * For more information refer to the [API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const instance = new scaleway.databases.Instance("instance", { * name: "test-rdb-rr-update", * nodeType: "db-dev-s", * engine: "PostgreSQL-14", * isHaCluster: false, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * tags: [ * "terraform-test", * "scaleway_rdb_read_replica", * "minimal", * ], * }); * const replica = new scaleway.databases.ReadReplica("replica", { * instanceId: instance.id, * directAccess: {}, * }); * ``` * * ### Private network with static endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const instance = new scaleway.databases.Instance("instance", { * name: "rdb_instance", * nodeType: "db-dev-s", * engine: "PostgreSQL-14", * isHaCluster: false, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * }); * const pn = new scaleway.network.PrivateNetwork("pn", {}); * const replica = new scaleway.databases.ReadReplica("replica", { * instanceId: instance.id, * privateNetwork: { * privateNetworkId: pn.id, * serviceIp: "192.168.1.254/24", * }, * }); * ``` * * ### Private network with IPAM * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const instance = new scaleway.databases.Instance("instance", { * name: "rdb_instance", * nodeType: "db-dev-s", * engine: "PostgreSQL-14", * isHaCluster: false, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * }); * const pn = new scaleway.network.PrivateNetwork("pn", {}); * const replica = new scaleway.databases.ReadReplica("replica", { * instanceId: instance.id, * privateNetwork: { * privateNetworkId: pn.id, * enableIpam: true, * }, * }); * ``` * * ## Import * * Read Replicas can be imported using the `{region}/{id}`, e.g. * * bash * * ```sh * $ pulumi import scaleway:index/databaseReadReplica:DatabaseReadReplica rr fr-par/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/databasereadreplica.DatabaseReadReplica has been deprecated in favor of scaleway.databases/readreplica.ReadReplica */ export declare class DatabaseReadReplica extends pulumi.CustomResource { /** * Get an existing DatabaseReadReplica 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?: DatabaseReadReplicaState, opts?: pulumi.CustomResourceOptions): DatabaseReadReplica; /** * Returns true if the given object is an instance of DatabaseReadReplica. 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 DatabaseReadReplica; /** * Creates a direct access endpoint to rdb replica. */ readonly directAccess: pulumi.Output<outputs.DatabaseReadReplicaDirectAccess | undefined>; /** * UUID of the rdb instance. * * > **Important:** The replica musts contains at least one `directAccess` or `privateNetwork`. It can contain both. */ readonly instanceId: pulumi.Output<string>; /** * Create an endpoint in a Private Netork. */ readonly privateNetwork: pulumi.Output<outputs.DatabaseReadReplicaPrivateNetwork | undefined>; /** * `region`) The region * in which the Read Replica should be created. */ readonly region: pulumi.Output<string>; /** * Defines whether to create the replica in the same availability zone as the main instance nodes or not. */ readonly sameZone: pulumi.Output<boolean | undefined>; /** * Create a DatabaseReadReplica 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. */ /** @deprecated scaleway.index/databasereadreplica.DatabaseReadReplica has been deprecated in favor of scaleway.databases/readreplica.ReadReplica */ constructor(name: string, args: DatabaseReadReplicaArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatabaseReadReplica resources. */ export interface DatabaseReadReplicaState { /** * Creates a direct access endpoint to rdb replica. */ directAccess?: pulumi.Input<inputs.DatabaseReadReplicaDirectAccess>; /** * UUID of the rdb instance. * * > **Important:** The replica musts contains at least one `directAccess` or `privateNetwork`. It can contain both. */ instanceId?: pulumi.Input<string>; /** * Create an endpoint in a Private Netork. */ privateNetwork?: pulumi.Input<inputs.DatabaseReadReplicaPrivateNetwork>; /** * `region`) The region * in which the Read Replica should be created. */ region?: pulumi.Input<string>; /** * Defines whether to create the replica in the same availability zone as the main instance nodes or not. */ sameZone?: pulumi.Input<boolean>; } /** * The set of arguments for constructing a DatabaseReadReplica resource. */ export interface DatabaseReadReplicaArgs { /** * Creates a direct access endpoint to rdb replica. */ directAccess?: pulumi.Input<inputs.DatabaseReadReplicaDirectAccess>; /** * UUID of the rdb instance. * * > **Important:** The replica musts contains at least one `directAccess` or `privateNetwork`. It can contain both. */ instanceId: pulumi.Input<string>; /** * Create an endpoint in a Private Netork. */ privateNetwork?: pulumi.Input<inputs.DatabaseReadReplicaPrivateNetwork>; /** * `region`) The region * in which the Read Replica should be created. */ region?: pulumi.Input<string>; /** * Defines whether to create the replica in the same availability zone as the main instance nodes or not. */ sameZone?: pulumi.Input<boolean>; }