Class LambdaConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<LambdaConfig.Builder>
io.floci.testcontainers.config.services.LambdaConfig
Configuration for Lambda-specific container settings.
Instances are created via LambdaConfig.Builder:
LambdaConfig config = LambdaConfig.builder()
.enabled(true)
.runtimeApiPortRange(9300, 10)
.defaultMemoryMb(256)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forLambdaConfig.static interfaceConfiguration for hot-reload development mode. -
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 LambdaConfig.Builderbuilder()Returns a newLambdaConfig.Builderfor this configuration.Returns the host path to bind-mount (read-only) into Lambda containers at/opt/aws-config, ornullif not set.intReturns the idle timeout in seconds after which unused Lambda containers are cleaned up.intReturns the default memory size for Lambda functions in megabytes.intReturns the default timeout for Lambda function invocations in seconds.Returns the Docker network used for Lambda containers, ornullif not set.Returns the hot-reload configuration for development workflows.intReturns the poll interval in milliseconds for Lambda container status checks.intReturns the per-region concurrent executions ceiling.intReturns the base port for the Lambda Runtime API port range.intReturns the highest port for the Lambda Runtime API port range.intReturns the number of ports allocated for the Lambda Runtime API.intReturns the minimum unreserved concurrency that must remain afterPutFunctionConcurrency.booleanReturns whether Lambda containers are removed after each invocation.booleanReturns whether the Lambda Runtime API ports should be exposed on the host machine.Returns a newLambdaConfig.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 newLambdaConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newLambdaConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<LambdaConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isEphemeral
public boolean isEphemeral()Returns whether Lambda containers are removed after each invocation.- Returns:
trueif containers are ephemeral
-
isExposeRuntimePorts
public boolean isExposeRuntimePorts()Returns whether the Lambda Runtime API ports should be exposed on the host machine.- Returns:
trueif Runtime API ports are exposed
-
getDefaultMemoryMb
public int getDefaultMemoryMb()Returns the default memory size for Lambda functions in megabytes.- Returns:
- memory in MB
-
getDefaultTimeoutSeconds
public int getDefaultTimeoutSeconds()Returns the default timeout for Lambda function invocations in seconds.- Returns:
- timeout in seconds
-
getDockerNetwork
Returns the Docker network used for Lambda containers, ornullif not set.- Returns:
- the Docker network name, or
null
-
getRuntimeApiBasePort
public int getRuntimeApiBasePort()Returns the base port for the Lambda Runtime API port range.- Returns:
- the base port
-
getRuntimeApiPortsCount
public int getRuntimeApiPortsCount()Returns the number of ports allocated for the Lambda Runtime API.- Returns:
- the port count
-
getRuntimeApiMaxPort
public int getRuntimeApiMaxPort()Returns the highest port for the Lambda Runtime API port range.- Returns:
- the highest port in the range
-
getPollIntervalMs
public int getPollIntervalMs()Returns the poll interval in milliseconds for Lambda container status checks.- Returns:
- interval in milliseconds
-
getContainerIdleTimeoutSeconds
public int getContainerIdleTimeoutSeconds()Returns the idle timeout in seconds after which unused Lambda containers are cleaned up.- Returns:
- timeout in seconds
-
getRegionConcurrencyLimit
public int getRegionConcurrencyLimit()Returns the per-region concurrent executions ceiling.- Returns:
- the region concurrency limit
-
getUnreservedConcurrencyMin
public int getUnreservedConcurrencyMin()Returns the minimum unreserved concurrency that must remain afterPutFunctionConcurrency.- Returns:
- the unreserved concurrency minimum
-
getHotReload
Returns the hot-reload configuration for development workflows.- Returns:
- the hot-reload configuration
-
getAwsConfigPath
Returns the host path to bind-mount (read-only) into Lambda containers at/opt/aws-config, ornullif not set.When present, no AWS credential env vars are injected; instead
AWS_SHARED_CREDENTIALS_FILEandAWS_CONFIG_FILEare set to point at the mounted files. Blank values are treated as absent.- Returns:
- the AWS config path, or
nullif not configured
-
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<LambdaConfig.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<LambdaConfig.Builder>- Parameters:
container- the container to configure
-