@aws-cdk/core
Version:
AWS Cloud Development Kit Core Library
48 lines (47 loc) • 1.41 kB
TypeScript
import { TagType } from './cfn-resource';
/**
* Interface to implement tags.
*/
export interface ITaggable {
/**
* TagManager to set, remove and format tags
*/
readonly tags: TagManager;
}
/**
* TagManager facilitates a common implementation of tagging for Constructs.
*/
export declare class TagManager {
/**
* Check whether the given construct is Taggable
*/
static isTaggable(construct: any): construct is ITaggable;
private readonly tags;
private readonly priorities;
private readonly tagFormatter;
private readonly resourceTypeName;
private readonly initialTagPriority;
constructor(tagType: TagType, resourceTypeName: string, tagStructure?: any);
/**
* Adds the specified tag to the array of tags
*
*/
setTag(key: string, value: string, priority?: number, applyToLaunchedInstances?: boolean): void;
/**
* Removes the specified tag from the array if it exists
*
* @param key The tag to remove
* @param priority The priority of the remove operation
*/
removeTag(key: string, priority: number): void;
/**
* Renders tags into the proper format based on TagType
*/
renderTags(): any;
applyTagAspectHere(include?: string[], exclude?: string[]): boolean;
/**
* Returns true if there are any tags defined
*/
hasTags(): boolean;
private _setTag;
}