Skip to main content

backup_plans

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

Overview

Namebackup_plans
TypeResource
Idaws.backup.backup_plans

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
advanced_backup_settingsarrayContains a list of BackupOptions for each resource type. The list is populated only if the advanced option is set for the backup plan.
backup_planobjectSpecifies the body of a backup plan. Includes a BackupPlanName and one or more sets of Rules.
backup_plan_arnstringAn Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50.
backup_plan_idstringUniquely identifies a backup plan.
creation_datestring (date-time)The date and time that a backup plan 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.
creator_request_idstringA unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.
deletion_datestring (date-time)The date and time that a backup plan is deleted, in Unix format and Coordinated Universal Time (UTC). The value of DeletionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
last_execution_datestring (date-time)The last time this backup plan was run. A date and time, in Unix format and Coordinated Universal Time (UTC). The value of LastExecutionDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
scheduled_runs_previewarrayList of upcoming scheduled backup runs. Only included when MaxScheduledRunsPreview parameter is greater than 0. Contains up to 10 future backup executions with their scheduled times, execution types, and associated rule IDs.
version_idstringUnique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_backup_planselectbackup_plan_id, regionversionId, MaxScheduledRunsPreviewReturns BackupPlan details for the specified BackupPlanId. The details are the body of a backup plan in JSON format, in addition to plan metadata.
list_backup_plansselectregionnextToken, maxResults, includeDeletedLists the active backup plans for the account.
create_backup_planinsertregion, BackupPlanCreates a backup plan using a backup plan name and backup rules. A backup plan is a document that contains information that Backup uses to schedule tasks that create recovery points for resources. If you call CreateBackupPlan with a plan that already exists, you receive an AlreadyExistsException exception.
update_backup_planupdatebackup_plan_id, region, BackupPlanUpdates the specified backup plan. The new version is uniquely identified by its ID.
delete_backup_plandeletebackup_plan_id, regionDeletes a backup plan. A backup plan can only be deleted after all associated selections of resources have been deleted. Deleting a backup plan deletes the current version of a backup plan. Previous versions, if any, will still exist.
export_backup_plan_templateexecbackup_plan_id, regionReturns the backup plan that is specified by the plan ID as a backup template.

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_plan_idstringUniquely identifies a backup plan.
regionstringAWS region (default: us-east-1)
MaxScheduledRunsPreviewintegerNumber of future scheduled backup runs to preview. When set to 0 (default), no scheduled runs preview is included in the response. Valid range is 0-10.
includeDeletedbooleanA Boolean value with a default value of FALSE that returns deleted backup plans when set to TRUE.
maxResultsintegerThe maximum number of items to be returned.
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.
versionIdstringUnique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.

SELECT examples

Returns BackupPlan details for the specified BackupPlanId. The details are the body of a backup plan in JSON format, in addition to plan metadata.

SELECT
advanced_backup_settings,
backup_plan,
backup_plan_arn,
backup_plan_id,
creation_date,
creator_request_id,
deletion_date,
last_execution_date,
scheduled_runs_preview,
version_id
FROM aws.backup.backup_plans
WHERE backup_plan_id = '{{ backup_plan_id }}' -- required
AND region = '{{ region }}' -- required
AND versionId = '{{ versionId }}'
AND MaxScheduledRunsPreview = '{{ MaxScheduledRunsPreview }}'
;

INSERT examples

Creates a backup plan using a backup plan name and backup rules. A backup plan is a document that contains information that Backup uses to schedule tasks that create recovery points for resources. If you call CreateBackupPlan with a plan that already exists, you receive an AlreadyExistsException exception.

INSERT INTO aws.backup.backup_plans (
BackupPlan,
BackupPlanTags,
CreatorRequestId,
region
)
SELECT
'{{ BackupPlan }}' /* required */,
'{{ BackupPlanTags }}',
'{{ CreatorRequestId }}',
'{{ region }}'
RETURNING
advanced_backup_settings,
backup_plan_arn,
backup_plan_id,
creation_date,
version_id
;

UPDATE examples

Updates the specified backup plan. The new version is uniquely identified by its ID.

UPDATE aws.backup.backup_plans
SET
BackupPlan = '{{ BackupPlan }}'
WHERE
backup_plan_id = '{{ backup_plan_id }}' --required
AND region = '{{ region }}' --required
AND BackupPlan = '{{ BackupPlan }}' --required
RETURNING
advanced_backup_settings,
backup_plan_arn,
backup_plan_id,
creation_date,
scan_settings,
version_id;

DELETE examples

Deletes a backup plan. A backup plan can only be deleted after all associated selections of resources have been deleted. Deleting a backup plan deletes the current version of a backup plan. Previous versions, if any, will still exist.

DELETE FROM aws.backup.backup_plans
WHERE backup_plan_id = '{{ backup_plan_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Returns the backup plan that is specified by the plan ID as a backup template.

EXEC aws.backup.backup_plans.export_backup_plan_template
@backup_plan_id='{{ backup_plan_id }}' --required,
@region='{{ region }}' --required
;