Can't Push Schema to AWS Aurora - Is My Config Correct?

Hi guys! I'm moving from Vercel Postgres to AWS Aurora and I'm just trying to npx drizzle-kit push my schema but I keep getting a Region is missing error. Looking into this deeper, it looks like if aws-data-api is set as the driver, it will attempt to create an instance of RDSDataClient that requires a region to be specified. This is currently my drizzle.config.ts:
import { defineConfig } from 'drizzle-kit';

// ? Old Vercel/Postgres config
// export default defineConfig({
// dialect: "postgresql",
// schema: "./drizzle/schema.ts",
// out: "./drizzle/out",
// dbCredentials: {
// url: process.env.POSTGRES_URL!,
// }
// });

export default defineConfig({
driver: "aws-data-api",
dialect: "postgresql",
dbCredentials: {
database: "MY_DATABASE_NAME",
secretArn: "arn:aws:secretsmanager:XXX",
resourceArn: "arn:aws:rds:XXX",
},
schema: "./drizzle/schema.ts",
out: "./drizzle/out",
});
import { defineConfig } from 'drizzle-kit';

// ? Old Vercel/Postgres config
// export default defineConfig({
// dialect: "postgresql",
// schema: "./drizzle/schema.ts",
// out: "./drizzle/out",
// dbCredentials: {
// url: process.env.POSTGRES_URL!,
// }
// });

export default defineConfig({
driver: "aws-data-api",
dialect: "postgresql",
dbCredentials: {
database: "MY_DATABASE_NAME",
secretArn: "arn:aws:secretsmanager:XXX",
resourceArn: "arn:aws:rds:XXX",
},
schema: "./drizzle/schema.ts",
out: "./drizzle/out",
});
I don't see any region or options params in the defineConfig interface. Is this the wrong way to configure Drizzle to work with AWS Aurora? I've been attempting to do this by checking the Drizzle ORM docs and SST's implementation: - https://orm.drizzle.team/docs/get-started-postgresql#aws-data-api (Although a config is not specified here, I need one for the Kit). - https://ion.sst.dev/docs/start/aws/drizzle/ Any help or hints would be great appreciated!
No description
1 Reply
DovahBear
DovahBearOP6mo ago
Update: Didn't work and won't work. I just ended up writing me own little ORM that fits my needs. I heard TypeORM could work though, incase anybody has the exact same issue in the future.
Want results from more Discord servers?
Add your server