Created
June 1, 2021 14:35
-
-
Save badfun/05a6a53282938c5c3991c912f9818fbe to your computer and use it in GitHub Desktop.
AWS Backup plan with WindowsVSS and copy to another account enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Backup plan using L1 construct since advanced features not supported at this time | |
const plan = new CfnBackupPlan(this, 'CriticalResourceBackupPlan', { | |
backupPlan: { | |
advancedBackupSettings: [ | |
{ | |
backupOptions: { WindowsVSS: 'enabled' }, | |
resourceType: 'EC2', | |
}, | |
], | |
backupPlanName: 'CriticalResourceBackup', | |
backupPlanRule: [ | |
{ | |
ruleName: 'DailyBackup', | |
targetBackupVault: vault.backupVaultName, | |
scheduleExpression: 'cron(0 5 * * ? *)', | |
lifecycle: { | |
deleteAfterDays: 35, | |
}, | |
copyActions: [ | |
{ | |
destinationBackupVaultArn: | |
'arn:aws:backup:us-west-2:010101010101:backup-vault:CriticalResourcesCopy', | |
lifecycle: { | |
deleteAfterDays: 35, | |
}, | |
}, | |
], | |
recoveryPointTags: { 'scope': 'recovery' }, | |
}, | |
{ | |
ruleName: 'MonthlyOneYearRetention', | |
targetBackupVault: vault.backupVaultName, | |
scheduleExpression: 'cron(0 11 1 * ? *)', | |
lifecycle: { | |
moveToColdStorageAfterDays: 35, | |
deleteAfterDays: 365, | |
}, | |
copyActions: [ | |
{ | |
destinationBackupVaultArn: | |
'arn:aws:backup:us-west-2:010101010101:CriticalResourcesCopy', | |
lifecycle: { | |
moveToColdStorageAfterDays: 35, | |
deleteAfterDays: 365, | |
}, | |
}, | |
], | |
recoveryPointTags: { 'scope': 'recovery' }, | |
}, | |
], | |
}, | |
backupPlanTags: { 'scope': 'backup' }, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment