-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Is it possible to connect to a database running on localhost? #2272
Comments
By the way, I tried this #669 (both using |
@pmtarantino : what version of SAM CLI are you on? can you run your command with |
Current version is 1.4.0. It says it cannot resolve domain name host.docker.internal. |
@pmtarantino
Here is the Docker documentation on how to do what you are trying to achieve: https://docs.docker.com/docker-for-windows/networking/#use-cases-and-workarounds Closing this as it relates to docker and isn't something specific to SAM CLI directly. |
I have the same problem running on Linux. We try to access services running on the locahost (outside of the container) with no success so far. The solution for running a docker container manualy with the option |
I have same problems. Can't connect to a PG that is running locally on Linux. Without ability to connect to a local DB there is no sense to use SAM at all, for our team. |
Downgraded SAM to 1.12.0 and |
@jfuss could this be reopened? I don't think there's a straightforward solution right now using SAM CLI. Docker containers allow Example:
But, I also created a question on Stack Overflow about this - https://stackoverflow.com/q/74318930/3521109 |
@jfuss Can this be re-opened? As @bluprince13 mentioned we cannot use |
@asinghvi-aurora Added in this PR #6078 |
Hello,
On my team we have several functions running on AWS lambda, and now we want to start testing locally instead of having to deploy everytime we want to test something.
I installing sam-cli, Docker, and finally I was able to make it work on my local (doing
sam build
and thensam local start-api
).However, the database where these functions writes, are running on localhost (outside the docker machine where are being executed). If I try connecting using localhost, they fail because I suppose they are checking inside the Docker VM.
Is it possible to connect to the hosting machine database? If not, it would be really hard to debug these functions.
(I hope I made myself clear)
The text was updated successfully, but these errors were encountered: