@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
234 lines (233 loc) • 11.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an RDS instance restore resource within HuaweiCloud.
*
* ## Example Usage
* ### restore by backupId
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const targetInstanceId = config.requireObject("targetInstanceId");
* const sourceInstanceId = config.requireObject("sourceInstanceId");
* const backupId = config.requireObject("backupId");
* const test = new huaweicloud.rds.Restore("test", {
* targetInstanceId: targetInstanceId,
* sourceInstanceId: sourceInstanceId,
* type: "backup",
* backupId: backupId,
* });
* ```
* ### restore by timestamp
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const targetInstanceId = config.requireObject("targetInstanceId");
* const sourceInstanceId = config.requireObject("sourceInstanceId");
* const test = new huaweicloud.rds.Restore("test", {
* targetInstanceId: targetInstanceId,
* sourceInstanceId: sourceInstanceId,
* type: "timestamp",
* restoreTime: 1673852043000,
* });
* ```
*/
export declare class Restore extends pulumi.CustomResource {
/**
* Get an existing Restore 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?: RestoreState, opts?: pulumi.CustomResourceOptions): Restore;
/**
* Returns true if the given object is an instance of Restore. 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 Restore;
/**
* Specifies the ID of the backup to be restored. This parameter must be
* specified when `type` is set to **backup** or left empty.
*/
readonly backupId: pulumi.Output<string | undefined>;
/**
* Specifies the databases that will be restored. This parameter applies only
* to the SQL Server DB engine. The key is the old database name, the value is the new database name. If this parameter is
* specified, you can restore all or specific databases and rename new databases. If this parameter is not specified, all
* databases are restored by default. You can enter multiple new database names and separate them with commas (,). The new
* database names can contain but cannot be the same as the original database names. Note the following when you are
* specifying new database names:
* + New database names must be different from the original database names. If they are left blank, the original database
* names will be used for restoration by default.
* + The case-sensitivity settings of the new databases are the same as those of the original databases. Make sure the new
* database names are unique.
* + The total number of new and existing databases on the existing or original DB instances where data is restored cannot
* exceed the database quota specified by **rds_databases_quota**.
* + New database names cannot contain the following fields (case-insensitive): **rdsadmin**, **master**, **msdb**,
* **tempdb**, **model** and **resource**.
* + New database names must consist of `1` to `64` characters, including only letters, digits, underscores (_), and
* hyphens (-). If you want to restore data to multiple new databases, separate them with commas (,).
* + New database names must be different from any database names on the original DB instance.
* + New database names must be different from any database names on the existing or original DB instances where data is
* restored.
*/
readonly databaseName: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The region in which to create the rds instance resource. If omitted, the
* provider-level region will be used. Changing this creates a new resource.
*/
readonly region: pulumi.Output<string | undefined>;
/**
* Specifies the time point of data restoration in the UNIX timestamp format.
* The unit is millisecond and the time zone is UTC. This parameter must be specified when `type` is set to **timestamp**.
*/
readonly restoreTime: pulumi.Output<number | undefined>;
/**
* Specifies the source instance ID.
*/
readonly sourceInstanceId: pulumi.Output<string>;
/**
* Specifies the target instance ID.
*/
readonly targetInstanceId: pulumi.Output<string>;
/**
* Specifies the restoration type. Value options:
* + **backup**: indicates using backup files for restoration.
* + **timestamp**: indicates the point-in-time restoration mode.
*/
readonly type: pulumi.Output<string | undefined>;
/**
* Create a Restore 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: RestoreArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Restore resources.
*/
export interface RestoreState {
/**
* Specifies the ID of the backup to be restored. This parameter must be
* specified when `type` is set to **backup** or left empty.
*/
backupId?: pulumi.Input<string>;
/**
* Specifies the databases that will be restored. This parameter applies only
* to the SQL Server DB engine. The key is the old database name, the value is the new database name. If this parameter is
* specified, you can restore all or specific databases and rename new databases. If this parameter is not specified, all
* databases are restored by default. You can enter multiple new database names and separate them with commas (,). The new
* database names can contain but cannot be the same as the original database names. Note the following when you are
* specifying new database names:
* + New database names must be different from the original database names. If they are left blank, the original database
* names will be used for restoration by default.
* + The case-sensitivity settings of the new databases are the same as those of the original databases. Make sure the new
* database names are unique.
* + The total number of new and existing databases on the existing or original DB instances where data is restored cannot
* exceed the database quota specified by **rds_databases_quota**.
* + New database names cannot contain the following fields (case-insensitive): **rdsadmin**, **master**, **msdb**,
* **tempdb**, **model** and **resource**.
* + New database names must consist of `1` to `64` characters, including only letters, digits, underscores (_), and
* hyphens (-). If you want to restore data to multiple new databases, separate them with commas (,).
* + New database names must be different from any database names on the original DB instance.
* + New database names must be different from any database names on the existing or original DB instances where data is
* restored.
*/
databaseName?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The region in which to create the rds instance resource. If omitted, the
* provider-level region will be used. Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the time point of data restoration in the UNIX timestamp format.
* The unit is millisecond and the time zone is UTC. This parameter must be specified when `type` is set to **timestamp**.
*/
restoreTime?: pulumi.Input<number>;
/**
* Specifies the source instance ID.
*/
sourceInstanceId?: pulumi.Input<string>;
/**
* Specifies the target instance ID.
*/
targetInstanceId?: pulumi.Input<string>;
/**
* Specifies the restoration type. Value options:
* + **backup**: indicates using backup files for restoration.
* + **timestamp**: indicates the point-in-time restoration mode.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Restore resource.
*/
export interface RestoreArgs {
/**
* Specifies the ID of the backup to be restored. This parameter must be
* specified when `type` is set to **backup** or left empty.
*/
backupId?: pulumi.Input<string>;
/**
* Specifies the databases that will be restored. This parameter applies only
* to the SQL Server DB engine. The key is the old database name, the value is the new database name. If this parameter is
* specified, you can restore all or specific databases and rename new databases. If this parameter is not specified, all
* databases are restored by default. You can enter multiple new database names and separate them with commas (,). The new
* database names can contain but cannot be the same as the original database names. Note the following when you are
* specifying new database names:
* + New database names must be different from the original database names. If they are left blank, the original database
* names will be used for restoration by default.
* + The case-sensitivity settings of the new databases are the same as those of the original databases. Make sure the new
* database names are unique.
* + The total number of new and existing databases on the existing or original DB instances where data is restored cannot
* exceed the database quota specified by **rds_databases_quota**.
* + New database names cannot contain the following fields (case-insensitive): **rdsadmin**, **master**, **msdb**,
* **tempdb**, **model** and **resource**.
* + New database names must consist of `1` to `64` characters, including only letters, digits, underscores (_), and
* hyphens (-). If you want to restore data to multiple new databases, separate them with commas (,).
* + New database names must be different from any database names on the original DB instance.
* + New database names must be different from any database names on the existing or original DB instances where data is
* restored.
*/
databaseName?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The region in which to create the rds instance resource. If omitted, the
* provider-level region will be used. Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the time point of data restoration in the UNIX timestamp format.
* The unit is millisecond and the time zone is UTC. This parameter must be specified when `type` is set to **timestamp**.
*/
restoreTime?: pulumi.Input<number>;
/**
* Specifies the source instance ID.
*/
sourceInstanceId: pulumi.Input<string>;
/**
* Specifies the target instance ID.
*/
targetInstanceId: pulumi.Input<string>;
/**
* Specifies the restoration type. Value options:
* + **backup**: indicates using backup files for restoration.
* + **timestamp**: indicates the point-in-time restoration mode.
*/
type?: pulumi.Input<string>;
}