Skip to content
Get Started for Free

Backup

Backup is a centralized backup service provided by Amazon Web Services. It simplifies the process of backing up and restoring your data across various AWS services and resources. Backup supports a wide range of AWS resources, including Elastic Block Store (EBS) volumes, Relational Database Service (RDS) databases, DynamoDB tables, Elastic File System (EFS) file systems, and more. Backup enables you to set backup retention policies, allowing you to specify how long you want to retain your backup copies.

LocalStack allows you to use the Backup APIs in your local environment to manage backup plans, create scheduled or on-demand backups of certain resource types. The supported APIs are available on our API Coverage section, which provides information on the extent of Backup’s integration with LocalStack.

This guide is designed for users new to Backup and assumes basic knowledge of the AWS CLI and our lstk aws command.

Start your LocalStack container using your preferred method. We will demonstrate how to create a backup job and specify a set of resources to the backup plan name and backup rules with the AWS CLI.

You can create a backup vault which acts as a logical container where backups are stored using the CreateBackupVault API. Run the following command to create a backup vault named my-vault:

Terminal window
lstk aws backup create-backup-vault \
--backup-vault-name primary
Output
{
"BackupVaultName": "primary",
"BackupVaultArn": "arn:aws:backup:us-east-1:000000000000:backup-vault:primary",
"CreationDate": 1693286432.432258
}

You can create a backup plan which specifies the backup vault to store the backups in and the schedule for creating backups. You can specify the backup plan in a backup-plan.json file:

{
"BackupPlanName": "testplan",
"Rules": [{
"RuleName": "HalfDayBackups",
"TargetBackupVaultName": "primary",
"ScheduleExpression": "cron(0 5/12 ? * * *)",
"StartWindowMinutes": 480,
"CompletionWindowMinutes": 10080,
"Lifecycle": {
"DeleteAfterDays": 30
},
"CopyActions": [{
"DestinationBackupVaultArn": "arn:aws:backup:us-east-1:000000000000:backup-vault:secondary",
"Lifecycle": {
"DeleteAfterDays": 30
}
}]
}]
}

You can use the CreateBackupPlan API to create a backup plan. Run the following command to create a backup plan:

Terminal window
lstk aws backup create-backup-plan \
--backup-plan file://backup-plan.json
Output
{
"BackupPlanId": "9337aba3",
"BackupPlanArn": "arn:aws:backup:us-east-1:000000000000:backup-plan:testplan",
"CreationDate": 1693286644.0,
"VersionId": "9dc2cb60"
}

You can create a backup selection which specifies the resources to backup and the backup plan to associate with. You can specify the backup selection in a backup-selection.json file:

{
"SelectionName": "Myselection",
"IamRoleArn": "arn:aws:iam::000000000000:role/service-role/AWSBackupDefaultServiceRole",
"Resources": ["arn:aws:ec2:us-east-1:000000000000:volume/vol-0abcdef1234"],
"ListOfTags": [{
"ConditionType": "STRINGEQUALS",
"ConditionKey": "backup",
"ConditionValue": "yes"
}]
}

You can use the CreateBackupSelection API to create a backup selection. Run the following command to create a backup selection:

Terminal window
lstk aws backup create-backup-selection \
--backup-plan-id 9337aba3 \
--backup-selection file://backup-plan-resources.json

Replace the --backup-plan-id value with the BackupPlanId value from the output of the previous command.

Output
{
"SelectionId": "91ce25f8",
"BackupPlanId": "9337aba3",
"CreationDate": 1693287607.209043
}

The LocalStack Web Application provides a Resource Browser for managing backup plans and vaults. You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the Resources section, and then clicking on Backup under the Storage section.

Backup Resource Browser

The Resource Browser allows you to perform the following actions:

  • Create Backup Plan: Create a backup plan by clicking the Create button in the Backup Plans tab and specifying the backup plan details, including the plan name, rules, backup setting, and more in the modal dialog.
  • Create Backup Vault: Create a backup vault by clicking the Create button in the Backup Vault tab and specifying the vault name, tags, and other parameters in the modal dialog.
  • Create Backup: Create a backup by clicking the Backup Vault and then clicking the Actions button followed by clicking the Create Backup button in the modal dialog. Specify the backup name, backup vault, and other parameters in the modal dialog.
  • Assign Resources: Click the backup plan and then click the Actions button followed by clicking the Assign Resources button in the modal dialog. Specify the backup plan ID and resources to assign in the modal dialog, and click Submit to assign the resources to the backup plan.
  • Delete Vault: Delete a backup vault by clicking the Backup Vault or selecting multiple vaults. Click the Actions button followed by clicking the Delete Vault button or Remove Selected to delete an individual vault or multiple vaults respectively in the modal dialog.
  • Delete Backup Plan: Delete a backup plan by clicking the Backup Plan or selecting multiple plans. Click the Actions button followed by clicking the Delete Backup Plan button or Remove Selected to delete an individual plan or multiple plans respectively in the modal dialog.

22 of 115 operations implemented

Available from the Ultimate plan. Licensing details

Find an API

Search the full operation list, then sort the table to compare current support.

Loading operations…

