UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

160 lines 6.64 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RdbSnapshot = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages Scaleway RDB (Relational Database) Snapshots. * Snapshots are point-in-time backups of a database instance that can be used for recovery or duplication. * For more information, refer to [the API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). * * ## Example Usage * * ### Example Basic Snapshot * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.databases.Instance("main", { * name: "test-rdb-instance", * nodeType: "db-dev-s", * engine: "PostgreSQL-15", * isHaCluster: false, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * tags: [ * "terraform-test", * "scaleway_rdb_instance", * "minimal", * ], * volumeType: "sbs_5k", * volumeSizeInGb: 10, * }); * const test = new scaleway.databases.Snapshot("test", { * name: "initial-snapshot", * instanceId: main.id, * }, { * dependsOn: [main], * }); * ``` * * ### Example with Expiration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const snapshotWithExpiration = new scaleway.databases.Snapshot("snapshot_with_expiration", { * name: "snapshot-with-expiration", * instanceId: main.id, * expiresAt: "2025-01-31T00:00:00Z", * }); * ``` * * ### Example with Multiple Snapshots * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const snapshotA = new scaleway.databases.Snapshot("snapshot_a", { * name: "snapshot_a", * instanceId: main.id, * }, { * dependsOn: [main], * }); * const snapshotB = new scaleway.databases.Snapshot("snapshot_b", { * name: "snapshot_b", * instanceId: main.id, * expiresAt: "2025-02-07T00:00:00Z", * }, { * dependsOn: [main], * }); * ``` * * ## Limitations * * - Snapshots are tied to the database instance and region where they are created. * - Expired snapshots are automatically deleted and cannot be restored. * * ## Notes * * - Ensure the `instanceId` corresponds to an existing database instance. * - Use the `dependsOn` argument when creating snapshots right after creating an instance to ensure proper dependency management. * * ## Import * * RDB Snapshots can be imported using the `{region}/{snapshot_id}` format. * * @deprecated scaleway.index/rdbsnapshot.RdbSnapshot has been deprecated in favor of scaleway.databases/snapshot.Snapshot */ class RdbSnapshot extends pulumi.CustomResource { /** * Get an existing RdbSnapshot 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, id, state, opts) { pulumi.log.warn("RdbSnapshot is deprecated: scaleway.index/rdbsnapshot.RdbSnapshot has been deprecated in favor of scaleway.databases/snapshot.Snapshot"); return new RdbSnapshot(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RdbSnapshot. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RdbSnapshot.__pulumiType; } /** @deprecated scaleway.index/rdbsnapshot.RdbSnapshot has been deprecated in favor of scaleway.databases/snapshot.Snapshot */ constructor(name, argsOrState, opts) { pulumi.log.warn("RdbSnapshot is deprecated: scaleway.index/rdbsnapshot.RdbSnapshot has been deprecated in favor of scaleway.databases/snapshot.Snapshot"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["expiresAt"] = state ? state.expiresAt : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeType"] = state ? state.nodeType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["volumeType"] = state ? state.volumeType : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } resourceInputs["expiresAt"] = args ? args.expiresAt : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["nodeType"] = undefined /*out*/; resourceInputs["size"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["volumeType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RdbSnapshot.__pulumiType, name, resourceInputs, opts); } } exports.RdbSnapshot = RdbSnapshot; /** @internal */ RdbSnapshot.__pulumiType = 'scaleway:index/rdbSnapshot:RdbSnapshot'; //# sourceMappingURL=rdbSnapshot.js.map