SyncTableMigration
Migrates the changes in the source table since the previous start or sync, such as added and deleted source objects, into the destination table. The sync runs asynchronously: this operation returns the migration ID of the sync and its initial state, and you track progress with GetTableMigration.
A sync uses the source, destination and data migration settings of the table's migration, and plans the work and writes its reports in the same way as StartTableMigration. You can sync after a start or sync that succeeded, failed or was cancelled, if an earlier start or sync of the table has a valid plan (hasValidPlan). You can't sync a table while a start or sync is in progress for it, and you can sync a table until you call CompleteTableMigration for it. If a source object that an earlier migration migrated has since been overwritten, the sync fails.
- Permissions
-
-
You must have the
s3tables:SyncTableMigrationpermission to use this operation. -
You must have the
iam:PassRolepermission on the role that you specify inroleARN, with a condition that allows passing it tomigration.s3tables.amazonaws.com. The associated resource is the table.
-
Request Syntax
POST /sync-table-migration HTTP/1.1
Content-type: application/json
{
"migrationOutput": {
"bucket": "string",
"prefixes": {
"objectCompatibilityReport": "string",
"objectMigrationReport": "string",
"tableCompatibilityReport": "string"
}
},
"reviewMigrationPlan": boolean,
"roleARN": "string",
"tableARN": "string"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- migrationOutput
-
The bucket and prefixes that the sync writes its reports to. The bucket must be a general purpose bucket in your account and in the same Region as the table bucket, and the migration role must be able to write objects to it. Otherwise, the migration fails when it writes its first report.
Type: MigrationOutputConfiguration object
Required: Yes
- reviewMigrationPlan
-
Specifies whether the sync waits in the
pendingReviewstate, so that you can review the compatibility reports before it migrates any data. Iftrue, the migration continues when you callUpdateTableMigrationwithrequestedStateset toqueued. If you don't continue or cancel the migration within 30 days, the migration fails. The default isfalse.Type: Boolean
Required: No
- roleARN
-
The Amazon Resource Name (ARN) of the IAM role that the sync uses to read the source table and its data and to write the destination table and the reports. The role must be in your account, and its trust policy must allow
migration.s3tables.amazonaws.comto assume it. You can limit the trust policy to the destination table bucket with theaws:SourceArnandaws:SourceAccountcondition keys.Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
Pattern:
arn:aws[-a-z0-9]*:iam::[0-9]{12}:role/.+Required: Yes
- tableARN
-
The Amazon Resource Name (ARN) of the destination table to sync. The table must have a migration, and you must not have called
CompleteTableMigrationfor it.Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
(arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:bucket/[a-z0-9_-]{3,63}/table/[a-zA-Z0-9-_]{1,255})Required: Yes
Response Syntax
HTTP/1.1 202
Content-type: application/json
{
"migrationId": "string",
"state": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 202 response.
The following data is returned in JSON format by the service.
- migrationId
-
The migration ID of the sync.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-z0-9-]+ - state
-
The state of the migration when the request is accepted, such as
planning.Type: String
Valid Values:
new | planning | pendingReview | queued | migrating | succeeded | failed | cancelling | cancelled
Errors
- AccessDeniedException
-
The action cannot be performed because you do not have the required permission.
HTTP Status Code: 403
- BadRequestException
-
The request is invalid or malformed.
HTTP Status Code: 400
- ConflictException
-
The request failed because there is a conflict with a previous write. You can retry the request.
HTTP Status Code: 409
- ForbiddenException
-
The caller isn't authorized to make the request.
HTTP Status Code: 403
- InternalServerErrorException
-
The request failed due to an internal server error.
HTTP Status Code: 500
- NotFoundException
-
The request was rejected because the specified resource could not be found.
HTTP Status Code: 404
- TooManyRequestsException
-
The limit on the number of requests per second was exceeded.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: