Class Ec2Config.Builder

Enclosing class:
Ec2Config

public static class Ec2Config.Builder extends AbstractServiceConfigBuilder<Ec2Config.Builder,Ec2Config>
Builder for Ec2Config.
  • Method Details

    • mock

      public Ec2Config.Builder mock(boolean mock)
      Sets whether EC2 instances go straight to RUNNING without launching Docker containers.
      Parameters:
      mock - true to enable mock mode (default false)
      Returns:
      this builder
    • imdsPort

      public Ec2Config.Builder imdsPort(int imdsPort)
      Sets the port on the Floci host for the IMDS HTTP server (169.254.169.254 equivalent).
      Parameters:
      imdsPort - the IMDS port (default 9169)
      Returns:
      this builder
    • sshPortRange

      public Ec2Config.Builder sshPortRange(int start, int end)
      Sets the SSH port range for EC2 instance access.
      Parameters:
      start - the lowest host port for EC2 instance SSH (default 2200)
      end - the highest host port for EC2 instance SSH (default 2299)
      Returns:
      this builder
    • publishSecurityGroupPorts

      public Ec2Config.Builder publishSecurityGroupPorts(boolean publishSecurityGroupPorts)
      Sets whether TCP ports opened by an instance's security-group ingress rules are published on the host via a socat sidecar container, both at launch and on later authorize-security-group-ingress.
      Parameters:
      publishSecurityGroupPorts - true to publish security-group ports (default true)
      Returns:
      this builder
    • appPortRange

      public Ec2Config.Builder appPortRange(int start, int count)
      Sets the port range allocated for published security-group app ports.
      Parameters:
      start - the lowest host port in the range (default 30000)
      count - the number of ports in the range (default 10)
      Returns:
      this builder
    • maxPublishedPortsPerInstance

      public Ec2Config.Builder maxPublishedPortsPerInstance(int maxPublishedPortsPerInstance)
      Sets the upper bound on app ports published per instance. Also bounds any single ingress rule's port span: wider ranges (e.g. an allow-all 0-65535 rule) are skipped so a single rule cannot spawn thousands of socat sidecars or exhaust the host-port range.
      Parameters:
      maxPublishedPortsPerInstance - the maximum published ports per instance (default 2)
      Returns:
      this builder
    • socatImage

      public Ec2Config.Builder socatImage(String socatImage)
      Sets the image used for the socat sidecar that forwards published security-group ports.
      Parameters:
      socatImage - the socat image name (default "alpine/socat")
      Returns:
      this builder
    • autoScaling

      public Ec2Config.Builder autoScaling(boolean enabled)
      Sets whether Auto Scaling is enabled.
      Parameters:
      enabled - true to enable Auto Scaling (default true)
      Returns:
      this builder
    • build

      public Ec2Config build()
      Creates an immutable Ec2Config from this builder.
      Specified by:
      build in class AbstractServiceConfigBuilder<Ec2Config.Builder,Ec2Config>
      Returns:
      the EC2 configuration