class BackupPlan (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Backup.BackupPlan |
Java | software.amazon.awscdk.services.backup.BackupPlan |
Python | aws_cdk.aws_backup.BackupPlan |
TypeScript (source) | @aws-cdk/aws-backup » BackupPlan |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IBackup
A backup plan.
Example
// Daily, weekly and monthly with 5 year retention
const plan = backup.BackupPlan.dailyWeeklyMonthly5YearRetention(this, 'Plan');
Initializer
new BackupPlan(scope: Construct, id: string, props?: BackupPlanProps)
Parameters
- scope
Construct
- id
string
- props
Backup
Plan Props
Construct Props
Name | Type | Description |
---|---|---|
backup | string | The display name of the backup plan. |
backup | Backup [] | Rules for the backup plan. |
backup | IBackup | The backup vault where backups are stored. |
windows | boolean | Enable Windows VSS backup. |
backupPlanName?
Type:
string
(optional, default: A CDK generated name)
The display name of the backup plan.
backupPlanRules?
Type:
Backup
[]
(optional, default: use addRule()
to add rules)
Rules for the backup plan.
Use addRule()
to add rules after
instantiation.
backupVault?
Type:
IBackup
(optional, default: use the vault defined at the rule level. If not defined a new
common vault for the plan will be created)
The backup vault where backups are stored.
windowsVss?
Type:
boolean
(optional, default: false)
Enable Windows VSS backup.
See also: https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html
Properties
Name | Type | Description |
---|---|---|
backup | string | The ARN of the backup plan. |
backup | string | The identifier of the backup plan. |
backup | IBackup | The backup vault where backups are stored if not defined at the rule level. |
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
version | string | Version Id. |
backupPlanArn
Type:
string
The ARN of the backup plan.
backupPlanId
Type:
string
The identifier of the backup plan.
backupVault
Type:
IBackup
The backup vault where backups are stored if not defined at the rule level.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
versionId
Type:
string
Version Id.
Methods
Name | Description |
---|---|
add | Adds a rule to a plan. |
add | Adds a selection to this plan. |
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
protected validate() | Validate the current construct. |
static daily35 | Daily with 35 day retention. |
static daily | Daily and monthly with 1 year retention. |
static daily | Daily, weekly and monthly with 5 year retention. |
static daily | Daily, weekly and monthly with 7 year retention. |
static from | Import an existing backup plan. |
Rule(rule)
addpublic addRule(rule: BackupPlanRule): void
Parameters
- rule
Backup
— the rule to add.Plan Rule
Adds a rule to a plan.
Selection(id, options)
addpublic addSelection(id: string, options: BackupSelectionOptions): BackupSelection
Parameters
- id
string
- options
Backup
Selection Options
Returns
Adds a selection to this plan.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
protected validate()
protected validate(): string[]
Returns
string[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
DayRetention(scope, id, backupVault?)
static daily35public static daily35DayRetention(scope: Construct, id: string, backupVault?: IBackupVault): BackupPlan
Parameters
- scope
Construct
- id
string
- backupVault
IBackup
Vault
Returns
Daily with 35 day retention.
Monthly1YearRetention(scope, id, backupVault?)
static dailypublic static dailyMonthly1YearRetention(scope: Construct, id: string, backupVault?: IBackupVault): BackupPlan
Parameters
- scope
Construct
- id
string
- backupVault
IBackup
Vault
Returns
Daily and monthly with 1 year retention.
WeeklyMonthly5YearRetention(scope, id, backupVault?)
static dailypublic static dailyWeeklyMonthly5YearRetention(scope: Construct, id: string, backupVault?: IBackupVault): BackupPlan
Parameters
- scope
Construct
- id
string
- backupVault
IBackup
Vault
Returns
Daily, weekly and monthly with 5 year retention.
WeeklyMonthly7YearRetention(scope, id, backupVault?)
static dailypublic static dailyWeeklyMonthly7YearRetention(scope: Construct, id: string, backupVault?: IBackupVault): BackupPlan
Parameters
- scope
Construct
- id
string
- backupVault
IBackup
Vault
Returns
Daily, weekly and monthly with 7 year retention.
BackupPlanId(scope, id, backupPlanId)
static frompublic static fromBackupPlanId(scope: Construct, id: string, backupPlanId: string): IBackupPlan
Parameters
- scope
Construct
- id
string
- backupPlanId
string
Returns
Import an existing backup plan.