start_table_migration
¶
start_table_migration(
role_arn: RoleArn,
destination_table: DestinationTable,
source_type: MigrationSourceType,
source: SourceConfiguration,
migration_output: MigrationOutputConfiguration,
*,
config_overrides: Optional[S3TablesClientConfig] = None,
data_migration: Optional[DataMigrationSettings] = None,
review_migration_plan: Optional[bool] = None,
) -> StartTableMigrationResponse
Starts migrating an Amazon Web Services Glue Data Catalog table into a new table in a table bucket. The migration runs asynchronously: this operation returns the migration ID and its initial state, and you track progress with GetTableMigration.
The namespace must already exist. If a table with the specified name already exists, the request fails with a ConflictException. The request has no client token. If a request times out, call ListTableMigrations to check whether the migration started before you retry.
The migration creates the table during planning and commits data to it as it runs. Until you call CompleteTableMigration, you can read the table, but you can't write to it. If the migration fails or is cancelled, the table and the data already committed to it remain.
The migration first checks the source and the destination, and writes the table compatibility and object compatibility reports to the bucket that you specify in migrationOutput. If you set reviewMigrationPlan to true, the migration waits in the pendingReview state so that you can review the reports, and continues only when you call UpdateTableMigration with requestedState set to queued. Otherwise, it continues to migrate the data, and writes the object migration report when the migration ends. If planning fails, the migration writes no object migration report.
- Permissions
-
-
You must have the
s3tables:StartTableMigrationpermission 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. Set theiam:AssociatedResourceArncondition key to the table bucket ARN. -
If
destinationTablespecifies SSE-KMS encryption, you must have thekms:DescribeKeyandkms:GenerateDataKeypermissions on the KMS key. You must also grant the S3 Tables maintenance principal access to the key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption.
-
Parameters:
-
role_arn(RoleArn) –The Amazon Resource Name (ARN) of the IAM role that the migration 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. -
destination_table(DestinationTable) –The table to create and migrate the source into.
-
source_type(MigrationSourceType) –The type of the source. It must match the member that you set in
source. -
source(SourceConfiguration) –The source table to migrate.
-
data_migration(Optional[DataMigrationSettings], default:None) –The maintenance settings and migration policies for the destination table.
-
review_migration_plan(Optional[bool], default:None) –Specifies whether the migration waits in the
pendingReviewstate, so that you can review the compatibility reports before it migrates any data. Valid values:-
true- The migration waits inpendingReviewuntil you callUpdateTableMigrationwithrequestedStateset toqueued. If you don't continue or cancel the migration within 30 days, the migration fails withinternalError. -
false- The migration continues without waiting for review. This is the default.
-
-
migration_output(MigrationOutputConfiguration) –The bucket and prefixes that the migration 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.
Raises:
-
AccessDeniedException–The action cannot be performed because you do not have the required permission.
-
BadRequestException–The request is invalid or malformed.
-
ConflictException–The request conflicts with the resource's current state, such as a previous write, an existing table, or a migration that's in progress or already in the requested state. If the conflict is with a concurrent write, you can retry the request.
-
ForbiddenException–The caller isn't authorized to make the request.
-
InternalServerErrorException–The request failed due to an internal server error.
-
NotFoundException–The request was rejected because the specified resource could not be found.
-
TooManyRequestsException–The limit on the number of requests per second was exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3tables/_services/s3_tables.py
3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 | |