start_export_task
async
¶
start_export_task(
*,
config_overrides: Optional[AsyncRDSClientConfig] = None,
export_task_identifier: Optional[String] = None,
source_arn: Optional[String] = None,
s3_bucket_name: Optional[String] = None,
iam_role_arn: Optional[String] = None,
kms_key_id: Optional[String] = None,
s3_prefix: Optional[String] = None,
export_only: Optional[StringList] = None,
) -> ExportTask
Starts an export of DB snapshot or DB cluster data to Amazon S3. The provided IAM role must have access to the S3 bucket.
You can't export snapshot data from RDS Custom DB instances. For more information, see Supported Regions and DB engines for exporting snapshots to S3 in Amazon RDS.
For more information on exporting DB snapshot data, see Exporting DB snapshot data to Amazon S3 in the Amazon RDS User Guide or Exporting DB cluster snapshot data to Amazon S3 in the Amazon Aurora User Guide.
For more information on exporting DB cluster data, see Exporting DB cluster data to Amazon S3 in the Amazon Aurora User Guide.
Parameters:
-
export_task_identifier(Optional[String], default:None) –A unique identifier for the export task. This ID isn't an identifier for the Amazon S3 bucket where the data is to be exported.
-
source_arn(Optional[String], default:None) –The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon S3.
-
s3_bucket_name(Optional[String], default:None) –The name of the Amazon S3 bucket to export the snapshot or cluster data to.
-
iam_role_arn(Optional[String], default:None) –The name of the IAM role to use for writing to the Amazon S3 bucket when exporting a snapshot or cluster.
In the IAM policy attached to your IAM role, include the following required actions to allow the transfer of files from Amazon RDS or Amazon Aurora to an S3 bucket:
-
s3:PutObject*
-
s3:GetObject*
-
s3:ListBucket
-
s3:DeleteObject*
-
s3:GetBucketLocation
In the policy, include the resources to identify the S3 bucket and objects in the bucket. The following list of resources shows the Amazon Resource Name (ARN) format for accessing S3:
-
arn:aws:s3:::your-s3-bucket -
arn:aws:s3:::your-s3-bucket/*
-
-
kms_key_id(Optional[String], default:None) –The ID of the Amazon Web Services KMS key to use to encrypt the data exported to Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. The caller of this operation must be authorized to run the following operations. These can be set in the Amazon Web Services KMS key policy:
-
kms:CreateGrant
-
kms:DescribeKey
-
-
s3_prefix(Optional[String], default:None) –The Amazon S3 bucket prefix to use as the file name and path of the exported data.
-
export_only(Optional[StringList], default:None) –The data to be exported from the snapshot or cluster. If this parameter isn't provided, all of the data is exported.
Valid Values:
-
database- Export all the data from a specified database. -
database.tabletable-name - Export a table of the snapshot or cluster. This format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. -
database.schemaschema-name - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. -
database.schema.tabletable-name - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.
-
Raises:
-
DBClusterNotFoundFault–DBClusterIdentifierdoesn't refer to an existing DB cluster. -
DBClusterSnapshotNotFoundFault–DBClusterSnapshotIdentifierdoesn't refer to an existing DB cluster snapshot. -
DBSnapshotNotFoundFault–DBSnapshotIdentifierdoesn't refer to an existing DB snapshot. -
ExportTaskAlreadyExistsFault–You can't start an export task that's already running.
-
IamRoleMissingPermissionsFault–The IAM role requires additional permissions to export to an Amazon S3 bucket.
-
IamRoleNotFoundFault–The IAM role is missing for exporting to an Amazon S3 bucket.
-
InvalidExportOnlyFault–The export is invalid for exporting to an Amazon S3 bucket.
-
InvalidExportSourceStateFault–The state of the export snapshot is invalid for exporting to an Amazon S3 bucket.
-
InvalidS3BucketFault–The specified Amazon S3 bucket name can't be found or Amazon RDS isn't authorized to access the specified Amazon S3 bucket. Verify the SourceS3BucketName and S3IngestionRoleArn values and try again.
-
KMSKeyNotAccessibleFault–An error occurred accessing an Amazon Web Services KMS key.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To export a snapshot to Amazon S3 The following example exports a DB snapshot named db5-snapshot-test to the Amazon S3 bucket named mybucket.
>>> await client.start_export_task(export_task_identifier='my-s3-export', source_arn='arn:aws:rds:us-west-2:123456789012:snapshot:db5-snapshot-test', s3_bucket_name='mybucket', iam_role_arn='arn:aws:iam::123456789012:role/service-role/ExportRole', kms_key_id='arn:aws:kms:us-west-2:123456789012:key/abcd0000-7fca-4128-82f2-aabbccddeeff')
Source code in docs_src/capo_rds/_services/async_rds.py
15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 | |