Suppose we have some services (RDS SQL databases, redis clusters e etc) that can only be accessed from resources inside a VPC. Is it possible to put Nextjs SSR lambda instances (I can be wrong, but I think the ssr is handled by lambdas) inside the VPC and make them access those services?
I'm facing the same problem but, unfortunately this seems not possible at the moment. A similar question was answered on AWS re:Post by the Amplify team.
Amplify Next.js Classic SSR, the API routes are powered by L@E functions so there is no scope for configuring the same in VPC. Recently there is launch of Amplify Hosting Compute even that does not have VPC configuration. So what you are looking for is currently not supported, RDS needs to be open to public. However we do not recommend making the DB public as it does not seem secure. As a workaround, you may spin up an Amplify Backend to provision a Rest API + Lambda(VPC) that interacts with their RDS.
Source: AWS re:Post