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
16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 | |