Class Tag

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.core.Tag
All Implemented Interfaces:
IAspect, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.149Z") @Stability(Stable) public class Tag extends software.amazon.jsii.JsiiObject implements IAspect
The Tag Aspect will handle adding a tag to this node and cascading tags to children.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.core.*;
 Tag tag = Tag.Builder.create("key", "value")
         .applyToLaunchedInstances(false)
         .excludeResourceTypes(List.of("excludeResourceTypes"))
         .includeResourceTypes(List.of("includeResourceTypes"))
         .priority(123)
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for Tag.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IAspect

    IAspect.Jsii$Default, IAspect.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Tag(String key, String value)
     
     
    Tag(String key, String value, TagProps props)
     
    protected
    Tag(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Tag(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    add(Construct scope, String key, String value)
    Deprecated.
    use Tags.of(scope).add()
    static void
    add(Construct scope, String key, String value, TagProps props)
    Deprecated.
    use Tags.of(scope).add()
    protected void
    applyTag(ITaggable resource)
     
    The string key for the tag.
    protected TagProps
     
    The string value of the tag.
    static void
    remove(Construct scope, String key)
    Deprecated.
    use Tags.of(scope).remove()
    static void
    remove(Construct scope, String key, TagProps props)
    Deprecated.
    use Tags.of(scope).remove()
    void
    visit(IConstruct construct)
    All aspects can visit an IConstruct.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Tag

      protected Tag(software.amazon.jsii.JsiiObjectRef objRef)
    • Tag

      protected Tag(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Tag

      @Stability(Stable) public Tag(@NotNull String key, @NotNull String value, @Nullable TagProps props)
      Parameters:
      key - This parameter is required.
      value - This parameter is required.
      props -
    • Tag

      @Stability(Stable) public Tag(@NotNull String key, @NotNull String value)
      Parameters:
      key - This parameter is required.
      value - This parameter is required.
  • Method Details

    • add

      @Stability(Deprecated) @Deprecated public static void add(@NotNull Construct scope, @NotNull String key, @NotNull String value, @Nullable TagProps props)
      Deprecated.
      use Tags.of(scope).add()
      (deprecated) DEPRECATED: add tags to the node of a construct and all its the taggable children.

      Parameters:
      scope - This parameter is required.
      key - This parameter is required.
      value - This parameter is required.
      props -
    • add

      @Stability(Deprecated) @Deprecated public static void add(@NotNull Construct scope, @NotNull String key, @NotNull String value)
      Deprecated.
      use Tags.of(scope).add()
      (deprecated) DEPRECATED: add tags to the node of a construct and all its the taggable children.

      Parameters:
      scope - This parameter is required.
      key - This parameter is required.
      value - This parameter is required.
    • remove

      @Stability(Deprecated) @Deprecated public static void remove(@NotNull Construct scope, @NotNull String key, @Nullable TagProps props)
      Deprecated.
      use Tags.of(scope).remove()
      (deprecated) DEPRECATED: remove tags to the node of a construct and all its the taggable children.

      Parameters:
      scope - This parameter is required.
      key - This parameter is required.
      props -
    • remove

      @Stability(Deprecated) @Deprecated public static void remove(@NotNull Construct scope, @NotNull String key)
      Deprecated.
      use Tags.of(scope).remove()
      (deprecated) DEPRECATED: remove tags to the node of a construct and all its the taggable children.

      Parameters:
      scope - This parameter is required.
      key - This parameter is required.
    • applyTag

      @Stability(Stable) protected void applyTag(@NotNull ITaggable resource)
      Parameters:
      resource - This parameter is required.
    • visit

      @Stability(Stable) public void visit(@NotNull IConstruct construct)
      All aspects can visit an IConstruct.

      Specified by:
      visit in interface IAspect
      Parameters:
      construct - This parameter is required.
    • getKey

      @Stability(Stable) @NotNull public String getKey()
      The string key for the tag.
    • getProps

      @Stability(Stable) @NotNull protected TagProps getProps()
    • getValue

      @Stability(Stable) @NotNull public String getValue()
      The string value of the tag.