start_table_migration
async
¶
start_table_migration(
role_arn: RoleArn,
destination_table: DestinationTable,
source_type: MigrationSourceType,
source: SourceConfiguration,
migration_output: MigrationOutputConfiguration,
*,
config_overrides: Optional[AsyncS3TablesClientConfig] = 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/async_s3_tables.py
3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 | |