@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)",
date="2022-05-27T16:27:54.131Z")
public class TagManager
extends software.amazon.jsii.JsiiObject
Normally, you do not need to use this class, as the CloudFormation specification
will indicate which resources are taggable. However, sometimes you will need this
to make custom resources taggable. Used tagManager.renderedTags
to obtain a
value that will resolve to the tags at synthesis time.
Example:
import software.amazon.awscdk.core.*; public class MyConstruct extends Resource implements ITaggable { public final Object tags; public MyConstruct(Construct scope, String id) { super(scope, id); CfnResource.Builder.create(this, "Resource") .type("Whatever::The::Type") .properties(Map.of( // ... "Tags", this.tags.getRenderedTags())) .build(); } }
Modifier and Type | Class and Description |
---|---|
static class |
TagManager.Builder
A fluent builder for
TagManager . |
Modifier | Constructor and Description |
---|---|
protected |
TagManager(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
TagManager(software.amazon.jsii.JsiiObjectRef objRef) |
|
TagManager(TagType tagType,
java.lang.String resourceTypeName) |
|
TagManager(TagType tagType,
java.lang.String resourceTypeName,
java.lang.Object tagStructure) |
|
TagManager(TagType tagType,
java.lang.String resourceTypeName,
java.lang.Object tagStructure,
TagManagerOptions options) |
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
applyTagAspectHere()
Determine if the aspect applies here.
|
java.lang.Boolean |
applyTagAspectHere(java.util.List<java.lang.String> include)
Determine if the aspect applies here.
|
java.lang.Boolean |
applyTagAspectHere(java.util.List<java.lang.String> include,
java.util.List<java.lang.String> exclude)
Determine if the aspect applies here.
|
IResolvable |
getRenderedTags()
A lazy value that represents the rendered tags at synthesis time.
|
java.lang.String |
getTagPropertyName()
The property name for tag values.
|
java.lang.Boolean |
hasTags()
Returns true if there are any tags defined.
|
static java.lang.Boolean |
isTaggable(java.lang.Object construct)
Check whether the given construct is Taggable.
|
void |
removeTag(java.lang.String key,
java.lang.Number priority)
Removes the specified tag from the array if it exists.
|
java.lang.Object |
renderTags()
Renders tags into the proper format based on TagType.
|
void |
setTag(java.lang.String key,
java.lang.String value)
Adds the specified tag to the array of tags.
|
void |
setTag(java.lang.String key,
java.lang.String value,
java.lang.Number priority)
Adds the specified tag to the array of tags.
|
void |
setTag(java.lang.String key,
java.lang.String value,
java.lang.Number priority,
java.lang.Boolean applyToLaunchedInstances)
Adds the specified tag to the array of tags.
|
java.util.Map<java.lang.String,java.lang.String> |
tagValues()
Render the tags in a readable format.
|
protected TagManager(software.amazon.jsii.JsiiObjectRef objRef)
protected TagManager(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public TagManager(TagType tagType, java.lang.String resourceTypeName, java.lang.Object tagStructure, TagManagerOptions options)
tagType
- This parameter is required.resourceTypeName
- This parameter is required.tagStructure
- options
- public TagManager(TagType tagType, java.lang.String resourceTypeName, java.lang.Object tagStructure)
tagType
- This parameter is required.resourceTypeName
- This parameter is required.tagStructure
- public TagManager(TagType tagType, java.lang.String resourceTypeName)
tagType
- This parameter is required.resourceTypeName
- This parameter is required.public static java.lang.Boolean isTaggable(java.lang.Object construct)
construct
- This parameter is required.public java.lang.Boolean applyTagAspectHere(java.util.List<java.lang.String> include, java.util.List<java.lang.String> exclude)
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
include
- exclude
- public java.lang.Boolean applyTagAspectHere(java.util.List<java.lang.String> include)
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
include
- public java.lang.Boolean applyTagAspectHere()
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
public java.lang.Boolean hasTags()
public void removeTag(java.lang.String key, java.lang.Number priority)
key
- The tag to remove. This parameter is required.priority
- The priority of the remove operation. This parameter is required.public java.lang.Object renderTags()
This method will eagerly render the tags currently applied. In
most cases, you should be using tagManager.renderedTags
instead,
which will return a Lazy
value that will resolve to the correct
tags at synthesis time.
public void setTag(java.lang.String key, java.lang.String value, java.lang.Number priority, java.lang.Boolean applyToLaunchedInstances)
key
- This parameter is required.value
- This parameter is required.priority
- applyToLaunchedInstances
- public void setTag(java.lang.String key, java.lang.String value, java.lang.Number priority)
key
- This parameter is required.value
- This parameter is required.priority
- public void setTag(java.lang.String key, java.lang.String value)
key
- This parameter is required.value
- This parameter is required.public java.util.Map<java.lang.String,java.lang.String> tagValues()
public IResolvable getRenderedTags()
If you need to make a custom construct taggable, use the value of this
property to pass to the tags
property of the underlying construct.
public java.lang.String getTagPropertyName()
Normally this is tags
but some resources choose a different name. Cognito
UserPool uses UserPoolTags