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
15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 | |