MDAA TS Docs
    Preparing search index...

    Class MdaaDefaultResourceNaming

    A default MDAA Naming implementation

    Implements

    Index

    Constructors

    Properties

    Configuration properties containing organizational context and CDK node access for the naming implementation

    INCLUDE_ENV_IN_SSM_PATH_CONTEXT_KEY: "@mdaaIncludeEnvInSsmPath" = '@mdaaIncludeEnvInSsmPath'

    When set to true (or the string "true"), env is included in SSM parameter paths and CloudFormation export names. This prevents collisions when the same module is deployed to multiple environments within a single AWS account. Defaults to false when absent; any value other than true/false is rejected as an error.

    Methods

    • Generates a export name in the format of ::<module_name>. When the @mdaaIncludeEnvInSsmPath context flag is enabled, env is inserted after domain, producing :::<module_name> to keep export names parallel with ssmPath() and avoid cross-environment collisions within one account.

      Parameters

      • path: string

      Returns string

    • Lower-cases a name, leaving any unresolved token it contains verbatim.

      Lower-casing a token's rendered marker breaks it — CDK stops recognizing the marker, so the value is never resolved and the literal text ships in the template. Only the literal text around the markers is lower-cased, which preserves every token id shape (AWS.AccountId, TOKEN.<n>, …). The previous implementation lower-cased the whole string and reconstructed the marker afterwards, which only worked for TOKEN.<n>: the original casing of any other id is unrecoverable once lower-cased.

      Split on the marker text rather than resolved via Tokenization.reverseString, because that throws on a marker whose key is not registered in the current token map — a name is data here and may legitimately contain marker-shaped text.

      Parameters

      • input: string

      Returns string

    • Generates a resource name in the format of ---<module_name>

      Parameters

      • OptionalresourceNameSuffix: string

        Optional naming suffix to be added to the generated resource name. Useful when multiple resources of the same type are created within the same stack.

      • OptionalmaxLength: number

        Should be used to truncate the generated resource names to a specified length. The result should still be unique and stable. Caution: Known bug - names exactly equal to maxLength are unnecessarily truncated with hash suffix (should use > instead of >=). Left unfixed to prevent breaking existing deployments that rely on this behavior. Cosmetic issue only - does not affect infrastructure functionality.

      Returns string

    • Generates a ssm param name in the format of ///<module_name>. When the @mdaaIncludeEnvInSsmPath context flag is enabled, env is inserted after domain, producing ////<module_name> to avoid cross-environment collisions when the same module is deployed to multiple environments in one account.

      Parameters

      • path: string
      • includeModuleName: boolean = true
      • lowerCase: boolean = true

      Returns string

    • Generates a stack name in the format of ---<module_name>. Sanitizes non-alpha numeric characters and replaces underscores with '-'

      Parameters

      • OptionalstackNameSuffix: string

      Returns string

    • Parameters

      • component: string

      Returns string