@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:35.941Z") @Stability(value=Stable) 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:
// Example automatically generated from non-compiling source. May contain errors.
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,
String resourceTypeName) |
|
TagManager(TagType tagType,
String resourceTypeName,
Object tagStructure) |
|
TagManager(TagType tagType,
String resourceTypeName,
Object tagStructure,
TagManagerOptions options) |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
applyTagAspectHere()
Determine if the aspect applies here.
|
Boolean |
applyTagAspectHere(List<String> include)
Determine if the aspect applies here.
|
Boolean |
applyTagAspectHere(List<String> include,
List<String> exclude)
Determine if the aspect applies here.
|
IResolvable |
getRenderedTags()
A lazy value that represents the rendered tags at synthesis time.
|
String |
getTagPropertyName()
The property name for tag values.
|
Boolean |
hasTags()
Returns true if there are any tags defined.
|
static Boolean |
isTaggable(Object construct)
Check whether the given construct is Taggable.
|
void |
removeTag(String key,
Number priority)
Removes the specified tag from the array if it exists.
|
Object |
renderTags()
Renders tags into the proper format based on TagType.
|
void |
setTag(String key,
String value)
Adds the specified tag to the array of tags.
|
void |
setTag(String key,
String value,
Number priority)
Adds the specified tag to the array of tags.
|
void |
setTag(String key,
String value,
Number priority,
Boolean applyToLaunchedInstances)
Adds the specified tag to the array of tags.
|
Map<String,String> |
tagValues()
Render the tags in a readable format.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected TagManager(software.amazon.jsii.JsiiObjectRef objRef)
protected TagManager(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public TagManager(@NotNull
TagType tagType,
@NotNull
String resourceTypeName,
@Nullable
Object tagStructure,
@Nullable
TagManagerOptions options)
tagType - This parameter is required.resourceTypeName - This parameter is required.tagStructure - options - @Stability(value=Stable)
public TagManager(@NotNull
TagType tagType,
@NotNull
String resourceTypeName,
@Nullable
Object tagStructure)
tagType - This parameter is required.resourceTypeName - This parameter is required.tagStructure - @Stability(value=Stable) @NotNull public static Boolean isTaggable(@NotNull Object construct)
construct - This parameter is required.@Stability(value=Stable) @NotNull public Boolean applyTagAspectHere(@Nullable List<String> include, @Nullable List<String> exclude)
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
include - exclude - @Stability(value=Stable) @NotNull public Boolean applyTagAspectHere(@Nullable List<String> include)
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
include - @Stability(value=Stable) @NotNull public Boolean applyTagAspectHere()
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
@Stability(value=Stable) @NotNull public Boolean hasTags()
@Stability(value=Stable)
public void removeTag(@NotNull
String key,
@NotNull
Number priority)
key - The tag to remove. This parameter is required.priority - The priority of the remove operation. This parameter is required.@Stability(value=Stable) @NotNull public 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.
@Stability(value=Stable)
public void setTag(@NotNull
String key,
@NotNull
String value,
@Nullable
Number priority,
@Nullable
Boolean applyToLaunchedInstances)
key - This parameter is required.value - This parameter is required.priority - applyToLaunchedInstances - @Stability(value=Stable)
public void setTag(@NotNull
String key,
@NotNull
String value,
@Nullable
Number priority)
key - This parameter is required.value - This parameter is required.priority - @Stability(value=Stable)
public void setTag(@NotNull
String key,
@NotNull
String value)
key - This parameter is required.value - This parameter is required.@Stability(value=Stable) @NotNull public Map<String,String> tagValues()
@Stability(value=Stable) @NotNull 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.
@Stability(value=Stable) @NotNull public String getTagPropertyName()
Normally this is tags but some resources choose a different name. Cognito
UserPool uses UserPoolTags
Copyright © 2022. All rights reserved.