Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . dms ]

create-replication-task

Description

Creates a replication task using the specified parameters.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-replication-task
--replication-task-identifier <value>
--source-endpoint-arn <value>
--target-endpoint-arn <value>
--replication-instance-arn <value>
--migration-type <value>
--table-mappings <value>
[--replication-task-settings <value>]
[--cdc-start-time <value>]
[--cdc-start-position <value>]
[--cdc-stop-position <value>]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--replication-task-identifier (string)

An identifier for the replication task.

Constraints:

  • Must contain from 1 to 255 alphanumeric characters or hyphens.
  • First character must be a letter.
  • Cannot end with a hyphen or contain two consecutive hyphens.

--source-endpoint-arn (string)

An Amazon Resource Name (ARN) that uniquely identifies the source endpoint.

--target-endpoint-arn (string)

An Amazon Resource Name (ARN) that uniquely identifies the target endpoint.

--replication-instance-arn (string)

The Amazon Resource Name (ARN) of a replication instance.

--migration-type (string)

The migration type. Valid values: full-load | cdc | full-load-and-cdc

Possible values:

  • full-load
  • cdc
  • full-load-and-cdc

--table-mappings (string)

The table mappings for the task, in JSON format. For more information, see Table Mapping in the AWS Database Migration User Guide.

--replication-task-settings (string)

Overall settings for the task, in JSON format. For more information, see Task Settings in the AWS Database Migration User Guide.

--cdc-start-time (timestamp)

Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime or CdcStartPosition to specify when you want a CDC operation to start. Specifying both values results in an error.

Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”

--cdc-start-position (string)

Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want a CDC operation to start. Specifying both values results in an error.

The value can be in date, checkpoint, or LSN/SCN format.

Date Example: --cdc-start-position “2018-03-08T12:12:12”

Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"

LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”

--cdc-stop-position (string)

Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.

Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12”

Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “

--tags (list)

One or more tags to be assigned to the replication task.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

The following command creates a replication task to copy data from one DB instance behind a DMS endpoint to another using a replication instance:

aws dms create-replication-task --replicationtask-identifier my-replication-task --target-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:HTWNT57CLN2WGVBUJQXJZASXWE --source-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ --migration-type full-load --table-mappings 'file://table-mappings.json'

The file table-mappings.json is a JSON document in the current folder that specifies table mappings:

{
  "TableMappings": [
    {
      "Type": "Include",
      "SourceSchema": "company",
      "SourceTable": "emp%"
    },
    {
      "Type": "Include",
      "SourceSchema": "employees",
      "SourceTable": "%"
    },
    {
      "Type": "Exclude",
      "SourceSchema": "source101",
      "SourceTable": "dep%"
    },
    {
      "Type": "Exclude",
      "SourceSchema": "source102",
      "SourceTable": "%"
    },
    {
      "Type": "Explicit",
      "SourceSchema": "company",
      "SourceTable": "managers"
    },
    {
      "Type": "Explicit",
      "SourceSchema": "company",
      "SourceTable": "locations"
    }
    ]
}

Output:

{
  "ReplicationTask": {
    "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE",
    "ReplicationTaskIdentifier": "task1",
    "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ",
    "TableMappings": "{\n \"TableMappings\": [\n {\n \"Type\":\"Include\",\n \"SourceSchema\": \"/\",\n \"SourceTable\": \"/\"\n}\n ]\n}\n\n",
    "Status": "creating",
    "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:OEAMB3NXSTZ6LFYZFEPPBBXPYM",
    "ReplicationTaskCreationDate": 1457658407.492,
    "MigrationType": "full-load",
    "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ASXWXJZLNWNT5HTWCGV2BUJQ7E",
    "ReplicationTaskSettings": "{\"TargetMetadata\":{\"TargetSchema\":\"\",\"SupportLobs\":true,\"FullLobMode\":true,\"LobChunkSize\":64,\"LimitedSizeLobMode\":false,\"LobMaxSize\":0},\"FullLoadSettings\":{\"FullLoadEnabled\":true,\"ApplyChangesEnabled\":false,\"TargetTablePrepMode\":\"DROP_AND_CREATE\",\"CreatePkAfterFullLoad\":false,\"StopTaskCachedChangesApplied\":false,\"StopTaskCachedChangesNotApplied\":false,\"ResumeEnabled\":false,\"ResumeMinTableSize\":100000,\"ResumeOnlyClusteredPKTables\":true,\"MaxFullLoadSubTasks\":8,\"TransactionConsistencyTimeout\":600,\"CommitRate\":10000},\"Logging\":{\"EnableLogging\":false}}"
  }
}

Output

ReplicationTask -> (structure)

The replication task that was created.

ReplicationTaskIdentifier -> (string)

The user-assigned replication task identifier or name.

Constraints:

  • Must contain from 1 to 255 alphanumeric characters or hyphens.
  • First character must be a letter.
  • Cannot end with a hyphen or contain two consecutive hyphens.

SourceEndpointArn -> (string)

The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.

TargetEndpointArn -> (string)

The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.

ReplicationInstanceArn -> (string)

The Amazon Resource Name (ARN) of the replication instance.

MigrationType -> (string)

The type of migration.

TableMappings -> (string)

Table mappings specified in the task.

ReplicationTaskSettings -> (string)

The settings for the replication task.

Status -> (string)

The status of the replication task.

LastFailureMessage -> (string)

The last error (failure) message generated for the replication instance.

StopReason -> (string)

The reason the replication task was stopped.

ReplicationTaskCreationDate -> (timestamp)

The date the replication task was created.

ReplicationTaskStartDate -> (timestamp)

The date the replication task is scheduled to start.

CdcStartPosition -> (string)

Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want the CDC operation to start. Specifying both values results in an error.

The value can be in date, checkpoint, or LSN/SCN format.

Date Example: --cdc-start-position “2018-03-08T12:12:12”

Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"

LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”

CdcStopPosition -> (string)

Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.

Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12”

Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “

RecoveryCheckpoint -> (string)

Indicates the last checkpoint that occurred during a change data capture (CDC) operation. You can provide this value to the CdcStartPosition parameter to start a CDC operation that begins at that checkpoint.

ReplicationTaskArn -> (string)

The Amazon Resource Name (ARN) of the replication task.

ReplicationTaskStats -> (structure)

The statistics for the task, including elapsed time, tables loaded, and table errors.

FullLoadProgressPercent -> (integer)

The percent complete for the full load migration task.

ElapsedTimeMillis -> (long)

The elapsed time of the task, in milliseconds.

TablesLoaded -> (integer)

The number of tables loaded for this task.

TablesLoading -> (integer)

The number of tables currently loading for this task.

TablesQueued -> (integer)

The number of tables queued for this task.

TablesErrored -> (integer)

The number of errors that have occurred during this task.