# BackupSelectionResourceTypeProperty

Specifies an object containing properties used to assign a set of resources to a backup plan.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## 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';

declare const conditions: any;
const backupSelectionResourceTypeProperty: backup.CfnBackupSelection.BackupSelectionResourceTypeProperty = {
  iamRoleArn: 'iamRoleArn',
  selectionName: 'selectionName',

  // the properties below are optional
  conditions: conditions,
  listOfTags: [{
    conditionKey: 'conditionKey',
    conditionType: 'conditionType',
    conditionValue: 'conditionValue',
  }],
  notResources: ['notResources'],
  resources: ['resources'],
};
```

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

# conditions: Any

backup_selection_resource_type_property = backup.CfnBackupSelection.BackupSelectionResourceTypeProperty(
    iam_role_arn="iamRoleArn",
    selection_name="selectionName",

    # the properties below are optional
    conditions=conditions,
    list_of_tags=[backup.CfnBackupSelection.ConditionResourceTypeProperty(
        condition_key="conditionKey",
        condition_type="conditionType",
        condition_value="conditionValue"
    )],
    not_resources=["notResources"],
    resources=["resources"]
)
```

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.*;

Object conditions;

BackupSelectionResourceTypeProperty backupSelectionResourceTypeProperty = BackupSelectionResourceTypeProperty.builder()
        .iamRoleArn("iamRoleArn")
        .selectionName("selectionName")

        // the properties below are optional
        .conditions(conditions)
        .listOfTags(List.of(ConditionResourceTypeProperty.builder()
                .conditionKey("conditionKey")
                .conditionType("conditionType")
                .conditionValue("conditionValue")
                .build()))
        .notResources(List.of("notResources"))
        .resources(List.of("resources"))
        .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;

var conditions;

var backupSelectionResourceTypeProperty = new BackupSelectionResourceTypeProperty {
    IamRoleArn = "iamRoleArn",
    SelectionName = "selectionName",

    // the properties below are optional
    Conditions = conditions,
    ListOfTags = new [] { new ConditionResourceTypeProperty {
        ConditionKey = "conditionKey",
        ConditionType = "conditionType",
        ConditionValue = "conditionValue"
    } },
    NotResources = new [] { "notResources" },
    Resources = new [] { "resources" }
};
```

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"

var conditions interface{}

backupSelectionResourceTypeProperty := &BackupSelectionResourceTypeProperty{
	IamRoleArn: jsii.String("iamRoleArn"),
	SelectionName: jsii.String("selectionName"),

	// the properties below are optional
	Conditions: conditions,
	ListOfTags: []interface{}{
		&ConditionResourceTypeProperty{
			ConditionKey: jsii.String("conditionKey"),
			ConditionType: jsii.String("conditionType"),
			ConditionValue: jsii.String("conditionValue"),
		},
	},
	NotResources: []*string{
		jsii.String("notResources"),
	},
	Resources: []*string{
		jsii.String("resources"),
	},
}
```

## Properties

- `conditions`: any — A list of conditions that you define to assign resources to your backup plans using tags.

  For example, `"StringEquals": { "ConditionKey": "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" },` . Condition operators are case sensitive.

  `Conditions` differs from `ListOfTags` as follows:

  - When you specify more than one condition, you only assign the resources that match ALL conditions (using AND logic).
  - `Conditions` supports `StringEquals` , `StringLike` , `StringNotEquals` , and `StringNotLike` . `ListOfTags` only supports `StringEquals` .

- `iamRoleArn`: string (required) — The ARN of the IAM role that AWS Backup uses to authenticate when backing up the target resource;

  for example, `arn:aws:iam::123456789012:role/S3Access` .

- `listOfTags`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBackupSelection.ConditionResourceTypeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_backup.CfnBackupSelection.ConditionResourceTypeProperty.html)[] — A list of conditions that you define to assign resources to your backup plans using tags.

  For example, `"StringEquals": { "ConditionKey": "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" },` . Condition operators are case sensitive.

  `ListOfTags` differs from `Conditions` as follows:

  - When you specify more than one condition, you assign all resources that match AT LEAST ONE condition (using OR logic).
  - `ListOfTags` only supports `StringEquals` . `Conditions` supports `StringEquals` , `StringLike` , `StringNotEquals` , and `StringNotLike` .

- `notResources`: string[] — A list of Amazon Resource Names (ARNs) to exclude from a backup plan.

  The maximum number of ARNs is 500 without wildcards, or 30 ARNs with wildcards.

  If you need to exclude many resources from a backup plan, consider a different resource selection strategy, such as assigning only one or a few resource types or refining your resource selection using tags.

- `resources`: string[] — An array of strings that contain Amazon Resource Names (ARNs) of resources to assign to a backup plan.

- `selectionName`: string (required) — The display name of a resource selection document.
