|
| 1 | +--- |
| 2 | +subcategory: "Relational Database Service (RDS)" |
| 3 | +layout: "huaweicloud" |
| 4 | +page_title: "HuaweiCloud: huaweicloud_rds_restore" |
| 5 | +description: |- |
| 6 | + Manages an RDS instance restore resource within HuaweiCloud. |
| 7 | +--- |
| 8 | + |
| 9 | +# huaweicloud_rds_restore |
| 10 | + |
| 11 | +Manages an RDS instance restore resource within HuaweiCloud. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +### restore by backup_id |
| 16 | + |
| 17 | +```hcl |
| 18 | +variable "target_instance_id" {} |
| 19 | +variable "source_instance_id" {} |
| 20 | +variable "backup_id" {} |
| 21 | +
|
| 22 | +resource "huaweicloud_rds_restore" "test" { |
| 23 | + target_instance_id = var.target_instance_id |
| 24 | + source_instance_id = var.source_instance_id |
| 25 | + type = "backup" |
| 26 | + backup_id = var.backup_id |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +### restore by timestamp |
| 31 | + |
| 32 | +```hcl |
| 33 | +variable "target_instance_id" {} |
| 34 | +variable "source_instance_id" {} |
| 35 | +
|
| 36 | +resource "huaweicloud_rds_restore" "test" { |
| 37 | + target_instance_id = var.target_instance_id |
| 38 | + source_instance_id = var.source_instance_id |
| 39 | + type = "timestamp" |
| 40 | + restore_time = 1673852043000 |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +## Argument Reference |
| 45 | + |
| 46 | +The following arguments are supported: |
| 47 | + |
| 48 | +* `region` - (Optional, String, ForceNew) The region in which to create the rds instance resource. If omitted, the |
| 49 | + provider-level region will be used. Changing this creates a new resource. |
| 50 | + |
| 51 | +* `target_instance_id` - (Required, String, ForceNew) Specifies the target instance ID. |
| 52 | + |
| 53 | + Changing this creates a new resource. |
| 54 | + |
| 55 | +* `source_instance_id` - (Required, String, ForceNew) Specifies the source instance ID. |
| 56 | + |
| 57 | + Changing this creates a new resource. |
| 58 | + |
| 59 | +* `type` - (Optional, String, ForceNew) Specifies the restoration type. Value options: |
| 60 | + + **backup**: indicates using backup files for restoration. |
| 61 | + + **timestamp**: indicates the point-in-time restoration mode. |
| 62 | + |
| 63 | + Changing this creates a new resource. |
| 64 | + |
| 65 | +* `backup_id` - (Optional, String, ForceNew) Specifies the ID of the backup to be restored. This parameter must be |
| 66 | + specified when `type` is set to **backup** or left empty. |
| 67 | + |
| 68 | + Changing this creates a new resource. |
| 69 | + |
| 70 | +* `restore_time` - (Optional, Int, ForceNew) Specifies the time point of data restoration in the UNIX timestamp format. |
| 71 | + The unit is millisecond and the time zone is UTC. This parameter must be specified when `type` is set to **timestamp**. |
| 72 | + |
| 73 | + Changing this creates a new resource. |
| 74 | + |
| 75 | +* `database_name` - (Optional, Map, ForceNew) Specifies the databases that will be restored. This parameter applies only |
| 76 | + to the SQL Server DB engine. The key is the old database name, the value is the new database name. If this parameter is |
| 77 | + specified, you can restore all or specific databases and rename new databases. If this parameter is not specified, all |
| 78 | + databases are restored by default. You can enter multiple new database names and separate them with commas (,). The new |
| 79 | + database names can contain but cannot be the same as the original database names. Note the following when you are |
| 80 | + specifying new database names: |
| 81 | + + New database names must be different from the original database names. If they are left blank, the original database |
| 82 | + names will be used for restoration by default. |
| 83 | + + The case-sensitivity settings of the new databases are the same as those of the original databases. Make sure the new |
| 84 | + database names are unique. |
| 85 | + + The total number of new and existing databases on the existing or original DB instances where data is restored cannot |
| 86 | + exceed the database quota specified by **rds_databases_quota**. |
| 87 | + + New database names cannot contain the following fields (case-insensitive): **rdsadmin**, **master**, **msdb**, |
| 88 | + **tempdb**, **model** and **resource**. |
| 89 | + + New database names must consist of **1** to **64** characters, including only letters, digits, underscores (_), and |
| 90 | + hyphens (-). If you want to restore data to multiple new databases, separate them with commas (,). |
| 91 | + + New database names must be different from any database names on the original DB instance. |
| 92 | + + New database names must be different from any database names on the existing or original DB instances where data is |
| 93 | + restored. |
| 94 | + |
| 95 | + Changing this creates a new resource. |
| 96 | + |
| 97 | +## Attribute Reference |
| 98 | + |
| 99 | +In addition to all arguments above, the following attribute is exported: |
| 100 | + |
| 101 | +* `id` - The resource ID. The value is the restore job ID. |
| 102 | + |
| 103 | +## Timeouts |
| 104 | + |
| 105 | +This resource provides the following timeouts configuration options: |
| 106 | + |
| 107 | +* `create` - Default is 60 minutes. |
0 commit comments