Class Ec2Config.Builder
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfigBuilder<Ec2Config.Builder,Ec2Config>
io.floci.testcontainers.config.services.Ec2Config.Builder
- Enclosing class:
- Ec2Config
public static class Ec2Config.Builder
extends AbstractServiceConfigBuilder<Ec2Config.Builder,Ec2Config>
Builder for
Ec2Config.-
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfigBuilder
enabled -
Method Summary
Modifier and TypeMethodDescriptionappPortRange(int start, int count) Sets the port range allocated for published security-group app ports.autoScaling(boolean enabled) Sets whether Auto Scaling is enabled.build()Creates an immutableEc2Configfrom this builder.imdsPort(int imdsPort) Sets the port on the Floci host for the IMDS HTTP server (169.254.169.254 equivalent).maxPublishedPortsPerInstance(int maxPublishedPortsPerInstance) Sets the upper bound on app ports published per instance.mock(boolean mock) Sets whether EC2 instances go straight to RUNNING without launching Docker containers.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.socatImage(String socatImage) Sets the image used for the socat sidecar that forwards published security-group ports.sshPortRange(int start, int end) Sets the SSH port range for EC2 instance access.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfigBuilder
enabled
-
Method Details
-
mock
Sets whether EC2 instances go straight to RUNNING without launching Docker containers.- Parameters:
mock-trueto enable mock mode (default false)- Returns:
- this builder
-
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
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
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-trueto publish security-group ports (default true)- Returns:
- this builder
-
appPortRange
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
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
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
Sets whether Auto Scaling is enabled.- Parameters:
enabled-trueto enable Auto Scaling (defaulttrue)- Returns:
- this builder
-
build
Creates an immutableEc2Configfrom this builder.- Specified by:
buildin classAbstractServiceConfigBuilder<Ec2Config.Builder,Ec2Config> - Returns:
- the EC2 configuration
-