export_tasks
Creates, updates, deletes, gets or lists an export_tasks resource.
Overview
| Name | export_tasks |
| Type | Resource |
| Id | aws.rds.export_tasks |
Fields
The following fields are returned by SELECT queries:
- describe_export_tasks
| Name | Datatype | Description |
|---|---|---|
export_only | string | The data exported from the snapshot or cluster. Valid Values: database - Export all the data from a specified database. database.table table-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.schema schema-name - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. database.schema.table table-name - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. |
export_task_identifier | string | A unique identifier for the snapshot or cluster export task. This ID isn't an identifier for the Amazon S3 bucket where the data is exported. |
failure_cause | string | The reason the export failed, if it failed. |
iam_role_arn | string | The name of the IAM role that is used to write to Amazon S3 when exporting a snapshot or cluster. |
kms_key_id | string | The key identifier of the Amazon Web Services KMS key that is used to encrypt the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, key ID, alias ARN, or alias name. The IAM role used for the export must have encryption and decryption permissions to use this KMS key. |
percent_progress | integer | The progress of the snapshot or cluster export task as a percentage. |
s3_bucket | string | The Amazon S3 bucket where the snapshot or cluster is exported to. |
s3_prefix | string | The Amazon S3 bucket prefix that is the file name and path of the exported data. |
snapshot_time | string | The time when the snapshot was created. |
source_arn | string | The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. |
source_type | string | The type of source for the export. |
status | string | The progress status of the export task. The status can be one of the following: CANCELED CANCELING COMPLETE FAILED IN_PROGRESS STARTING |
task_end_time | string | The time when the snapshot or cluster export task ended. |
task_start_time | string | The time when the snapshot or cluster export task started. |
total_extracted_data_in_gb | integer | The total amount of data exported, in gigabytes. |
warning_message | string | A warning about the snapshot or cluster export task. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_export_tasks | select | region | ExportTaskIdentifier, SourceArn, Filters, Marker, MaxRecords, SourceType | Returns information about a snapshot or cluster export to Amazon S3. This API operation supports pagination. |
cancel_export_task | exec | ExportTaskIdentifier, region | Cancels an export task in progress that is exporting a snapshot or cluster to Amazon S3. Any data that has already been written to the S3 bucket isn't removed. | |
start_export_task | exec | ExportTaskIdentifier, SourceArn, S3BucketName, IamRoleArn, KmsKeyId, region | S3Prefix, ExportOnly | 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
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ExportTaskIdentifier | string | 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. |
IamRoleArn | string | 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/* |
KmsKeyId | string | 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 |
S3BucketName | string | The name of the Amazon S3 bucket to export the snapshot or cluster data to. |
SourceArn | string | The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon S3. |
region | string | AWS region (default: us-east-1) |
ExportOnly | array | 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.table table-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.schema schema-name - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. database.schema.table table-name - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. |
ExportTaskIdentifier | string | The identifier of the snapshot or cluster export task to be described. |
Filters | array | Filters specify one or more snapshot or cluster exports to describe. The filters are specified as name-value pairs that define what to include in the output. Filter names and values are case-sensitive. Supported filters include the following: export-task-identifier - An identifier for the snapshot or cluster export task. s3-bucket - The Amazon S3 bucket the data is exported to. source-arn - The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. status - The status of the export task. Must be lowercase. Valid statuses are the following: canceled canceling complete failed in_progress starting |
Marker | string | An optional pagination token provided by a previous DescribeExportTasks request. If you specify this parameter, the response includes only records beyond the marker, up to the value specified by the MaxRecords parameter. |
MaxRecords | integer | The maximum number of records to include in the response. If more records exist than the specified value, a pagination token called a marker is included in the response. You can use the marker in a later DescribeExportTasks request to retrieve the remaining results. Default: 100 Constraints: Minimum 20, maximum 100. |
S3Prefix | string | The Amazon S3 bucket prefix to use as the file name and path of the exported data. |
SourceArn | string | The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. |
SourceType | string | The type of source for the export. |
SELECT examples
- describe_export_tasks
Returns information about a snapshot or cluster export to Amazon S3. This API operation supports pagination.
SELECT
export_only,
export_task_identifier,
failure_cause,
iam_role_arn,
kms_key_id,
percent_progress,
s3_bucket,
s3_prefix,
snapshot_time,
source_arn,
source_type,
status,
task_end_time,
task_start_time,
total_extracted_data_in_gb,
warning_message
FROM aws.rds.export_tasks
WHERE region = '{{ region }}' -- required
AND ExportTaskIdentifier = '{{ ExportTaskIdentifier }}'
AND SourceArn = '{{ SourceArn }}'
AND Filters = '{{ Filters }}'
AND Marker = '{{ Marker }}'
AND MaxRecords = '{{ MaxRecords }}'
AND SourceType = '{{ SourceType }}'
;
Lifecycle Methods
- cancel_export_task
- start_export_task
Cancels an export task in progress that is exporting a snapshot or cluster to Amazon S3. Any data that has already been written to the S3 bucket isn't removed.
EXEC aws.rds.export_tasks.cancel_export_task
@ExportTaskIdentifier='{{ ExportTaskIdentifier }}' --required,
@region='{{ region }}' --required
;
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.
EXEC aws.rds.export_tasks.start_export_task
@ExportTaskIdentifier='{{ ExportTaskIdentifier }}' --required,
@SourceArn='{{ SourceArn }}' --required,
@S3BucketName='{{ S3BucketName }}' --required,
@IamRoleArn='{{ IamRoleArn }}' --required,
@KmsKeyId='{{ KmsKeyId }}' --required,
@region='{{ region }}' --required,
@S3Prefix='{{ S3Prefix }}',
@ExportOnly='{{ ExportOnly }}'
;