BackupResource

class aws_cdk.aws_backup.BackupResource(resource=None, tag_condition=None, construct=None)

Bases: object

A resource to backup.

ExampleMetadata

infused

Example:

# plan: backup.BackupPlan

my_table = dynamodb.Table.from_table_name(self, "Table", "myTableName")
my_cool_construct = Construct(self, "MyCoolConstruct")

plan.add_selection("Selection",
    resources=[
        backup.BackupResource.from_dynamo_db_table(my_table),  # A DynamoDB table
        backup.BackupResource.from_tag("stage", "prod"),  # All resources that are tagged stage=prod in the region/account
        backup.BackupResource.from_construct(my_cool_construct)
    ]
)
Parameters
  • resource (Optional[str]) –

  • tag_condition (Union[TagCondition, Dict[str, Any], None]) –

  • construct (Optional[Construct]) –

Attributes

construct

A construct.

Return type

Optional[Construct]

resource

A resource.

Return type

Optional[str]

tag_condition

A condition on a tag.

Return type

Optional[TagCondition]

Static Methods

classmethod from_arn(arn)

A list of ARNs or match patterns such as arn:aws:ec2:us-east-1:123456789012:volume/*.

Parameters

arn (str) –

Return type

BackupResource

classmethod from_construct(construct)

Adds all supported resources in a construct.

Parameters

construct (Construct) – The construct containing resources to backup.

Return type

BackupResource

classmethod from_dynamo_db_table(table)

A DynamoDB table.

Parameters

table (ITable) –

Return type

BackupResource

classmethod from_ec2_instance(instance)

An EC2 instance.

Parameters

instance (IInstance) –

Return type

BackupResource

classmethod from_efs_file_system(file_system)

An EFS file system.

Parameters

file_system (IFileSystem) –

Return type

BackupResource

classmethod from_rds_database_instance(instance)

A RDS database instance.

Parameters

instance (IDatabaseInstance) –

Return type

BackupResource

classmethod from_tag(key, value, operation=None)

A tag condition.

Parameters
  • key (str) –

  • value (str) –

  • operation (Optional[TagOperation]) –

Return type

BackupResource