Class Tag.Builder

java.lang.Object
software.amazon.awscdk.core.Tag.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Tag>
Enclosing class:
Tag

@Stability(Stable) public static final class Tag.Builder extends Object implements software.amazon.jsii.Builder<Tag>
A fluent builder for Tag.
  • Method Details

    • create

      @Stability(Stable) public static Tag.Builder create(String key, String value)
      Parameters:
      key - This parameter is required.
      value - This parameter is required.
      Returns:
      a new instance of Tag.Builder.
    • applyToLaunchedInstances

      @Stability(Stable) public Tag.Builder applyToLaunchedInstances(Boolean applyToLaunchedInstances)
      Whether the tag should be applied to instances in an AutoScalingGroup.

      Default: true

      Parameters:
      applyToLaunchedInstances - Whether the tag should be applied to instances in an AutoScalingGroup. This parameter is required.
      Returns:
      this
    • excludeResourceTypes

      @Stability(Stable) public Tag.Builder excludeResourceTypes(List<String> excludeResourceTypes)
      An array of Resource Types that will not receive this tag.

      An empty array will allow this tag to be applied to all resources. A non-empty array will apply this tag only if the Resource type is not in this array.

      Default: []

      Parameters:
      excludeResourceTypes - An array of Resource Types that will not receive this tag. This parameter is required.
      Returns:
      this
    • includeResourceTypes

      @Stability(Stable) public Tag.Builder includeResourceTypes(List<String> includeResourceTypes)
      An array of Resource Types that will receive this tag.

      An empty array will match any Resource. A non-empty array will apply this tag only to Resource types that are included in this array.

      Default: []

      Parameters:
      includeResourceTypes - An array of Resource Types that will receive this tag. This parameter is required.
      Returns:
      this
    • priority

      @Stability(Stable) public Tag.Builder priority(Number priority)
      Priority of the tag operation.

      Higher or equal priority tags will take precedence.

      Setting priority will enable the user to control tags when they need to not follow the default precedence pattern of last applied and closest to the construct in the tree.

      Default: Default priorities: - 100 for

      invalid @link
      SetTag
      - 200 for RemoveTag - 50 for tags added directly to CloudFormation resources

      Parameters:
      priority - Priority of the tag operation. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Tag build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Tag>
      Returns:
      a newly built instance of Tag.