Closed Warkanlock closed 8 months ago
@Warkanlock I had the same issue, and it took me two days to fix it.
The lambda functions don't actually run on the same container as the localstack. A new container is created for each lambda, and that container is not added to the networks you configured.
To actually get your lambdas in a network you need to have the LAMBDA_DOCKER_NETWORK
env var set before you start the localstack.
LAMBDA_DOCKER_NETWORK=development serverless deploy
Or add it to the .env file and add useDotenv: true
to the root of serverless.yml
Hi @Warkanlock, it seems like a solution to your problem has been provided, so we are closing the ticket. Please let us know if you still encounter any issues.
Hi! I'm trying to connect in between two containers (one database on a network called
development
) and the other usingserverless-localstack
with the following configuration:Everything looks OK until I want to access to the database using a HTTP connector inside the Lambda: I receive a
Connection refused for 127.0.0.1:5732
which makes sense, since I'm trying to access to a different container, but I'm configuring the development network and happens.Does anyone knows how to connect a local lambda to a database running in other container? This issue is driving me crazy