9월, 2022의 게시물 표시

When Lambda does not connect to S3 in LocalStack AWS on WSL

Using S3 in Lambda on LocalStack AWS needs the endpoint url such as  'http://host.docker.internal:4566' see  https://hands-on.cloud/testing-python-aws-applications-using-localstack/ However this doesn't work with the LocalStack's default setting. The problem is that a docker container used for Lambda does not see LocalStack server. To address this issue, use EDGE_BIND_HOST="0.0.0.0"  instead of  default value "127.0.0.1"   . (see also LocalStack Document ) So that makes the cli command EDGE_BIND_HOST="0.0.0.0" LAMBDA_DOCKER_FLAGS="--add-host host.docker.internal:host-gateway" localstack start