Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Emergency Contact

AWS Backup: How to create AWS Backup plan with AWS CLI

by Jiji Jose | Aug 20, 2021 | Amazon Web Services (AWS), Latest | 0 comments

Wondering how to create an AWS Backup plan with AWS CLI? We can help you with this!

As a part of our AWS Support Services, we often receive similar requests from our AWS customers.

Today, let’s see the steps followed by our Support Techs to help our customers to create an AWS Backup plan with AWS CLI.
 

Create AWS Backup plan with AWS CLI

 
A backup plan is a document that contains information that Backup uses to schedule tasks that create recovery points for resources.
Here, the AWS Backup plan is set up with a copy job configuration in the backup rule.

At first, we need to create a primary backup vault in the source AWS Region and the primary vault stores the source recovery points.

Then we need to create a secondary vault in the destination Region. The secondary vault stores the recovery points that AWS Backup creates as part of the copy configuration in the backup plan.

Now let’s see the steps to create an AWS Backup plan with AWS CLI:

  1. Firstly, we need to create a primary vault in the source region by running the create-backup-vault command.
aws backup create-backup-vault --backup-vault-name primary --region eu-west-1

2. Then we need to create a secondary vault in the destination region by running the command again.

aws backup create-backup-vault --backup-vault-name secondary --region eu-east-2

3. After that, we can create a JSON file with the options and parameters for the backup plan.

{
"BackupPlanName": "sampleplan",
"Rules": [{
"RuleName": "HalfDayBackups",
"TargetBackupVaultName": "primary",
"ScheduleExpression": "cron(0 5/12 ? * * *)",
"StartWindowMinutes": 480,
"CompletionWindowMinutes": 10080,
"Lifecycle": {
"DeleteAfterDays": 20
},
"CopyActions": [{
"DestinationBackupVaultArn": "arn:aws:backup:eu-west-2:987654321:backup-vault:secondary",
"Lifecycle": {
"DeleteAfterDays": 20
}
}]
}]
}

Here for the ScheduleExpression field, we need to set the value according to the recovery point objective of the organization and for the Lifecycle field, we can enter a value based on the retention policy of your backup.

4. Run the create-backup-plan command and then we need to pass the JSON file as an input parameter and note the value for BackupPlanId from the output of the command.

aws backup create-backup-plan --backup-plan file://

5. Then we need to create a JSON file that sets the parameters to assign the resources to the backup plan. To specify resources for a backup plan., we can use ARNs, tags, or both.

{
"SelectionName": "Myselection",
"IamRoleArn": "arn:aws:iam::987654321:role/service-role/AWSBackupDefaultServiceRole",
"Resources": ["arn:aws:ec2:eu-west-1:987654321:volume/vol-0abcdef9876"],
"ListOfTags": [{
"ConditionType": "STRINGEQUALS",
"ConditionKey": "backup",
"ConditionValue": "yes"
}]
}

6. Then run the create-backup-selection command and pass the JSON file as an input parameter:

aws backup create-backup-selection --backup-plan-id abcd-efgh-ijkl-mnop --backup-selection file://

Here for backup-plan-id, enter the value of BackupPlanId.
 

On-demand job on AWS Backup

 
We need to run the start-backup-job command to run an on-demand backup job.

aws backup start-backup-job --backup-vault-name primary --resource-arn arn:aws:ec2:eu-west-1:987654321:volume/vol-0abcdef1234 --iam-role-arn arn:aws:iam::987654321:role/service-role/AWSBackupDefaultServiceRole --idempotency-token 623f13d2-78d2-11ea-bc58-0252ac130009 --start-window-minutes 60 --complete-window-minutes 10080 --lifecycle DeleteAfterDays=30 --region eu-west-1

Here the value idempotency-token is a unique string that we provide to distinguish between StartBackupJob calls. We can generate a unique identifier by running the uuid command on Linux OS.

We need to run the start-copy-job command to run an on-demand copy job

aws backup start-copy-job --recovery-point-arn arn:aws:ec2:eu-west-1::snapshot/snap-0abcdaf2247b33dbc --source-backup-vault-name primary --destination-backup-vault-arn arn:aws:backup:eu-west-2:987654321:backup-vault:secondary --iam-role-arn arn:aws:iam::987654321:role/service-role/AWSBackupDefaultServiceRole --idempotency-token 5aac8974-78d2-11ea-bc55-0242ac130009 --lifecycle DeleteAfterDays=30 --region eu-west-1

Here the command runs a job that copies the recovery point from the source vault (primary) to a destination vault (secondary).

Run the start-restore-job command to start a restore job. We can use the following steps to start a restore job for an Amazon EBS volume.

 

  1. First, run the get-recovery-point-restore-metadata command on the recovery point and note the values for volume ID and encryption from the output of the command.
aws backup get-recovery-point-restore-metadata --backup-vault-name primary --recovery-point-arn arn:aws:ec2:eu-west-1::snapshot/snap-0abcdaf2247b33dbc

2. Then create a JSON file that sets the parameters for the required –metadata option of the start-restore-job command. For encrypted and volumeId, enter the values that we noted in step

{
"availabilityZone":"eu-west-1a",
"encrypted":"false",
"volumeId":"vol-0ck270d4c0b2e44c9",
"volumeSize":"100",
"volumeType":"gp2"
}

4. Then run the start-restore-job command and pass the JSON file as an input parameter:

aws backup start-restore-job --recovery-point-arn arn:aws:ec2:eu-west-1::snapshot/snap-0abcdaf2247b33dbc --metadata file:// --iam-role-arn arn:aws:iam::987654321:role/service-role/AWSBackupDefaultServiceRole --idempotency-token 52e602ce-78d2-11ea-bc55-0242ac130003 --resource-type EBS --region eu-west-1

[Need help with more AWS queries? We’d be happy to assist]
 

Conclusion

 
To conclude, today we discussed the steps followed by our Support Engineers to help our customers to create an AWS Backup plan with AWS CLI.

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • What Is Proactive Monitoring? A Complete Guide
  • AI Use Cases: How Artificial Intelligence Is Used Across Industries
  • Turn Manual Business Processes into Automation-Driven Growth
  • Digitalization of Business to Speed Up Operations and Support Faster Scaling
  • Cloud Cost Optimization Best Practices: Everything You Need to Know in 2026

Categories

  • Advanced Vulnerability
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • Cloud Cost Optimization
  • Cloud Management
  • Cloud-Native Application
  • Cloudflare
  • cPanel
  • cPanel migration
  • Cyberpanel
  • DDoS
  • Development Service
  • DevOps
  • DevOps Consulting
  • DevSecOps
  • Digital Transformation
  • DigitalOcean
  • DirectAdmin
  • Docker
  • Drupal
  • Ecommerce
  • Filezilla
  • FTP
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • Software Testing
  • SQLServer
  • Technical Support
  • UI/UX
  • Virtualizor
  • VMware
  • VPN
  • Vulnerability Scanning
  • Vultr
  • Web Development
  • Windows
  • WordPress
  • WordPress Hosting
  • WordPressHA

Subscribe to our newsletter

Footer newsletter

Email sales@bobcares.com | Phone 1-800-383-5193

Product Engineering

  • MVP Build
  • MVP to Scale
  • Product Maintenance

Digital Transformation

  • Process Digitization & Automation
  • Systems Integration & Workflow Orchestration
  • Data Enablement & Decision Support
  • Application & Platform Modernization
  • Transformation Execution & Delivery Enablement

AI Services

  • AI Readiness & Use-Case Discovery
  • AI Integration & Application Enablement
  • Intelligent Automation & AI Workflows

Infrastructure Management

  • Always-On Infrastructure Management
  • Proactive Monitoring & Incident Prevention
  • Cloud Cost Control & Optimization (FinOps)
  • Outsourced IT & End-User Support
  • Managed Infrastructure Execution Support

DevOps & Automation Services

  • CI/CD & Release Automation
  • Infrastructure as Code & Platform Standardization
  • Reliability Engineering & Observability
  • DevSecOps Enablement
Product Engineering +
Web Development MVP to Scale Builds Microservices Architecture Agile & Dev Team Augmentation Mobile Apps Ecommerce UI/UX Design QA & Test Automation
Digital Transformation +
Legacy Modernization Workflow Automation Data-Driven Dashboards CRM / ERP Integration Business Process Re-engineering
AI Services +
AI & Machine Learning AIOps Intelligent Automation Business Intelligence & Analytics AI Installation & Compute
Infrastructure Management +
Cloud Setup Cloud Migration Managed Cloud Services Server & Hosting Cost Optimization Performance Optimization Outsourced Support
DevOps & Automation Services +
CI/CD Setup Kubernetes & Docker Infrastructure as Code Cloud-Native Migration DevSecOps
Cybersecurity & Compliance Services +
Security Hardening VAPT Incident Response Backup & DR

© 2026 Bobcares. All Rights Reserved.

  • Careers
  • |
  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms and Service
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook

Preview of the new Bobcares experience
NEW UPDATE
See What’s New
at Bobcares

Discover a faster, clearer view of our services and expertise.


Explore the New Experience
Arrow Right