Class Names

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Names
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.102.0 (build e354887)", date="2024-08-23T05:56:10.107Z") @Stability(Stable) public class Names extends software.amazon.jsii.JsiiObject
Functions for devising unique names for constructs.

For example, those can be used to allocate unique physical names for resources.

  • Nested Class Summary

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

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Names(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Names(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    nodeUniqueId(software.constructs.Node node)
    Returns a CloudFormation-compatible unique identifier for a construct based on its path.
    static String
    uniqueId(software.constructs.IConstruct construct)
    Returns a CloudFormation-compatible unique identifier for a construct based on its path.
    static String
    uniqueResourceName(software.constructs.IConstruct construct, UniqueResourceNameOptions options)
    Returns a CloudFormation-compatible unique identifier for a construct based on its path.

    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

    • Names

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

      protected Names(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • nodeUniqueId

      @Stability(Stable) @NotNull public static String nodeUniqueId(@NotNull software.constructs.Node node)
      Returns a CloudFormation-compatible unique identifier for a construct based on its path.

      The identifier includes a human readable portion rendered from the path components and a hash suffix.

      TODO (v2): replace with API to use constructs.Node.

      Parameters:
      node - The construct node. This parameter is required.
      Returns:
      a unique id based on the construct path
    • uniqueId

      @Stability(Stable) @NotNull public static String uniqueId(@NotNull software.constructs.IConstruct construct)
      Returns a CloudFormation-compatible unique identifier for a construct based on its path.

      The identifier includes a human readable portion rendered from the path components and a hash suffix. uniqueId is not unique if multiple copies of the stack are deployed. Prefer using uniqueResourceName().

      Parameters:
      construct - The construct. This parameter is required.
      Returns:
      a unique id based on the construct path
    • uniqueResourceName

      @Stability(Stable) @NotNull public static String uniqueResourceName(@NotNull software.constructs.IConstruct construct, @NotNull UniqueResourceNameOptions options)
      Returns a CloudFormation-compatible unique identifier for a construct based on its path.

      This function finds the stackName of the parent stack (non-nested) to the construct, and the ids of the components in the construct path.

      The user can define allowed special characters, a separator between the elements, and the maximum length of the resource name. The name includes a human readable portion rendered from the path components, with or without user defined separators, and a hash suffix. If the resource name is longer than the maximum length, it is trimmed in the middle.

      Parameters:
      construct - The construct. This parameter is required.
      options - Options for defining the unique resource name. This parameter is required.
      Returns:
      a unique resource name based on the construct path