Class PreferredUrlResolver

java.lang.Object
com.cloudforge.core.local.PreferredUrlResolver

public final class PreferredUrlResolver extends Object
Resolves the best "open this application" URL from a deployed stack's CFN outputs.

Shared by cloudforge-manager's inventory (live AWS/LocalStack/MiniStack stacks) and cfc-testing's post-deploy hint (freshly deployed stack's own output map) so both apply the exact same precedence — edge hostnames for local emulators first, then AWS-style ApplicationUrl/LoadBalancerDNS/Url outputs — instead of two implementations drifting apart.

Since:
3.2.0
  • Field Details

    • OUTPUT_APPLICATION_ID

      public static final String OUTPUT_APPLICATION_ID
      CFN output key CloudForge stacks tag with the deploying application's id.
      See Also:
  • Method Details

    • preferredUrl

      public static String preferredUrl(Map<String,String> outputs)
      Parameters:
      outputs - CFN stack outputs (key → value), or null/empty
      Returns:
      the best URL to open for this deployment, or null if none of the known output keys are present
    • hasLocalEmulatorBrowserUrl

      public static boolean hasLocalEmulatorBrowserUrl(Map<String,String> outputs)
    • requiresLocalStackPathPrefix

      public static boolean requiresLocalStackPathPrefix(String applicationId)
      Jenkins (and Manager) on LocalStack use --prefix=/_aws/elb/{name}; the host-mapped port alone returns Jetty 404 unless the prefix is included.
    • mergeLocalStackHostUrl

      public static String mergeLocalStackHostUrl(String appUrl, String localUrl)