# Tag

Metadata that you apply to a resource to help categorize and organize the resource.

Each tag consists of a key and an optional value, both of which you define.

- Source: [`aws-scheduler-targets/lib/ecs-run-task.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-scheduler-targets/lib/ecs-run-task.ts#L14)
- Type last changed: v2.186.0 · 27 Mar 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_scheduler_targets as scheduler_targets } from 'aws-cdk-lib';
const tag: scheduler_targets.Tag = {
  key: 'key',
  value: 'value',
};
```

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_scheduler_targets as scheduler_targets

tag = scheduler_targets.Tag(
    key="key",
    value="value"
)
```

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

Tag tag = Tag.builder()
        .key("key")
        .value("value")
        .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.Scheduler.Targets;

var tag = new Tag {
    Key = "key",
    Value = "value"
};
```

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"

tag := &Tag{
	Key: jsii.String("key"),
	Value: jsii.String("value"),
}
```

## Properties

- `key`: string (required) — Key is the name of the tag.

- `value`: string (required) — Value is the metadata contents of the tag.
