By Mor Sagmon
Hello all. When I’m connecting from a serverless Function to a managed MySQL DB using the VPC network host name, the connection is refused:
"error":"connect ECONNREFUSED 10.108.0.2:25060"
My question: are we forced to use the public host name of the DB from a Function, or am I missing something? When I will link this Function to an App on the App Platform and have this App a trusted source of the DB - will that allow me to use the internal host name from the Function?
Thanks! Mor
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hey @morsagmonstarfish,
Indeed, this is not yet possible with the stand-alone functions. You would need to deploy them as part of an App or use the public Database endpoint.
It looks like someone has had the same idea before and has posted it on our Product Ideas board. The best thing to do would be to head over and add your vote to it, as well as adding any additional information in the comments for exactly what you’d like to see implemented!
https://ideas.digitalocean.com/network/p/allow-access-functions-to-vpc
Hope that helps!
- Bobby.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.