Skip to main content

backup_jobs

Creates, updates, deletes, gets or lists a backup_jobs resource.

Overview

Namebackup_jobs
TypeResource
Idaws.backup.backup_jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringReturns the account ID that owns the backup job. (pattern: <code>^[0-9]{12}$</code>)
backup_job_idstringUniquely identifies a request to Backup to back up a resource.
backup_optionsobjectRepresents the options specified as part of backup plan or on-demand backup job.
backup_size_in_bytesinteger (int64)The size, in bytes, of a backup (recovery point). This value can render differently depending on the resource type as Backup pulls in data information from other Amazon Web Services services. For example, the value returned may show a value of 0, which may differ from the anticipated value. The expected behavior for values by resource type are described as follows: Amazon Aurora, Amazon DocumentDB, and Amazon Neptune do not have this value populate from the operation GetBackupJobStatus. For Amazon DynamoDB with advanced features, this value refers to the size of the recovery point (backup). Amazon EC2 and Amazon EBS show volume size (provisioned storage) returned as part of this value. Amazon EBS does not return backup size information; snapshot size will have the same value as the original resource that was backed up. For Amazon EFS, this value refers to the delta bytes transferred during a backup. For Amazon EKS, this value refers to the size of your nested EKS recovery point. Amazon FSx does not populate this value from the operation GetBackupJobStatus for FSx file systems. An Amazon RDS instance will show as 0. For virtual machines running VMware, this value is passed to Backup through an asynchronous workflow, which can mean this displayed value can under-represent the actual backup size.
backup_typestringRepresents the actual backup type selected for a backup job. For example, if a successful Windows Volume Shadow Copy Service (VSS) backup was taken, BackupType returns "WindowsVSS". If BackupType is empty, then the backup type was a regular backup.
backup_vault_arnstringAn Amazon Resource Name (ARN) that uniquely identifies a backup vault; for example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.
backup_vault_namestringThe name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. (pattern: <code>^[a-zA-Z0-9-_]{2,50}$</code>)
bytes_transferredinteger (int64)The size in bytes transferred to a backup vault at the time that the job status was queried.
child_jobs_in_stateobjectThis returns the statistics of the included child (nested) backup jobs.
completion_datestring (date-time)The date and time that a job to create a backup job is completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
created_byobjectContains identifying information about the creation of a backup job, including the BackupPlanArn, BackupPlanId, BackupPlanVersion, and BackupRuleId of the backup plan that is used to create it.
creation_datestring (date-time)The date and time that a backup job is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
encryption_key_arnstringThe Amazon Resource Name (ARN) of the KMS key used to encrypt the backup. This can be a customer-managed key or an Amazon Web Services managed key, depending on the vault configuration.
expected_completion_datestring (date-time)The date and time that a job to back up resources is expected to be completed, in Unix format and Coordinated Universal Time (UTC). The value of ExpectedCompletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
iam_role_arnstringSpecifies the IAM role ARN used to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.
initiation_datestring (date-time)The date a backup job was initiated.
is_encryptedbooleanA boolean value indicating whether the backup is encrypted. All backups in Backup are encrypted, but this field indicates the encryption status for transparency.
is_parentbooleanThis returns the boolean value that a backup job is a parent (composite) job.
message_categorystringThe job count for the specified message category. Example strings may include AccessDenied, SUCCESS, AGGREGATE_ALL, and INVALIDPARAMETERS. View Monitoring for a list of accepted MessageCategory strings.
number_of_child_jobsinteger (int64)This returns the number of child (nested) backup jobs.
parent_job_idstringThis returns the parent (composite) resource backup job ID.
percent_donestringContains an estimated percentage that is complete of a job at the time the job status was queried.
recovery_point_arnstringAn ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.
recovery_point_lifecycleobjectSpecifies the time period, in days, before a recovery point transitions to cold storage or is deleted. Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, on the console, the retention setting must be 90 days greater than the transition to cold after days setting. The transition to cold after days setting can't be changed after a backup has been transitioned to cold. Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. To remove the existing lifecycle and retention periods and keep your recovery points indefinitely, specify -1 for MoveToColdStorageAfterDays and DeleteAfterDays.
resource_arnstringAn ARN that uniquely identifies a saved resource. The format of the ARN depends on the resource type.
resource_namestringThe non-unique name of the resource that belongs to the specified backup.
resource_typestringThe type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database. (pattern: <code>^[a-zA-Z0-9-_.]{1,50}$</code>)
start_bystring (date-time)Specifies the time in Unix format and Coordinated Universal Time (UTC) when a backup job must be started before it is canceled. The value is calculated by adding the start window to the scheduled time. So if the scheduled time were 6:00 PM and the start window is 2 hours, the StartBy time would be 8:00 PM on the date specified. The value of StartBy is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
statestringThe current state of a backup job. (CREATED, PENDING, RUNNING, ABORTING, ABORTED, COMPLETED, FAILED, EXPIRED, PARTIAL)
status_messagestringA detailed message explaining the status of the job to back up a resource.
vault_lock_statestringThe lock state of the backup vault. For logically air-gapped vaults, this indicates whether the vault is locked in compliance mode. Valid values include LOCKED and UNLOCKED.
vault_typestringThe type of backup vault where the recovery point is stored. Valid values are BACKUP_VAULT for standard backup vaults and LOGICALLY_AIR_GAPPED_BACKUP_VAULT for logically air-gapped vaults.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_backup_jobselectbackup_job_id, regionReturns backup job details for the specified BackupJobId.
list_backup_jobsselectregionnextToken, maxResults, resourceArn, state, backupVaultName, createdBefore, createdAfter, resourceType, accountId, completeAfter, completeBefore, parentJobId, messageCategoryReturns a list of existing backup jobs for an authenticated account for the last 30 days. For a longer period of time, consider using these monitoring tools.

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.

NameDatatypeDescription
backup_job_idstringUniquely identifies a request to Backup to back up a resource.
regionstringAWS region (default: us-east-1)
accountIdstringThe account ID to list the jobs from. Returns only backup jobs associated with the specified account ID. If used from an Organizations management account, passing * returns all jobs across the organization.
backupVaultNamestringReturns only backup jobs that will be stored in the specified backup vault. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.
completeAfterstring (date-time)Returns only backup jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).
completeBeforestring (date-time)Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).
createdAfterstring (date-time)Returns only backup jobs that were created after the specified date.
createdBeforestring (date-time)Returns only backup jobs that were created before the specified date.
maxResultsintegerThe maximum number of items to be returned.
messageCategorystringThis is an optional parameter that can be used to filter out jobs with a MessageCategory which matches the value you input. Example strings may include AccessDenied, SUCCESS, AGGREGATE_ALL, and InvalidParameters. View Monitoring The wildcard () returns count of all message categories. AGGREGATE_ALL aggregates job counts for all message categories and returns the sum.
nextTokenstringThe next item following a partial list of returned items. For example, if a request is made to return MaxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
parentJobIdstringThis is a filter to list child (nested) jobs based on parent job ID.
resourceArnstringReturns only backup jobs that match the specified resource Amazon Resource Name (ARN).
resourceTypestringReturns only backup jobs for the specified resources: Aurora for Amazon Aurora CloudFormation for CloudFormation DocumentDB for Amazon DocumentDB (with MongoDB compatibility) DynamoDB for Amazon DynamoDB EBS for Amazon Elastic Block Store EC2 for Amazon Elastic Compute Cloud EFS for Amazon Elastic File System EKS for Amazon Elastic Kubernetes Service FSx for Amazon FSx Neptune for Amazon Neptune RDS for Amazon Relational Database Service Redshift for Amazon Redshift S3 for Amazon Simple Storage Service (Amazon S3) SAP HANA on Amazon EC2 for SAP HANA databases on Amazon Elastic Compute Cloud instances Storage Gateway for Storage Gateway Timestream for Amazon Timestream VirtualMachine for VMware virtual machines
statestringReturns only backup jobs that are in the specified state. Completed with issues is a status found only in the Backup console. For API, this status refers to jobs with a state of COMPLETED and a MessageCategory with a value other than SUCCESS; that is, the status is completed but comes with a status message. To obtain the job count for Completed with issues, run two GET requests, and subtract the second, smaller number: GET /backup-jobs/?state=COMPLETED GET /backup-jobs/?messageCategory=SUCCESS&state=COMPLETED

SELECT examples

Returns backup job details for the specified BackupJobId.

SELECT
account_id,
backup_job_id,
backup_options,
backup_size_in_bytes,
backup_type,
backup_vault_arn,
backup_vault_name,
bytes_transferred,
child_jobs_in_state,
completion_date,
created_by,
creation_date,
encryption_key_arn,
expected_completion_date,
iam_role_arn,
initiation_date,
is_encrypted,
is_parent,
message_category,
number_of_child_jobs,
parent_job_id,
percent_done,
recovery_point_arn,
recovery_point_lifecycle,
resource_arn,
resource_name,
resource_type,
start_by,
state,
status_message,
vault_lock_state,
vault_type
FROM aws.backup.backup_jobs
WHERE backup_job_id = '{{ backup_job_id }}' -- required
AND region = '{{ region }}' -- required
;