Provides a DMS (Data Migration Service) replication task resource. DMS replication tasks can be created, updated, deleted, and imported.
# Create a new replication task
resource "aws_dms_replication_task" "test" {
cdc_start_time = "1993-05-21T05:50:00Z"
migration_type = "full-load"
replication_instance_arn = aws_dms_replication_instance.test-dms-replication-instance-tf.replication_instance_arn
replication_task_id = "test-dms-replication-task-tf"
replication_task_settings = "..."
source_endpoint_arn = aws_dms_endpoint.test-dms-source-endpoint-tf.endpoint_arn
table_mappings = "{\"rules\":[{\"rule-type\":\"selection\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"object-locator\":{\"schema-name\":\"%\",\"table-name\":\"%\"},\"rule-action\":\"include\"}]}"
tags = {
Name = "test"
}
target_endpoint_arn = aws_dms_endpoint.test-dms-target-endpoint-tf.endpoint_arn
}
This resource supports the following arguments:
cdc_start_position
- (Optional, Conflicts with cdc_start_time
) Indicates when you want a change data capture (CDC) operation to start. The value can be a RFC3339 formatted date, a checkpoint, or a LSN/SCN format depending on the source engine. For more information see Determining a CDC native start point.cdc_start_time
- (Optional, Conflicts with cdc_start_position
) RFC3339 formatted date string or UNIX timestamp for the start of the Change Data Capture (CDC) operation.migration_type
- (Required) Migration type. Can be one of full-load | cdc | full-load-and-cdc
.replication_instance_arn
- (Required) ARN of the replication instance.replication_task_id
- (Required) Replication task identifier which must contain from 1 to 255 alphanumeric characters or hyphens, first character must be a letter, cannot end with a hyphen, and cannot contain two consecutive hyphens.replication_task_settings
- (Optional) Escaped JSON string that contains the task settings. For a complete list of task settings, see Task Settings for AWS Database Migration Service Tasks. Note that Logging.CloudWatchLogGroup
and Logging.CloudWatchLogStream
are read only and should not be defined, even as null
, in the configuration since AWS provides a value for these settings.resource_identifier
- (Optional) A friendly name for the resource identifier at the end of the EndpointArn response parameter that is returned in the created Endpoint object.source_endpoint_arn
- (Required) ARN that uniquely identifies the source endpoint.start_replication_task
- (Optional) Whether to run or stop the replication task.table_mappings
- (Required) Escaped JSON string that contains the table mappings. For information on table mapping see Using Table Mapping with an AWS Database Migration Service Task to Select and Filter Datatags
- (Optional) A map of tags to assign to the resource. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.target_endpoint_arn
- (Required) ARN that uniquely identifies the target endpoint.This resource exports the following attributes in addition to the arguments above:
replication_task_arn
- ARN for the replication task.status
- Replication Task status.tags_all
- Map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import replication tasks using the replication_task_id
. For example:
import {
to = aws_dms_replication_task.test
id = "test-dms-replication-task-tf"
}
Using terraform import
, import replication tasks using the replication_task_id
. For example:
% terraform import aws_dms_replication_task.test test-dms-replication-task-tf