BackupSelectionOptions

class aws_cdk.aws_backup.BackupSelectionOptions(*, resources, allow_restores=None, backup_selection_name=None, role=None)

Bases: object

Options for a BackupSelection.

Parameters:
  • resources (Sequence[BackupResource]) – The resources to backup. Use the helper static methods defined on BackupResource.

  • allow_restores (Optional[bool]) – Whether to automatically give restores permissions to the role that AWS Backup uses. If true, the AWSBackupServiceRolePolicyForRestores managed policy will be attached to the role. Default: false

  • backup_selection_name (Optional[str]) – The name for this selection. Default: - a CDK generated name

  • role (Optional[IRole]) – The role that AWS Backup uses to authenticate when backuping or restoring the resources. The AWSBackupServiceRolePolicyForBackup managed policy will be attached to this role. Default: - a new role will be created

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)
    ]
)

Attributes

allow_restores

Whether to automatically give restores permissions to the role that AWS Backup uses.

If true, the AWSBackupServiceRolePolicyForRestores managed policy will be attached to the role.

Default:

false

backup_selection_name

The name for this selection.

Default:
  • a CDK generated name

resources

The resources to backup.

Use the helper static methods defined on BackupResource.

role

The role that AWS Backup uses to authenticate when backuping or restoring the resources.

The AWSBackupServiceRolePolicyForBackup managed policy will be attached to this role.

Default:
  • a new role will be created