I am quiet new to serverless as well AWS lambda. Currently since AWS Lambda is not available in Asia Pacific Mumbai , i am having issues with connecting to VPC hosting my database. I can’t move my database to region where Lambda due to some concerns. I have read the following links:
I tried both updates of using aws cli or changing severless yml file but it displays an error of not able to find the VPC. Any help would be highly appreciated.
Peering is definitely what you need. Just keep in mind that your Lambda functions will need to be VPC-based themselves (and by default, Lambda functions are not VPC-based) in order to leverage the VPC peering (and talk to RDS based in a VPC).
Is there a way to integrate the peering into serverless to any extent or is it a case of doing it manually after deploy, e.g:
- configure serverless for VPC
- serverless deploy
- send peering request from serverless account
- accept with other account and do other config
CloudFormation recently added support for VPC Peering connections, which means you can do it in the
resources section of your
It does involve cross-account roles (to accept the peering request in the other account), and there’s a decent walkthrough in the docs.
cheers for the info @rowanu. Turns out I don’t need this approach yet. I was worried that defining VPC details would mean a new VPC is created rather than integrating with my existing VPC but it magically works so I’m all set. It was the fact that you can’t define the ID/name of the VPC that made me think that but obviously that can be looked up from a subnet or security group ID.