swille
swille

Reputation: 841

AWS ToolKit docker container not resolving internal service URIs

I am running an AWS Lambda locally via AWS Toolkit. The function, through a long dependency chain, calls an internal service endpoint that throws a ConnectionTimeoutException. That endpoint works when called locally.

Toolkit spins up a container to run the lambda in using the bridge docker network running on my local machine. My local machine is also running a proxy client in another container, and using docker network inspect bridge from my local terminal, I can see both the proxy and Toolkit containers are registered on the bridge network. When I shell into the running lambda container, my cUrl command to the internal service times out. That same command on my local machine succeeds.

Shouldn't the cUrl command work from within the lambda container?

local machine bridge network

enter image description here

connection time out exception

failed: connect timed out; nested exception is org.apache.http.conn.ConnectTimeoutException: Connect to internal.service.uri:80

Upvotes: 0

Views: 93

Answers (1)

swille
swille

Reputation: 841

Our SQUID proxy does not support service discovery. This means the container has to have environment vars set to the proxy IP:

export http_proxy=http://172.17.0.2:3128
export HTTP_PROXY=http://172.17.0.2:3128
export https_proxy=http://172.17.0.2:3128
export HTTPS_PROXY=http://172.17.0.2:3128
export NO_PROXY=localhost

then it works.

next step is to figure out how to set those within the, container via Aws Toolkit

Upvotes: 0

Related Questions