Open adrianmiu opened 3 years ago
Why can't the lambda perform the database queries?
@deleugpn
The lambda function operates in a different environment so it cannot access the website (right?), unless I open the mysql instance to the world which I don't want to do. The VPS is a regular whm/cpanel instance
If you want to use Lambda, you'll need to either open mysql to the world, or a specific ip range in which lambda operates. Otherwise move your database to AWS. This is a networking item though, not an issue with this package so this can be closed.
@adrianmiu You can opt to deploy your AWS Lambda inside a VPC with a NAT Instance or a NAT Gateway. In both cases, the public IP will be static (and predefined by the NAT). You can then add the predefined IP to your Database allow-list so that Lambda can successfully connect to your database. NAT Gateway does add $25/month cost (per AZ). NAT Instance is cheaper but you have to manage it yourself.
Hello,
I'm wondering what would be the best approach to the following scenario:
I have a VPS for the site and Mysql and I want to offload the retrieval and processing to AWS Lambda but I don't think the lambda can perform the database queries. What are my options here? The best I could come up so far is this using webhooks:
Are there better options?
Thank you.