TagManager
TagManager facilitates a common implementation of tagging for Constructs.
Initializers
import { TagManager } from '@alicloud/ros-cdk-core'
new TagManager(tagType: TagType, resourceTypeName: string, tagStructure?: any, options?: TagManagerOptions)
Name | Type | Description |
---|---|---|
tagType |
TagType |
No description. |
resourceTypeName |
string |
No description. |
tagStructure |
any |
No description. |
options |
TagManagerOptions |
No description. |
tagType
Required
- Type: TagType
resourceTypeName
Required
- Type: string
tagStructure
Optional
- Type: any
options
Optional
- Type: TagManagerOptions
Methods
Name | Description |
---|---|
applyTagAspectHere |
Determine if the aspect applies here. |
hasTags |
Returns true if there are any tags defined. |
removeTag |
Removes the specified tag from the array if it exists. |
renderTags |
Renders tags into the proper format based on TagType. |
setTag |
Adds the specified tag to the array of tags. |
tagValues |
Render the tags in a readable format. |
applyTagAspectHere
public applyTagAspectHere(include?: string[], exclude?: string[]): boolean
Determine if the aspect applies here.
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
- Type: string[]
- Type: string[]
hasTags
public hasTags(): boolean
Returns true if there are any tags defined.
removeTag
public removeTag(key: string, priority: number): void
Removes the specified tag from the array if it exists.
- Type: string
The tag to remove.
- Type: number
The priority of the remove operation.
renderTags
public renderTags(): any
Renders tags into the proper format based on TagType.
setTag
public setTag(key: string, value: string, priority?: number, applyToLaunchedInstances?: boolean): void
Adds the specified tag to the array of tags.
- Type: string
- Type: string
- Type: number
applyToLaunchedInstances
Optional
- Type: boolean
tagValues
public tagValues(): {[ key: string ]: string}
Render the tags in a readable format.
Static Functions
Name | Description |
---|---|
isTaggable |
Check whether the given construct is Taggable. |
isTaggable
import { TagManager } from '@alicloud/ros-cdk-core'
TagManager.isTaggable(construct: any)
Check whether the given construct is Taggable.
- Type: any
Properties
Name | Type | Description |
---|---|---|
tagPropertyName |
string |
The property name for tag values. |
tagPropertyName
Required
public readonly tagPropertyName: string;
- Type: string
The property name for tag values.
Normally this is tags
but some resources choose a different name. Cognito
UserPool uses UserPoolTags