Patched AWS SDKs for Lambdas
The Lambda runtime in LocalStack uses patched AWS SDKs, which are configured to target the local APIs instead of the real AWS. This behavior is enabled by default for most Lambda runtimes when using LocalStack Pro.
Assuming you had a Python Lambda handler that attempts to list all S3 buckets. In the past, you had to manually configure the parameter on the boto3 client (and potentially use environment switches for dev/prod in your test code):
With the patched AWS SDKs, it now becomes possible to deploy your unmodified production code to LocalStack, simply creating a boto3 client with default settings. The invocations of the boto3 client will be automatically forwarded to the local APIs:
This feature works by patching the AWS SDKs in the docker images, which provide the execution environment for Lambdas within LocalStack.
The main advantage of this mode is, that no DNS magic is involved, and SSL certificate checks do not have to be disabled.
If you want to disable this behavior, and use the DNS server to resolve the endpoints for AWS, you can disable this behavior by using:
- Python (using boto3)
- NodeJS
- Java
Also, these patched SDKs are only available in the following Lambda execution modes:
- docker
This feature is currently not supported for custom Lambda container images.