Deploying Nextjs with Prisma using AWS CDK?
Unanswered
Western thatching ant posted this in #help-forum
Western thatching antOP
Hi all,
I'm trying to write a deployment script using the AWS CDK to deploy a Nextjs app that uses Prisma to AWS. The biggest issue I'm running into is that I need the database url for Prisma at build time but the docker image build kicks off before the RDS instance has been created and I'm trying to hack-ily create the .env file for the build before that happens. I've been trying to add the creation of the database instance as a dependency on the DockerImageAsset build but to no avail.
That looks something like this:
I'm trying to google examples of deploying a Nextjs app with Prisma using CDK but have not had a lot of luck in finding one where the database isn't already set up ahead of time (and at this point maybe I should just do that?). Does anyone know of any good example guides or have any advice for deploying with CDK?
Thanks!
I'm trying to write a deployment script using the AWS CDK to deploy a Nextjs app that uses Prisma to AWS. The biggest issue I'm running into is that I need the database url for Prisma at build time but the docker image build kicks off before the RDS instance has been created and I'm trying to hack-ily create the .env file for the build before that happens. I've been trying to add the creation of the database instance as a dependency on the DockerImageAsset build but to no avail.
That looks something like this:
this.appImage.node.addDependency(this.database);I'm trying to google examples of deploying a Nextjs app with Prisma using CDK but have not had a lot of luck in finding one where the database isn't already set up ahead of time (and at this point maybe I should just do that?). Does anyone know of any good example guides or have any advice for deploying with CDK?
Thanks!