Provides a RDS Backup resource.
For information about RDS Backup and how to use it, see What is Backup.
Basic Usage
resource "alicloud_db_instance" "example" {
engine = "MySQL"
engine_version = "5.6"
instance_type = "rds.mysql.t1.small"
instance_storage = "30"
instance_charge_type = "Postpaid"
db_instance_storage_type = "local_ssd"
}
resource "alicloud_rds_backup" "example" {
db_instance_id = alicloud_db_instance.example.id
}
The following arguments are supported:
backup_method
- (Optional) The type of backup that you want to perform. Default value: Physical
. Valid values: Logical
, Physical
and Snapshot
.backup_strategy
- (Optional) The policy that you want to use for the backup task. Valid values:
backup_type
- (Optional) The method that you want to use for the backup task. Default value: Auto
. Valid values:
db_instance_id
- (Required, ForceNew) The db instance id.db_name
- (Optional) The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).remove_from_state
- (Optional) Remove form state when resource cannot be deleted. Valid values: true
and false
.The following attributes are exported:
id
- The resource ID in terraform of Backup.backup_id
- The backup id.store_status
- Indicates whether the data backup file can be deleted. Valid values: Enabled
and Disabled
.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 20 mins) Used when creating the backup.delete
- (Defaults to 20 mins) Used when deleting the backup.RDS Backup can be imported using the id, e.g.
$ terraform import alicloud_rds_backup.example <db_instance_id>:<backup_id>