start_export_task
¶
start_export_task(
*,
config_overrides: Optional[RDSClientConfig] = 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.
>>> 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/rds.py
15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 | |