Class RdsConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<RdsConfig.Builder>
io.floci.testcontainers.config.services.RdsConfig
Configuration for RDS-specific container settings.
Instances are created via RdsConfig.Builder:
RdsConfig config = RdsConfig.builder()
.enabled(true)
.mock(true)
.proxyPortRange(7000, 100)
.defaultPostgresImage("postgres:16-alpine")
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static RdsConfig.Builderbuilder()Returns a newRdsConfig.Builderfor this configuration.Returns the default Docker image used for MariaDB RDS instances.Returns the default Docker image used for MySQL RDS instances.Returns the default Docker image used for PostgreSQL RDS instances.Returns the Docker network used for RDS database containers, ornullif not set.intReturns the base port for the RDS proxy port range.intReturns the maximum port for the RDS proxy port range.intReturns the number of ports allocated for the RDS proxy, starting fromgetProxyBasePort().booleanisMock()Returns whether DB clusters and instances are created instantly without a real Docker container or auth proxy (API/metadata only).Returns a newRdsConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newRdsConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newRdsConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<RdsConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isMock
public boolean isMock()Returns whether DB clusters and instances are created instantly without a real Docker container or auth proxy (API/metadata only). Useful for CI and environments without access to the Docker socket.- Returns:
trueif mock mode is enabled
-
getProxyBasePort
public int getProxyBasePort()Returns the base port for the RDS proxy port range.- Returns:
- the base port
-
getProxyPortsCount
public int getProxyPortsCount()Returns the number of ports allocated for the RDS proxy, starting fromgetProxyBasePort().- Returns:
- the number of proxy ports
-
getProxyMaxPort
public int getProxyMaxPort()Returns the maximum port for the RDS proxy port range.- Returns:
- the maximum port
-
getDefaultPostgresImage
Returns the default Docker image used for PostgreSQL RDS instances.- Returns:
- the PostgreSQL image name
-
getDefaultMysqlImage
Returns the default Docker image used for MySQL RDS instances.- Returns:
- the MySQL image name
-
getDefaultMariadbImage
Returns the default Docker image used for MariaDB RDS instances.- Returns:
- the MariaDB image name
-
getDockerNetwork
Returns the Docker network used for RDS database containers, ornullif not set.- Returns:
- the Docker network name, or
null
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<RdsConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<RdsConfig.Builder>- Parameters:
container- the container to configure
-