Skip to content

Instantly share code, notes, and snippets.

@badfun
Created June 1, 2021 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badfun/05a6a53282938c5c3991c912f9818fbe to your computer and use it in GitHub Desktop.
Save badfun/05a6a53282938c5c3991c912f9818fbe to your computer and use it in GitHub Desktop.
AWS Backup plan with WindowsVSS and copy to another account enabled
// 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