Bootstrap FreeKB - Amazon Web Services (AWS) - Create Backup Plan using the AWS CLI
Amazon Web Services (AWS) - Create Backup Plan using the AWS CLI


If you are not familiar with AWS Backup, check out my article Getting Started with AWS Backup.

This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws backup create-backup-plan command can be used to create a Backup Plan. In this example, the Backup Plan will create a daily backup with 35 days retention.

aws backup create-backup-plan \
--backup-plan "{\"BackupPlanName\":\"my-backup-plan\",\"Rules\":[{\"RuleName\":\"DailyBackups\",\"ScheduleExpression\":\"cron(0 5 ? * * *)\",\"StartWindowMinutes\":480,\"TargetBackupVaultName\":\"Default\",\"Lifecycle\":{\"DeleteAfterDays\":35}}]}"

 

After the backup plan has been created, the aws backup list-backup-plans can be used to list your Backup Plans.

~]$ aws backup list-backup-plans
{
    "BackupPlansList": [
        {
            "BackupPlanArn": "arn:aws:backup:us-east-1:123456789012:backup-plan:5e3807be-880e-4029-82c0-5beda0a82b3a",
            "BackupPlanId": "5e3807be-880e-4029-82c0-5beda0a82b3a",
            "CreationDate": "2024-05-27T05:34:11.016000+00:00",
            "VersionId": "NDg1MzFkMDAtOTE4OS00YjgwLWI3OTMtN2JkN2MxMjk3NGUz",
            "BackupPlanName": "my-daily-backup"
        }
    ]
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 5f0eeb in the box below so that we can be sure you are a human.