Class Ec2ContextImpl

java.lang.Object
com.cloudforgeci.api.core.Ec2ContextImpl
All Implemented Interfaces:
Ec2Context

public class Ec2ContextImpl extends Object implements Ec2Context
Implementation of Ec2Context providing runtime information for UserData configuration.
  • Constructor Details

    • Ec2ContextImpl

      public Ec2ContextImpl(String stackName, String runtimeType, String securityProfile, boolean hasEfs, String efsId, String accessPointId)
  • Method Details

    • stackName

      public String stackName()
      Description copied from interface: Ec2Context
      Returns the CloudFormation stack name. Used for resource naming and CloudWatch log group names.
      Specified by:
      stackName in interface Ec2Context
      Returns:
      stack name (e.g., "jenkins-prod")
    • runtimeType

      public String runtimeType()
      Description copied from interface: Ec2Context
      Returns the runtime type as a string. Typically "EC2" or "FARGATE".
      Specified by:
      runtimeType in interface Ec2Context
      Returns:
      runtime type in lowercase (e.g., "ec2")
    • securityProfile

      public String securityProfile()
      Description copied from interface: Ec2Context
      Returns the security profile as a string. Used for compliance-aware logging and configuration.
      Specified by:
      securityProfile in interface Ec2Context
      Returns:
      security profile in lowercase (e.g., "dev", "staging", "production")
    • hasEfs

      public boolean hasEfs()
      Description copied from interface: Ec2Context
      Returns whether EFS is available in this deployment. If true, applications should use EFS for storage. If false, applications should use EBS for storage.
      Specified by:
      hasEfs in interface Ec2Context
      Returns:
      true if EFS is configured and available
    • efsId

      public Optional<String> efsId()
      Description copied from interface: Ec2Context
      Returns the EFS filesystem ID if EFS is available.
      Specified by:
      efsId in interface Ec2Context
      Returns:
      EFS filesystem ID (e.g., "fs-12345678"), or empty if EFS is not available
    • accessPointId

      public Optional<String> accessPointId()
      Description copied from interface: Ec2Context
      Returns the EFS access point ID if EFS is available.
      Specified by:
      accessPointId in interface Ec2Context
      Returns:
      EFS access point ID (e.g., "fsap-12345678"), or empty if EFS is not available