# BackupSelectionProps

Properties for a BackupSelection.

Extends: [BackupSelectionOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_backup.BackupSelectionOptions.html)
Used as props by: [BackupSelection](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_backup.BackupSelection.html)

- Source: [`aws-backup/lib/selection.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-backup/lib/selection.ts#L66)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_backup as backup } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_backup as interfaces_backup } from 'aws-cdk-lib/interfaces';

declare const backupPlanRef: interfaces_backup.IBackupPlanRef;
declare const backupResource: backup.BackupResource;
declare const role: iam.Role;
const backupSelectionProps: backup.BackupSelectionProps = {
  backupPlan: backupPlanRef,
  resources: [backupResource],

  // the properties below are optional
  allowRestores: false,
  backupSelectionName: 'backupSelectionName',
  disableDefaultBackupPolicy: false,
  role: role,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_backup as backup
from aws_cdk import aws_iam as iam
from aws_cdk.interfaces import aws_backup as interfaces_backup

# backup_plan_ref: interfaces_backup.IBackupPlanRef
# backup_resource: backup.BackupResource
# role: iam.Role

backup_selection_props = backup.BackupSelectionProps(
    backup_plan=backup_plan_ref,
    resources=[backup_resource],

    # the properties below are optional
    allow_restores=False,
    backup_selection_name="backupSelectionName",
    disable_default_backup_policy=False,
    role=role
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.backup.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.interfaces.backup.*;

IBackupPlanRef backupPlanRef;
BackupResource backupResource;
Role role;

BackupSelectionProps backupSelectionProps = BackupSelectionProps.builder()
        .backupPlan(backupPlanRef)
        .resources(List.of(backupResource))

        // the properties below are optional
        .allowRestores(false)
        .backupSelectionName("backupSelectionName")
        .disableDefaultBackupPolicy(false)
        .role(role)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Backup;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.Interfaces.Backup;

IBackupPlanRef backupPlanRef;
BackupResource backupResource;
Role role;

var backupSelectionProps = new BackupSelectionProps {
    BackupPlan = backupPlanRef,
    Resources = new [] { backupResource },

    // the properties below are optional
    AllowRestores = false,
    BackupSelectionName = "backupSelectionName",
    DisableDefaultBackupPolicy = false,
    Role = role
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var backupPlanRef IBackupPlanRef
var backupResource BackupResource
var role Role

backupSelectionProps := &BackupSelectionProps{
	BackupPlan: backupPlanRef,
	Resources: []BackupResource{
		backupResource,
	},

	// the properties below are optional
	AllowRestores: jsii.Boolean(false),
	BackupSelectionName: jsii.String("backupSelectionName"),
	DisableDefaultBackupPolicy: jsii.Boolean(false),
	Role: role,
}
```

## Properties

- `allowRestores`: boolean = false — 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.

- `backupPlan`: [IBackupPlanRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_backup.IBackupPlanRef.html) (required) — The backup plan for this selection.

- `backupSelectionName`: string — The name for this selection.

  **Default:** a CDK generated name

- `disableDefaultBackupPolicy`: boolean = false — Whether to disable automatically assigning default backup permissions to the role that AWS Backup uses.

  If `false`, the `AWSBackupServiceRolePolicyForBackup` managed policy will be
  attached to the role.

- `resources`: [BackupResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_backup.BackupResource.html)[] (required) — The resources to backup.

  Use the helper static methods defined on `BackupResource`.

- `role`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role that AWS Backup uses to authenticate when backuping or restoring the resources.

  **Default:** a new role will be created

  The `AWSBackupServiceRolePolicyForBackup` managed policy
  will be attached to this role unless `disableDefaultBackupPolicy`
  is set to `true`.
