class Tag
Language | Type name |
---|---|
![]() | Amazon.CDK.Tag |
![]() | software.amazon.awscdk.core.Tag |
![]() | aws_cdk.core.Tag |
![]() | @aws-cdk/core » 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/core';
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
- value
string
- props
Tag
Props
Properties
Name | Type | Description |
---|---|---|
key | string | The string key for the tag. |
props | Tag | |
value | string | The string value of the tag. |
key
Type:
string
The string key for the tag.
props
Type:
Tag
value
Type:
string
The string value of the tag.
Methods
Name | Description |
---|---|
visit(construct) | All aspects can visit an IConstruct. |
protected apply | |
static add(scope, key, value, props?) | DEPRECATED: add tags to the node of a construct and all its the taggable children. |
static remove(scope, key, props?) | DEPRECATED: remove tags to the node of a construct and all its the taggable children. |
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
static add(scope, key, value, props?)
public static add(scope: Construct, key: string, value: string, props?: TagProps): void
⚠️ Deprecated: use Tags.of(scope).add()
Parameters
DEPRECATED: add tags to the node of a construct and all its the taggable children.
static remove(scope, key, props?)
public static remove(scope: Construct, key: string, props?: TagProps): void
⚠️ Deprecated: use Tags.of(scope).remove()
Parameters
DEPRECATED: remove tags to the node of a construct and all its the taggable children.