Class RdsConfig


public class RdsConfig extends AbstractServiceConfig<RdsConfig.Builder>
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();
 
  • Method Details

    • builder

      public static RdsConfig.Builder builder()
      Returns a new RdsConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public RdsConfig.Builder toBuilder()
      Returns a new RdsConfig.Builder for this configuration, initialized with the current values of this instance.
      Specified by:
      toBuilder in class AbstractServiceConfig<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:
      true if 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 from getProxyBasePort().
      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

      public String getDefaultPostgresImage()
      Returns the default Docker image used for PostgreSQL RDS instances.
      Returns:
      the PostgreSQL image name
    • getDefaultMysqlImage

      public String getDefaultMysqlImage()
      Returns the default Docker image used for MySQL RDS instances.
      Returns:
      the MySQL image name
    • getDefaultMariadbImage

      public String getDefaultMariadbImage()
      Returns the default Docker image used for MariaDB RDS instances.
      Returns:
      the MariaDB image name
    • getDockerNetwork

      public String getDockerNetwork()
      Returns the Docker network used for RDS database containers, or null if not set.
      Returns:
      the Docker network name, or null
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Overrides:
      applyEnvVarsToContainer in class AbstractServiceConfig<RdsConfig.Builder>
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by exposing the appropriate ports.
      Overrides:
      applyExposedPortsToContainer in class AbstractServiceConfig<RdsConfig.Builder>
      Parameters:
      container - the container to configure