UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

94 lines 4.53 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.SqlserverDatabaseCopy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an RDS database copy resource within HuaweiCloud. * * > **NOTE:** Deleting RDS SQLServer database copy is not supported. If you destroy a resource of RDS SQLServer database * copy, it is only removed from the state, but still remains in the cloud. And the instance doesn't return to the state * before modifying. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const instanceId = config.requireObject("instanceId"); * const test = new huaweicloud.rds.SqlserverDatabaseCopy("test", { * instanceId: instanceId, * procedureName: "copy_database", * dbNameSource: "test_db_source", * dbNameTarget: "test_db_target", * }); * ``` */ class SqlserverDatabaseCopy extends pulumi.CustomResource { /** * Get an existing SqlserverDatabaseCopy 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) { return new SqlserverDatabaseCopy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SqlserverDatabaseCopy. 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'] === SqlserverDatabaseCopy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["dbNameSource"] = state ? state.dbNameSource : undefined; resourceInputs["dbNameTarget"] = state ? state.dbNameTarget : undefined; resourceInputs["enableForceNew"] = state ? state.enableForceNew : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["procedureName"] = state ? state.procedureName : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; if ((!args || args.dbNameSource === undefined) && !opts.urn) { throw new Error("Missing required property 'dbNameSource'"); } if ((!args || args.dbNameTarget === undefined) && !opts.urn) { throw new Error("Missing required property 'dbNameTarget'"); } if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.procedureName === undefined) && !opts.urn) { throw new Error("Missing required property 'procedureName'"); } resourceInputs["dbNameSource"] = args ? args.dbNameSource : undefined; resourceInputs["dbNameTarget"] = args ? args.dbNameTarget : undefined; resourceInputs["enableForceNew"] = args ? args.enableForceNew : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["procedureName"] = args ? args.procedureName : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SqlserverDatabaseCopy.__pulumiType, name, resourceInputs, opts); } } exports.SqlserverDatabaseCopy = SqlserverDatabaseCopy; /** @internal */ SqlserverDatabaseCopy.__pulumiType = 'huaweicloud:Rds/sqlserverDatabaseCopy:SqlserverDatabaseCopy'; //# sourceMappingURL=sqlserverDatabaseCopy.js.map