aws-cdk-lib.Tag

class Tag

LanguageType name
.NETAmazon.CDK.Tag
Gogithub.com/aws/aws-cdk-go/awscdk/v2#Tag
Javasoftware.amazon.awscdk.Tag
Pythonaws_cdk.Tag
TypeScript (source)aws-cdk-lib » Tag

Implements IAspect

The Tag Aspect will handle adding a tag to this node and cascading tags to children.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const tag = new cdk.Tag('key', 'value', /* all optional props */ {
  applyToLaunchedInstances: false,
  excludeResourceTypes: ['excludeResourceTypes'],
  includeResourceTypes: ['includeResourceTypes'],
  priority: 123,
});

Initializer

new Tag(key: string, value: string, props?: TagProps)

Parameters

  • key string — The string key for the tag.
  • value string
  • props TagProps

Properties

NameTypeDescription
keystringThe string key for the tag.
propsTagProps
valuestringThe string value of the tag.

key

Type: string

The string key for the tag.


props

Type: TagProps


value

Type: string

The string value of the tag.

Methods

NameDescription
visit(construct)All aspects can visit an IConstruct.
protected applyTag(resource)
protected applyTagV2(resource)

visit(construct)

public visit(construct: IConstruct): void

Parameters

  • construct IConstruct

All aspects can visit an IConstruct.


protected applyTag(resource)

protected applyTag(resource: ITaggable): void

Parameters

  • resource ITaggable

protected applyTagV2(resource)

protected applyTagV2(resource: ITaggableV2): void

Parameters

  • resource ITaggableV2