java.lang.Object
codes.grow.packages.awssecretsmanager.secrets.EnvLoader

public final class EnvLoader extends Object
Implements loadEnv (SPEC section 3). Java cannot modify the process environment, so the default EnvLoader.Target writes system properties; an existing system property or environment variable of the same name is kept unless override is set.
  • Method Details

    • systemProperties

      public static EnvLoader.Target systemProperties()
      Returns the default target: system properties (existence also checks the environment).
      Returns:
      the target
    • map

      public static EnvLoader.Target map(Map<String,String> map)
      Returns a target that writes into a map (tests, custom configuration).
      Parameters:
      map - destination map
      Returns:
      the target
    • envName

      public static String envName(String secretName, String prefix)
      Derives a variable name: upper-cased, characters outside [A-Z0-9_] become _.
      Parameters:
      secretName - secret name (relative to the loaded path)
      prefix - prefix to prepend
      Returns:
      the variable name