class BackupResource
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Backup.BackupResource |
Java | software.amazon.awscdk.services.backup.BackupResource |
Python | aws_cdk.aws_backup.BackupResource |
TypeScript (source) | @aws-cdk/aws-backup » BackupResource |
A resource to backup.
Example
declare const plan: backup.BackupPlan;
const myTable = dynamodb.Table.fromTableName(this, 'Table', 'myTableName');
const myCoolConstruct = new Construct(this, 'MyCoolConstruct');
plan.addSelection('Selection', {
resources: [
backup.BackupResource.fromDynamoDbTable(myTable), // A DynamoDB table
backup.BackupResource.fromTag('stage', 'prod'), // All resources that are tagged stage=prod in the region/account
backup.BackupResource.fromConstruct(myCoolConstruct), // All backupable resources in `myCoolConstruct`
]
})
Initializer
new BackupResource(resource?: string, tagCondition?: TagCondition, construct?: Construct)
Parameters
- resource
string
- tagCondition
Tag
Condition - construct
Construct
Properties
Name | Type | Description |
---|---|---|
construct? | Construct | A construct. |
resource? | string | A resource. |
tag | Tag | A condition on a tag. |
construct?
Type:
Construct
(optional)
A construct.
resource?
Type:
string
(optional)
A resource.
tagCondition?
Type:
Tag
(optional)
A condition on a tag.
Methods
Name | Description |
---|---|
static from | A list of ARNs or match patterns such as arn:aws:ec2:us-east-1:123456789012:volume/* . |
static from | Adds all supported resources in a construct. |
static from | A DynamoDB table. |
static from | An EC2 instance. |
static from | An EFS file system. |
static from | A RDS database instance. |
static from | A tag condition. |
static fromArn(arn)
public static fromArn(arn: string): BackupResource
Parameters
- arn
string
Returns
A list of ARNs or match patterns such as arn:aws:ec2:us-east-1:123456789012:volume/*
.
static fromConstruct(construct)
public static fromConstruct(construct: Construct): BackupResource
Parameters
- construct
Construct
— The construct containing resources to backup.
Returns
Adds all supported resources in a construct.
static fromDynamoDbTable(table)
public static fromDynamoDbTable(table: ITable): BackupResource
Parameters
- table
ITable
Returns
A DynamoDB table.
static fromEc2Instance(instance)
public static fromEc2Instance(instance: IInstance): BackupResource
Parameters
- instance
IInstance
Returns
An EC2 instance.
static fromEfsFileSystem(fileSystem)
public static fromEfsFileSystem(fileSystem: IFileSystem): BackupResource
Parameters
- fileSystem
IFile
System
Returns
An EFS file system.
static fromRdsDatabaseInstance(instance)
public static fromRdsDatabaseInstance(instance: IDatabaseInstance): BackupResource
Parameters
- instance
IDatabase
Instance
Returns
A RDS database instance.
static fromTag(key, value, operation?)
public static fromTag(key: string, value: string, operation?: TagOperation): BackupResource
Parameters
- key
string
- value
string
- operation
Tag
Operation
Returns
A tag condition.