# TagCondition

A tag condition.

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

- Source: [`aws-backup/lib/resource.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-backup/lib/resource.ts#L26)

## 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';
const tagCondition: backup.TagCondition = {
  key: 'key',
  value: 'value',

  // the properties below are optional
  operation: backup.TagOperation.STRING_EQUALS,
};
```

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

tag_condition = backup.TagCondition(
    key="key",
    value="value",

    # the properties below are optional
    operation=backup.TagOperation.STRING_EQUALS
)
```

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

TagCondition tagCondition = TagCondition.builder()
        .key("key")
        .value("value")

        // the properties below are optional
        .operation(TagOperation.STRING_EQUALS)
        .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 tagCondition = new TagCondition {
    Key = "key",
    Value = "value",

    // the properties below are optional
    Operation = TagOperation.STRING_EQUALS
};
```

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"

tagCondition := &TagCondition{
	Key: jsii.String("key"),
	Value: jsii.String("value"),

	// the properties below are optional
	Operation: awscdk.Aws_backup.TagOperation_STRING_EQUALS,
}
```

## Properties

- `key`: string (required) — The key in a key-value pair.

  For example, in `"ec2:ResourceTag/Department": "accounting"`,
  `ec2:ResourceTag/Department` is the key.

- `operation`: [TagOperation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_backup.TagOperation.html) = STRING_EQUALS — An operation that is applied to a key-value pair used to filter resources in a selection.

- `value`: string (required) — The value in a key-value pair.

  For example, in `"ec2:ResourceTag/Department": "accounting"`,
  `accounting` is the value.
