Provides a Dts Instance resource.
For information about Dts Instance and how to use it, see What is Instance.
Basic Usage
data "alicloud_resource_manager_resource_groups" "default" {
status = "OK"
}
data "alicloud_regions" "default" {
current = true
}
resource "alicloud_dts_instance" "default" {
type = "sync"
resource_group_id = data.alicloud_resource_manager_resource_groups.default.ids.0
payment_type = "Subscription"
instance_class = "large"
source_endpoint_engine_name = "MySQL"
source_region = data.alicloud_regions.default.regions.0.id
destination_endpoint_engine_name = "MySQL"
destination_region = data.alicloud_regions.default.regions.0.id
}
The following arguments are supported:
auto_pay
- (Optional) Whether to automatically renew the fee when it expires. Valid values:
auto_start
- (Optional) Whether to start the task automatically after the purchase is completed. Value:
compute_unit
- (Optional) Specifications of ETL. The unit is compute unit (CU),1CU = 1vCPU +4GB of memory. The value range is an integer greater than or equal to 2. NOTE: Enter this parameter and enable ETL to clean and convert data. database_count
- (Optional) The number of private custom RDS instances in the PolarDB-X. The default value is 1. NOTE: This parameter is required only when source_endpoint_engine_name is DRDS.destination_endpoint_engine_name
- (Optional, ForceNew) The target database engine type.
du
- (Optional) Assign a specified number of DU resources to DTS tasks in the DTS exclusive cluster. Valid values: 1 ~ 100. NOTE: The value of this parameter must be within the range of the number of DUs available for the DTS dedicated cluster.fee_type
- (Optional) Subscription billing type, Valid values: ONLY_CONFIGURATION_FEE
: charges only configuration fees; CONFIGURATION_FEE_AND_DATA_FEE
: charges configuration fees and data traffic fees.instance_class
- (Optional, ForceNew) The type of the migration or synchronization instance.
job_id
- (Optional) The ID of the task obtained by calling the ConfigureDtsJob operation (DtsJobId).> After you pass in this parameter, you do not need to pass the source_region, destination_region, type, source_endpoint_engine_name, or destination_endpoint_engine_name parameters. Even if the input is passed in, the configuration in job_id shall prevail.payment_type
- (Optional, ForceNew) The payment type of the resource. Valid values: Subscription
, PayAsYouGo
.period
- (Optional) The billing method of the subscription instance. Value: Year
, Month
. NOTE: This parameter is valid and must be passed in only when payment_type
is Subscription
.destination_region
- (Optional, ForceNew) The target instance region. For more information, see List of supported regions. NOTE: This parameter or job_id must be passed in.resource_group_id
- (Optional) Resource Group ID.source_endpoint_engine_name
- (ForceNew, Optional) Source instance database engine type.
source_region
- (Optional, ForceNew) The source instance region. For more information, see List of supported regions. NOTE: This parameter or job_id must be passed in.sync_architecture
- (Optional) Synchronization topology, value:
tags
- (Optional) The tag value corresponding to the tag key.See the following Block Tags
.type
- (Optional, ForceNew) The instance type. Valid values:
used_time
- (Optional) Prepaid instance purchase duration.
Subscription
.period
.synchronization_direction
- (Optional) The synchronization direction. Default value: Forward
. Valid values:
Forward
: Data is synchronized from the source database to the destination database.Reverse
: Data is synchronized from the destination database to the source database.The following attributes are exported:
id
- The key
of the resource supplied above.create_time
- Instance creation timedts_instance_id
- The ID of the subscription instance.instance_name
- The name of Dts instance.status
- Instance status.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Instance.delete
- (Defaults to 5 mins) Used when delete the Instance.update
- (Defaults to 5 mins) Used when update the Instance.Dts Instance can be imported using the id, e.g.
$ terraform import alicloud_dts_instance.example <id>