S3Tables / Client / sync_table_migration

sync_table_migration

S3Tables.Client.sync_table_migration(**kwargs)

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:SyncTableMigration permission to use this operation.

  • You must have the iam:PassRole permission on the role that you specify in roleARN, with a condition that allows passing it to migration.s3tables.amazonaws.com. The associated resource is the table.

See also: AWS API Documentation

Request Syntax

response = client.sync_table_migration(
    roleARN='string',
    tableARN='string',
    reviewMigrationPlan=True|False,
    migrationOutput={
        'bucket': 'string',
        'prefixes': {
            'tableCompatibilityReport': 'string',
            'objectCompatibilityReport': 'string',
            'objectMigrationReport': 'string'
        }
    }
)
Parameters:
  • roleARN (string) –

    [REQUIRED]

    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.com to assume it. You can limit the trust policy to the destination table bucket with the aws:SourceArn and aws:SourceAccount condition keys.

  • tableARN (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the destination table to sync. The table must have a migration, and you must not have called CompleteTableMigration for it.

  • reviewMigrationPlan (boolean) – Specifies whether the sync waits in the pendingReview state, so that you can review the compatibility reports before it migrates any data. If true, the migration continues when you call UpdateTableMigration with requestedState set to queued. If you don’t continue or cancel the migration within 30 days, the migration fails. The default is false.

  • migrationOutput (dict) –

    [REQUIRED]

    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.

    • bucket (string) – [REQUIRED]

      The general purpose bucket that the migration writes every report to.

    • prefixes (dict) –

      The key prefix for each report.

      • tableCompatibilityReport (string) –

        The key prefix for the table compatibility report, up to 512 bytes. If not specified, the report’s keys start at the root of the bucket.

      • objectCompatibilityReport (string) –

        The key prefix for the object compatibility report, up to 512 bytes. If not specified, the report’s keys start at the root of the bucket.

      • objectMigrationReport (string) –

        The key prefix for the object migration report, up to 512 bytes. If not specified, the report’s keys start at the root of the bucket.

Return type:

dict

Returns:

Response Syntax

{
    'migrationId': 'string',
    'state': 'new'|'planning'|'pendingReview'|'queued'|'migrating'|'succeeded'|'failed'|'cancelling'|'cancelled'
}

Response Structure

  • (dict) –

    • migrationId (string) –

      The migration ID of the sync.

    • state (string) –

      The state of the migration when the request is accepted, such as planning.

Exceptions