UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

171 lines (170 loc) 6.05 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages Scaleway Database read replicas. * For more information, see [the documentation](https://developers.scaleway.com/en/products/rdb/api). * * ## Examples * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const instance = new scaleway.DatabaseInstance("instance", { * 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.DatabaseReadReplica("replica", { * instanceId: instance.id, * directAccess: {}, * }); * ``` * * ### Private network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const instance = new scaleway.DatabaseInstance("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.VpcPrivateNetwork("pn", {}); * const replica = new scaleway.DatabaseReadReplica("replica", { * instanceId: instance.id, * privateNetwork: { * privateNetworkId: pn.id, * serviceIp: "192.168.1.254/24", * }, * }); * ``` * * ## Import * * Database Read replica 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 * ``` */ 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 of `directAccess` or `privateNetwork`. It can contain both. */ readonly instanceId: pulumi.Output<string>; /** * Create an endpoint in a private network. */ readonly privateNetwork: pulumi.Output<outputs.DatabaseReadReplicaPrivateNetwork | undefined>; /** * `region`) The region * in which the Database 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. */ 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 of `directAccess` or `privateNetwork`. It can contain both. */ instanceId?: pulumi.Input<string>; /** * Create an endpoint in a private network. */ privateNetwork?: pulumi.Input<inputs.DatabaseReadReplicaPrivateNetwork>; /** * `region`) The region * in which the Database 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 of `directAccess` or `privateNetwork`. It can contain both. */ instanceId: pulumi.Input<string>; /** * Create an endpoint in a private network. */ privateNetwork?: pulumi.Input<inputs.DatabaseReadReplicaPrivateNetwork>; /** * `region`) The region * in which the Database 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>; }