115 lines
3.4 KiB
TypeScript
115 lines
3.4 KiB
TypeScript
import type { Construct } from 'constructs';
|
|
import { BackupPlanRule } from './rule';
|
|
import type { BackupSelectionOptions } from './selection';
|
|
import { BackupSelection } from './selection';
|
|
import type { IBackupVault } from './vault';
|
|
import type { IResource } from '../../core';
|
|
import { Resource } from '../../core';
|
|
import type { BackupPlanReference, IBackupPlanRef, IBackupVaultRef } from '../../interfaces/generated/aws-backup-interfaces.generated';
|
|
/**
|
|
* A backup plan
|
|
*/
|
|
export interface IBackupPlan extends IResource, IBackupPlanRef {
|
|
/**
|
|
* The identifier of the backup plan.
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly backupPlanId: string;
|
|
}
|
|
/**
|
|
* Properties for a BackupPlan
|
|
*/
|
|
export interface BackupPlanProps {
|
|
/**
|
|
* The display name of the backup plan.
|
|
*
|
|
* @default - A CDK generated name
|
|
*/
|
|
readonly backupPlanName?: string;
|
|
/**
|
|
* The backup vault where backups are stored
|
|
*
|
|
* @default - use the vault defined at the rule level. If not defined a new
|
|
* common vault for the plan will be created
|
|
*/
|
|
readonly backupVault?: IBackupVaultRef;
|
|
/**
|
|
* Rules for the backup plan. Use `addRule()` to add rules after
|
|
* instantiation.
|
|
*
|
|
* @default - use `addRule()` to add rules
|
|
*/
|
|
readonly backupPlanRules?: BackupPlanRule[];
|
|
/**
|
|
* Enable Windows VSS backup.
|
|
*
|
|
* @see https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html
|
|
*
|
|
* @default false
|
|
*/
|
|
readonly windowsVss?: boolean;
|
|
}
|
|
/**
|
|
* A backup plan
|
|
*/
|
|
export declare class BackupPlan extends Resource implements IBackupPlan {
|
|
/** Uniquely identifies this class. */
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
/**
|
|
* Import an existing backup plan
|
|
*/
|
|
static fromBackupPlanId(scope: Construct, id: string, backupPlanId: string): IBackupPlan;
|
|
/**
|
|
* Daily with 35 day retention
|
|
*/
|
|
static daily35DayRetention(scope: Construct, id: string, backupVault?: IBackupVaultRef): BackupPlan;
|
|
/**
|
|
* Daily and monthly with 1 year retention
|
|
*/
|
|
static dailyMonthly1YearRetention(scope: Construct, id: string, backupVault?: IBackupVaultRef): BackupPlan;
|
|
/**
|
|
* Daily, weekly and monthly with 5 year retention
|
|
*/
|
|
static dailyWeeklyMonthly5YearRetention(scope: Construct, id: string, backupVault?: IBackupVaultRef): BackupPlan;
|
|
/**
|
|
* Daily, weekly and monthly with 7 year retention
|
|
*/
|
|
static dailyWeeklyMonthly7YearRetention(scope: Construct, id: string, backupVault?: IBackupVaultRef): BackupPlan;
|
|
readonly backupPlanId: string;
|
|
/**
|
|
* The ARN of the backup plan
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly backupPlanArn: string;
|
|
/**
|
|
* Version Id
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly versionId: string;
|
|
get backupPlanRef(): BackupPlanReference;
|
|
private readonly rules;
|
|
private _backupVault?;
|
|
constructor(scope: Construct, id: string, props?: BackupPlanProps);
|
|
private advancedBackupSettings;
|
|
/**
|
|
* Adds a rule to a plan
|
|
*
|
|
* @param rule the rule to add
|
|
*/
|
|
addRule(rule: BackupPlanRule): void;
|
|
private planCopyActions;
|
|
/**
|
|
* The backup vault where backups are stored if not defined at
|
|
* the rule level
|
|
*/
|
|
get backupVault(): IBackupVault;
|
|
/**
|
|
* Adds a selection to this plan
|
|
*/
|
|
addSelection(id: string, options: BackupSelectionOptions): BackupSelection;
|
|
private validatePlan;
|
|
}
|