Verified on Kubernetes
Loading operations…
Complete static API list All 115 operations and their current support status
OperationStatus
AssociateBackupVaultMpaApprovalTeamNot implemented
CancelLegalHoldNot implemented
CreateBackupAccessPointNot implemented
CreateBackupPlanImplemented
CreateBackupSelectionImplemented
CreateBackupVaultImplemented
CreateFrameworkNot implemented
CreateLegalHoldNot implemented
CreateLogicallyAirGappedBackupVaultNot implemented
CreateReportPlanNot implemented
CreateRestoreAccessBackupVaultNot implemented
CreateRestoreTestingPlanNot implemented
CreateRestoreTestingSelectionNot implemented
CreateTieringConfigurationNot implemented
DeleteBackupAccessPointNot implemented
DeleteBackupPlanImplemented
DeleteBackupSelectionImplemented
DeleteBackupVaultImplemented
DeleteBackupVaultAccessPolicyNot implemented
DeleteBackupVaultLockConfigurationNot implemented
DeleteBackupVaultNotificationsNot implemented
DeleteFrameworkNot implemented
DeleteRecoveryPointNot implemented
DeleteReportPlanNot implemented
DeleteRestoreTestingPlanNot implemented
DeleteRestoreTestingSelectionNot implemented
DeleteTieringConfigurationNot implemented
DescribeBackupAccessPointNot implemented
DescribeBackupJobNot implemented
DescribeBackupVaultImplemented
DescribeCopyJobNot implemented
DescribeFrameworkNot implemented
DescribeGlobalSettingsNot implemented
DescribeProtectedResourceNot implemented
DescribeRecoveryPointNot implemented
DescribeRegionSettingsNot implemented
DescribeReportJobNot implemented
DescribeReportPlanNot implemented
DescribeRestoreJobImplemented
DescribeScanJobNot implemented
DisassociateBackupVaultMpaApprovalTeamNot implemented
DisassociateRecoveryPointNot implemented
DisassociateRecoveryPointFromParentNot implemented
ExportBackupPlanTemplateNot implemented
GetBackupPlanImplemented
GetBackupPlanFromJSONNot implemented
GetBackupPlanFromTemplateNot implemented
GetBackupSelectionImplemented
GetBackupVaultAccessPolicyImplemented
GetBackupVaultNotificationsNot implemented
GetLegalHoldNot implemented
GetPITRMalwareScanResultsNot implemented
GetRecoveryPointIndexDetailsNot implemented
GetRecoveryPointRestoreMetadataNot implemented
GetRestoreJobMetadataNot implemented
GetRestoreTestingInferredMetadataNot implemented
GetRestoreTestingPlanNot implemented
GetRestoreTestingSelectionNot implemented
GetSupportedResourceTypesNot implemented
GetTieringConfigurationNot implemented
ListBackupAccessPointsNot implemented
ListBackupAccessPointsByRecoveryPointNot implemented
ListBackupAccessPointsByResourceNot implemented
ListBackupJobSummariesNot implemented
ListBackupJobsNot implemented
ListBackupPlanTemplatesNot implemented
ListBackupPlanVersionsNot implemented
ListBackupPlansImplemented
ListBackupSelectionsImplemented
ListBackupVaultsImplemented
ListCopyJobSummariesNot implemented
ListCopyJobsNot implemented
ListFrameworksNot implemented
ListIndexedRecoveryPointsNot implemented
ListLegalHoldsNot implemented
ListProtectedResourcesNot implemented
ListProtectedResourcesByBackupVaultNot implemented
ListRecoveryPointsByBackupVaultImplemented
ListRecoveryPointsByLegalHoldNot implemented
ListRecoveryPointsByResourceImplemented
ListReportJobsNot implemented
ListReportPlansNot implemented
ListRestoreAccessBackupVaultsNot implemented
ListRestoreJobSummariesNot implemented
ListRestoreJobsNot implemented
ListRestoreJobsByProtectedResourceNot implemented
ListRestoreTestingPlansNot implemented
ListRestoreTestingSelectionsNot implemented
ListScanJobSummariesNot implemented
ListScanJobsNot implemented
ListTagsImplemented
ListTieringConfigurationsNot implemented
PutBackupVaultAccessPolicyImplemented
PutBackupVaultLockConfigurationNot implemented
PutBackupVaultNotificationsNot implemented
PutRestoreValidationResultNot implemented
RevokeRestoreAccessBackupVaultNot implemented
StartBackupJobNot implemented
StartCopyJobNot implemented
StartReportJobNot implemented
StartRestoreJobImplemented
StartScanJobNot implemented
StopBackupJobNot implemented
TagResourceImplemented
UntagResourceImplemented
UpdateBackupPlanImplemented
UpdateFrameworkNot implemented
UpdateGlobalSettingsNot implemented
UpdateRecoveryPointIndexSettingsNot implemented
UpdateRecoveryPointLifecycleNot implemented
UpdateRegionSettingsNot implemented
UpdateReportPlanNot implemented
UpdateRestoreTestingPlanNot implemented
UpdateRestoreTestingSelectionNot implemented
UpdateTieringConfigurationNot implemented
Was this page helpful?