TagManager¶
-
class
aws_cdk.core.
TagManager
(tag_type, resource_type_name, tag_structure=None, *, tag_property_name=None)¶ Bases:
object
TagManager facilitates a common implementation of tagging for Constructs.
- Parameters
tag_type (
TagType
) –resource_type_name (
str
) –tag_structure (
Optional
[Any
]) –tag_property_name (
Optional
[str
]) – The name of the property in CloudFormation for these tags. Normally this istags
, but Cognito UserPool uses UserPoolTags Default: “tags”
Methods
-
apply_tag_aspect_here
(include=None, exclude=None)¶ Determine if the aspect applies here.
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
- Parameters
include (
Optional
[List
[str
]]) –exclude (
Optional
[List
[str
]]) –
- Return type
bool
Returns true if there are any tags defined.
- Return type
bool
-
remove_tag
(key, priority)¶ Removes the specified tag from the array if it exists.
- Parameters
key (
str
) – The tag to remove.priority (
Union
[int
,float
]) – The priority of the remove operation.
- Return type
None
Renders tags into the proper format based on TagType.
- Return type
Any
-
set_tag
(key, value, priority=None, apply_to_launched_instances=None)¶ Adds the specified tag to the array of tags.
- Parameters
key (
str
) –value (
str
) –priority (
Union
[int
,float
,None
]) –apply_to_launched_instances (
Optional
[bool
]) –
- Return type
None
-
tag_values
()¶ Render the tags in a readable format.
- Return type
Mapping
[str
,str
]
Attributes
-
tag_property_name
¶ The property name for tag values.
Normally this is
tags
but some resources choose a different name. Cognito UserPool uses UserPoolTags- Return type
str
Static Methods
-
classmethod
is_taggable
(construct)¶ Check whether the given construct is Taggable.
- Parameters
construct (
Any
) –- Return type
bool