Table: aws_backup_jobs - Query AWS Backup Jobs using SQL
The AWS Backup Jobs are a part of the AWS Backup service, which provides users with a fully managed solution for data protection. These jobs are used to copy data from various sources to AWS Backup Vaults. A backup job can be created manually or automated using a Backup Plan, which specifies the source data set, the target Backup Vault, the backup frequency, and the retention period.
Table Usage Guide
The aws_backup_job
table in Steampipe provides detailed information about backup jobs within AWS Backup. This table allows you to query specific details of each job, such as its state, target vault name, ARN, recovery points, and associated metadata. By utilizing this table, you can gain insights into backup jobs, including the number of successful or failed jobs, the creation date of each job, and more. The schema outlines various attributes of the backup job, including the target vault name, ARN, creation date, job state, and associated tags.
Examples
Basic Info
Track the status of your AWS backup jobs, including their job ID, recovery points, and the backup vaults they were created in. This feature is especially valuable for disaster recovery purposes, as it allows you to monitor the progress and status of your backup jobs. By keeping tabs on your backup jobs, you can ensure the safety and availability of your important data.
select job_id, recovery_point_arn, backup_vault_arn, statusfrom aws_backup_job
select job_id, recovery_point_arn, backup_vault_arn, statusfrom aws_backup_job;
List failed backup jobs
Identify backup jobs that have failed to create a recovery point. This information can be valuable in identifying backup processes that may need maintenance or review.
select job_id, recovery_point_arn, backup_vault_arn, status, current_datefrom aws_backup_jobwhere status != 'COMPLETED' and creation_date > current_date
select job_id, recovery_point_arn, backup_vault_arn, statusfrom aws_backup_jobwhere status != 'COMPLETED' and creation_date > current_date;
List backup jobs by resource type
Monitor the number of your AWS backup jobs by resource type.
select resource_type, count(*)from aws_backup_jobgroup by resource_type
select resource_type, count(*)from aws_backup_jobgroup by resource_type;
Schema for aws_backup_job
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
backup_options | jsonb | Specifies the backup options for a selected resource. | |
backup_size | bigint | The size in bytes of a backup. | |
backup_type | text | Represents the type of backup for a backup job. | |
backup_vault_arn | text | An Amazon Resource Name (ARN) that uniquely identifies the target backup vault. | |
backup_vault_name | text | The name of the target backup vault. | |
bytes_transferred | bigint | The size in bytes transferred to a backup vault at the time that the job status was queried. | |
completion_date | timestamp with time zone | The date and time a backup job is completed. | |
creation_date | timestamp with time zone | The date and time a backup job is created. | |
expected_completion_date | timestamp with time zone | The date and time a backup job is expected to be completed. | |
iam_role_arn | text | The ARN of the IAM role that AWS Backup uses to create the target recovery point. | |
is_parent | boolean | A Boolean value that is returned as TRUE if the specified job is a parent job. | |
job_id | text | = | The logical id of a backup job. |
parent_job_id | text | The ID of the parent backup job, if there is one. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
percent_done | text | The percentage of job completion. | |
recovery_point_arn | text | An Amazon Resource Name (ARN) that uniquely identifies a recovery point. | |
region | text | The AWS Region in which the resource is located. | |
resource_arn | text | An Amazon Resource Name (ARN) that uniquely identifies the source resource in the recovery point. | |
resource_type | text | The type of AWS resource to be backed up. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
start_by | timestamp with time zone | The date and time a backup job must be started before it is canceled. | |
status | text | The current state of a backup job. | |
status_message | text | A detailed message explaining the status of the job. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_backup_job