I'm deploying a nextjs app router project on AWS Amplify, not my personall preference but the client wants it on AWS When deploying, I found that the Amplify enforces minimal edge runtime on all of my APIs, even the callback, hooks, where I explicitly designated the runtime as nodejs
export const runtime = 'nodejs'
and this minimal edge runtime doesn't have access to my server env vars like webhook secret, database credentials ...etc, which makes them severely limited in usage now, unless the secrets are exposed using NEXT_PUBLIC, as weirdly mentioned by Amplify docs
Tried putting the secrets in an AWS secret manager, but still need at least the secrets id as a secure env var accessible to the edge runtime APIs to use them
This is very frustrating and a strangle limitation to Nextjs projects on Amplify, does anyone have a solution for it?
I already moved some of the APIs to server actions as a workaround, but still need webhooks and callbacks for auth and payment integrations