import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages Scaleway Database Instances. * For more information, see refer to [the API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). * * ## Example Usage * * ### Example Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const main = new scaleway.RdbInstance("main", { * disableBackup: true, * encryptionAtRest: true, * engine: "PostgreSQL-15", * isHaCluster: true, * nodeType: "DB-DEV-S", * password: "thiZ_is_v&ry_s3cret", * userName: "my_initial_user", * }); * ``` * * ### Example Block Storage Low Latency * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const main = new scaleway.RdbInstance("main", { * disableBackup: true, * engine: "PostgreSQL-15", * isHaCluster: true, * nodeType: "db-play2-pico", * password: "thiZ_is_v&ry_s3cret", * userName: "my_initial_user", * volumeSizeInGb: 10, * volumeType: "sbs_15k", * }); * ``` * * ### Example with Settings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const main = new scaleway.RdbInstance("main", { * disableBackup: true, * engine: "MySQL-8", * initSettings: { * lower_case_table_names: "1", * }, * nodeType: "db-dev-s", * password: "thiZ_is_v&ry_s3cret", * settings: { * max_connections: "350", * }, * userName: "my_initial_user", * }); * ``` * * ### Example with backup schedule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const main = new scaleway.RdbInstance("main", { * backupScheduleFrequency: 24, * backupScheduleRetention: 7, * disableBackup: false, * engine: "PostgreSQL-15", * isHaCluster: true, * nodeType: "DB-DEV-S", * password: "thiZ_is_v&ry_s3cret", * userName: "my_initial_user", * }); * ``` * * ### Examples of endpoint configuration * * Database Instances can have a maximum of 1 public endpoint and 1 private endpoint. They can have both, or none. * * ### 1 static Private Network endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const pn = new scaleway.VpcPrivateNetwork("pn", {ipv4Subnet: { * subnet: "172.16.20.0/22", * }}); * const main = new scaleway.RdbInstance("main", { * nodeType: "db-dev-s", * engine: "PostgreSQL-15", * privateNetwork: { * pnId: pn.id, * ipNet: "172.16.20.4/22", * }, * }); * ``` * * ### 1 IPAM Private Network endpoint + 1 public endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const pn = new scaleway.VpcPrivateNetwork("pn", {}); * const main = new scaleway.RdbInstance("main", { * nodeType: "DB-DEV-S", * engine: "PostgreSQL-15", * privateNetwork: { * pnId: pn.id, * enableIpam: true, * }, * loadBalancers: [{}], * }); * ``` * * ### Default: 1 public endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@ediri/scaleway"; * * const main = new scaleway.RdbInstance("main", { * engine: "PostgreSQL-15", * nodeType: "db-dev-s", * }); * ``` * * > **Note** If nothing is defined, your Database Instance will have a default public load-balancer endpoint. * * ## Limitations * * The Managed Database product is only compliant with the Private Network in the default availability zone (AZ). * i.e. `fr-par-1`, `nl-ams-1`, `pl-waw-1`. To learn more, read our * section [How to connect a PostgreSQL and MySQL Database Instance to a Private Network](https://www.scaleway.com/en/docs/managed-databases/postgresql-and-mysql/how-to/connect-database-private-network/) * * ## Import * * Database Instance can be imported using the `{region}/{id}`, e.g. * * bash * * ```sh * $ pulumi import scaleway:index/rdbInstance:RdbInstance rdb01 fr-par/11111111-1111-1111-1111-111111111111 * ``` */ export declare class RdbInstance extends pulumi.CustomResource { /** * Get an existing RdbInstance 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?: RdbInstanceState, opts?: pulumi.CustomResourceOptions): RdbInstance; /** * Returns true if the given object is an instance of RdbInstance. 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 RdbInstance; /** * Boolean to store logical backups in the same region as the database instance */ readonly backupSameRegion: pulumi.Output; /** * Backup schedule frequency in hours */ readonly backupScheduleFrequency: pulumi.Output; /** * Backup schedule retention in days */ readonly backupScheduleRetention: pulumi.Output; /** * Certificate of the Database Instance. */ readonly certificate: pulumi.Output; /** * Disable automated backup for the database instance */ readonly disableBackup: pulumi.Output; /** * Enable or disable encryption at rest for the Database Instance. */ readonly encryptionAtRest: pulumi.Output; /** * (Deprecated) The IP of the Database Instance. Please use the privateNetwork or the loadBalancer attribute. * * @deprecated Please use the privateNetwork or the loadBalancer attribute */ readonly endpointIp: pulumi.Output; /** * (Deprecated) The port of the Database Instance. Please use the privateNetwork or the loadBalancer attribute. * * @deprecated Please use the privateNetwork or the loadBalancer attribute */ readonly endpointPort: pulumi.Output; /** * Database Instance's engine version (e.g. `PostgreSQL-11`). * * > **Important** Updates to `engine` will recreate the Database Instance. */ readonly engine: pulumi.Output; /** * Map of engine settings to be set at database initialisation. */ readonly initSettings: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Enable or disable high availability for the Database Instance. * * > **Important** Updates to `isHaCluster` will recreate the Database Instance. */ readonly isHaCluster: pulumi.Output; /** * List of Load Balancer endpoints of the Database Instance. */ readonly loadBalancers: pulumi.Output; /** * Logs policy configuration */ readonly logsPolicy: pulumi.Output; /** * The name of the Database Instance. */ readonly name: pulumi.Output; /** * The type of Database Instance you want to create (e.g. `db-dev-s`). * * > **Important** Updates to `nodeType` will upgrade the Database Instance to the desired `nodeType` without any * interruption. * * > **Important** Once your Database Instance reaches `diskFull` status, if you are using `lssd` storage, you should upgrade the `nodeType`, and if you are using `bssd` storage, you should increase the volume size before making any other changes to your Database Instance. */ readonly nodeType: pulumi.Output; /** * The organization ID the Database Instance is associated with. */ readonly organizationId: pulumi.Output; /** * Password for the first user of the Database Instance. */ readonly password: pulumi.Output; /** * List of Private Networks endpoints of the Database Instance. */ readonly privateNetwork: pulumi.Output; /** * `projectId`) The ID of the project the Database * Instance is associated with. */ readonly projectId: pulumi.Output; /** * List of read replicas of the Database Instance. */ readonly readReplicas: pulumi.Output; /** * `region`) The region * in which the Database Instance should be created. */ readonly region: pulumi.Output; /** * Map of engine settings to be set on a running instance. */ readonly settings: pulumi.Output<{ [key: string]: string; }>; /** * The tags associated with the Database Instance. */ readonly tags: pulumi.Output; /** * Identifier for the first user of the Database Instance. * * > **Important** Updates to `userName` will recreate the Database Instance. */ readonly userName: pulumi.Output; /** * Volume size (in GB). Cannot be used when `volumeType` is set to `lssd`. * * > **Important** Once your Database Instance reaches `diskFull` status, you should increase the volume size before making any other change to your Database Instance. */ readonly volumeSizeInGb: pulumi.Output; /** * Type of volume where data are stored (`bssd`, `lssd`, `sbs5k` or `sbs15k`). */ readonly volumeType: pulumi.Output; /** * Create a RdbInstance 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: RdbInstanceArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RdbInstance resources. */ export interface RdbInstanceState { /** * Boolean to store logical backups in the same region as the database instance */ backupSameRegion?: pulumi.Input; /** * Backup schedule frequency in hours */ backupScheduleFrequency?: pulumi.Input; /** * Backup schedule retention in days */ backupScheduleRetention?: pulumi.Input; /** * Certificate of the Database Instance. */ certificate?: pulumi.Input; /** * Disable automated backup for the database instance */ disableBackup?: pulumi.Input; /** * Enable or disable encryption at rest for the Database Instance. */ encryptionAtRest?: pulumi.Input; /** * (Deprecated) The IP of the Database Instance. Please use the privateNetwork or the loadBalancer attribute. * * @deprecated Please use the privateNetwork or the loadBalancer attribute */ endpointIp?: pulumi.Input; /** * (Deprecated) The port of the Database Instance. Please use the privateNetwork or the loadBalancer attribute. * * @deprecated Please use the privateNetwork or the loadBalancer attribute */ endpointPort?: pulumi.Input; /** * Database Instance's engine version (e.g. `PostgreSQL-11`). * * > **Important** Updates to `engine` will recreate the Database Instance. */ engine?: pulumi.Input; /** * Map of engine settings to be set at database initialisation. */ initSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Enable or disable high availability for the Database Instance. * * > **Important** Updates to `isHaCluster` will recreate the Database Instance. */ isHaCluster?: pulumi.Input; /** * List of Load Balancer endpoints of the Database Instance. */ loadBalancers?: pulumi.Input[]>; /** * Logs policy configuration */ logsPolicy?: pulumi.Input; /** * The name of the Database Instance. */ name?: pulumi.Input; /** * The type of Database Instance you want to create (e.g. `db-dev-s`). * * > **Important** Updates to `nodeType` will upgrade the Database Instance to the desired `nodeType` without any * interruption. * * > **Important** Once your Database Instance reaches `diskFull` status, if you are using `lssd` storage, you should upgrade the `nodeType`, and if you are using `bssd` storage, you should increase the volume size before making any other changes to your Database Instance. */ nodeType?: pulumi.Input; /** * The organization ID the Database Instance is associated with. */ organizationId?: pulumi.Input; /** * Password for the first user of the Database Instance. */ password?: pulumi.Input; /** * List of Private Networks endpoints of the Database Instance. */ privateNetwork?: pulumi.Input; /** * `projectId`) The ID of the project the Database * Instance is associated with. */ projectId?: pulumi.Input; /** * List of read replicas of the Database Instance. */ readReplicas?: pulumi.Input[]>; /** * `region`) The region * in which the Database Instance should be created. */ region?: pulumi.Input; /** * Map of engine settings to be set on a running instance. */ settings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The tags associated with the Database Instance. */ tags?: pulumi.Input[]>; /** * Identifier for the first user of the Database Instance. * * > **Important** Updates to `userName` will recreate the Database Instance. */ userName?: pulumi.Input; /** * Volume size (in GB). Cannot be used when `volumeType` is set to `lssd`. * * > **Important** Once your Database Instance reaches `diskFull` status, you should increase the volume size before making any other change to your Database Instance. */ volumeSizeInGb?: pulumi.Input; /** * Type of volume where data are stored (`bssd`, `lssd`, `sbs5k` or `sbs15k`). */ volumeType?: pulumi.Input; } /** * The set of arguments for constructing a RdbInstance resource. */ export interface RdbInstanceArgs { /** * Boolean to store logical backups in the same region as the database instance */ backupSameRegion?: pulumi.Input; /** * Backup schedule frequency in hours */ backupScheduleFrequency?: pulumi.Input; /** * Backup schedule retention in days */ backupScheduleRetention?: pulumi.Input; /** * Disable automated backup for the database instance */ disableBackup?: pulumi.Input; /** * Enable or disable encryption at rest for the Database Instance. */ encryptionAtRest?: pulumi.Input; /** * Database Instance's engine version (e.g. `PostgreSQL-11`). * * > **Important** Updates to `engine` will recreate the Database Instance. */ engine: pulumi.Input; /** * Map of engine settings to be set at database initialisation. */ initSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Enable or disable high availability for the Database Instance. * * > **Important** Updates to `isHaCluster` will recreate the Database Instance. */ isHaCluster?: pulumi.Input; /** * List of Load Balancer endpoints of the Database Instance. */ loadBalancers?: pulumi.Input[]>; /** * Logs policy configuration */ logsPolicy?: pulumi.Input; /** * The name of the Database Instance. */ name?: pulumi.Input; /** * The type of Database Instance you want to create (e.g. `db-dev-s`). * * > **Important** Updates to `nodeType` will upgrade the Database Instance to the desired `nodeType` without any * interruption. * * > **Important** Once your Database Instance reaches `diskFull` status, if you are using `lssd` storage, you should upgrade the `nodeType`, and if you are using `bssd` storage, you should increase the volume size before making any other changes to your Database Instance. */ nodeType: pulumi.Input; /** * Password for the first user of the Database Instance. */ password?: pulumi.Input; /** * List of Private Networks endpoints of the Database Instance. */ privateNetwork?: pulumi.Input; /** * `projectId`) The ID of the project the Database * Instance is associated with. */ projectId?: pulumi.Input; /** * `region`) The region * in which the Database Instance should be created. */ region?: pulumi.Input; /** * Map of engine settings to be set on a running instance. */ settings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The tags associated with the Database Instance. */ tags?: pulumi.Input[]>; /** * Identifier for the first user of the Database Instance. * * > **Important** Updates to `userName` will recreate the Database Instance. */ userName?: pulumi.Input; /** * Volume size (in GB). Cannot be used when `volumeType` is set to `lssd`. * * > **Important** Once your Database Instance reaches `diskFull` status, you should increase the volume size before making any other change to your Database Instance. */ volumeSizeInGb?: pulumi.Input; /** * Type of volume where data are stored (`bssd`, `lssd`, `sbs5k` or `sbs15k`). */ volumeType?: pulumi.Input; }