Menu
AWS Database Migration Service
API Reference (API Version 2016-01-01)

CreateReplicationTask

Creates a replication task using the specified parameters.

Request Syntax

{
   "CdcStartTime": number,
   "MigrationType": "string",
   "ReplicationInstanceArn": "string",
   "ReplicationTaskIdentifier": "string",
   "ReplicationTaskSettings": "string",
   "SourceEndpointArn": "string",
   "TableMappings": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "TargetEndpointArn": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

CdcStartTime

The start time for the Change Data Capture (CDC) operation.

Type: Timestamp

Required: No

MigrationType

The migration type.

Type: String

Valid Values: full-load | cdc | full-load-and-cdc

Required: Yes

ReplicationInstanceArn

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

Type: String

Required: Yes

ReplicationTaskIdentifier

The replication task identifier.

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.

Type: String

Required: Yes

ReplicationTaskSettings

Settings for the task, such as target metadata settings. For a complete list of task settings, see Task Settings for AWS Database Migration Service Tasks.

Type: String

Required: No

SourceEndpointArn

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

Type: String

Required: Yes

TableMappings

When using the AWS CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede the path with "file://". When working with the DMS API, provide the JSON as the parameter value.

For example, --table-mappings file://mappingfile.json

Type: String

Required: Yes

Tags

Tags to be added to the replication instance.

Type: Array of Tag objects

Required: No

TargetEndpointArn

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

Type: String

Required: Yes

Response Syntax

{
   "ReplicationTask": { 
      "LastFailureMessage": "string",
      "MigrationType": "string",
      "ReplicationInstanceArn": "string",
      "ReplicationTaskArn": "string",
      "ReplicationTaskCreationDate": number,
      "ReplicationTaskIdentifier": "string",
      "ReplicationTaskSettings": "string",
      "ReplicationTaskStartDate": number,
      "ReplicationTaskStats": { 
         "ElapsedTimeMillis": number,
         "FullLoadProgressPercent": number,
         "TablesErrored": number,
         "TablesLoaded": number,
         "TablesLoading": number,
         "TablesQueued": number
      },
      "SourceEndpointArn": "string",
      "Status": "string",
      "StopReason": "string",
      "TableMappings": "string",
      "TargetEndpointArn": "string"
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ReplicationTask

The replication task that was created.

Type: ReplicationTask object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedFault

AWS DMS was denied access to the endpoint.

HTTP Status Code: 400

InvalidResourceStateFault

The resource is in a state that prevents it from being used for database migration.

HTTP Status Code: 400

KMSKeyNotAccessibleFault

AWS DMS cannot access the KMS key.

HTTP Status Code: 400

ResourceAlreadyExistsFault

The resource you are attempting to create already exists.

HTTP Status Code: 400

ResourceNotFoundFault

The resource could not be found.

HTTP Status Code: 400

ResourceQuotaExceededFault

The quota for this resource quota has been exceeded.

HTTP Status Code: 400

Example

Sample Request

   
POST / HTTP/1.1
Host: dms.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AmazonDMSv20160101.CreateReplicationTask
{
   "ReplicationTaskIdentifier":"task1",
   "SourceEndpointArn":"arn:aws:dms:us-east-1:
      152683116123:endpoint:RZZK4EZW5UANC7Y3P4E776WHBE",
   "TargetEndpointArn":"arn:aws:dms:us-east-1:
      152683116123:endpoint:GVBUJQXJZASXWHTWCLN2WNT57E",
   "ReplicationInstanceArn":"arn:aws:dms:us-east-1:
      152683116123:rep:6USOU366XFJUWATDJGBCJS3VIQ",
   "MigrationType":"full-load",
   "TableMappings":"file:////home/apurvap/table-mappings.json",
   "ReplicationTaskSettings":"",
   "CdcStartTime":null,
   "Tags":[
      {
         "Key":"",
         "Value":""
      }
   ]
}
 

Sample Response


 HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "ReplicationTask":{
      "SourceEndpointArn":"arn:aws:dms:us-east-1:152683116123:endpoint:RZZK4EZW5UANC7Y3P4E776WHBE",
      "ReplicationTaskIdentifier":"task1",
      "ReplicationInstanceArn":"arn:aws:dms:us-east-1:152683116123:rep:6USOU366XFJUWATDJGBCJS3VIQ",
      "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:152683116123:task:OEAMB3NXSTZ6LFYZFEPPBBXPYM",
      "ReplicationTaskCreationDate":1457658407.492,
      "MigrationType":"full-load",
      "TargetEndpointArn":"arn:aws:dms:us-east-1:152683116123:endpoint:GVBUJQXJZASXWHTWCLN2WNT57E",
      "ReplicationTaskSettings":"{\"TargetMetadata\":
         {\"TargetSchema\":\"\",\"SupportLobs\":true,\"FullLobMode\":
         true,\"LobChunkSize\":64,\"LimitedSizeLobMode\":
         false,\"LobMaxSize\":0},\"FullLoadSettings\":{
            \"FullLoadEnabled\":true,
         \"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
      }
   }"
}
}
 

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: