I’ve been tinkering with Lambda in a VPC and I’ve come to a conclusion: Lambda in a VPC is unacceptably slow for serving interactive requests. There’s a 10 second cold start that happens as often as twice an hour.
Seems like I have three options:
0) do nothing, and wait for AWS to finish their plan for improving Lambda VPC cold start times 1) switch to a different data backing store that doesn’t require a VPC. that means abandoning Postgres for something like FaunaDB. Or S3! 2) move back to traditional EC2 hosting (with or without ECS/Beanstalk) 3) Ping the Lambda constantly (helps, but doesn’t always work) 4) open up the NACL on my RDS instance to allow (TLS-protected) access across the internet and put the Lambda back on the outside. Yuck!
Also, API Gateway is frustrating, but Serverless framework smooths out most of the wrinkles.
Except for the part where Serverless framework has a first-run failure if you’re using a custom domain and path handler. That can’t possibly be a rare case!