Setting up drizzle.config.ts for AWS

For the life of me, I cannot figure this out.
import { defineConfig } from "drizzle-kit"

export default defineConfig({
schema: "drizzle/schema.ts",
out: "@/drizzle/migrations",
dialect: "postgresql",
driver: "aws-data-api",
dbCredentials: {
database: process.env.AWS_DATABASE_NAME,
secretArn: process.env.AWS_DATABASE_SECRET_ARN,
resourceArn: process.env.AWS_DATABASE_RESOURCE_ARN,
},
verbose: true,
})
import { defineConfig } from "drizzle-kit"

export default defineConfig({
schema: "drizzle/schema.ts",
out: "@/drizzle/migrations",
dialect: "postgresql",
driver: "aws-data-api",
dbCredentials: {
database: process.env.AWS_DATABASE_NAME,
secretArn: process.env.AWS_DATABASE_SECRET_ARN,
resourceArn: process.env.AWS_DATABASE_RESOURCE_ARN,
},
verbose: true,
})
I'm 100% confident all my credentials are correct. I get this in console.
~/c0de/modernmd on feature/awsRdsPostgresql !2 ?4 ❯ bunx drizzle-kit migrate at 21:28:29
No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/dlb/c0de/modernmd/drizzle.config.ts'
TypeError: Cannot destructure property 'resourceArn' of 'connection' as it is undefined.
at drizzle (/home/dlb/c0de/modernmd/node_modules/src/aws-data-api/pg/driver.ts:171:10)
at preparePostgresDB (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:65238:22)
at async Object.handler (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:88458:39)
at async run (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:86944:7)
~/c0de/modernmd on feature/awsRdsPostgresql !2 ?4 ❯ bunx drizzle-kit migrate at 21:28:29
No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/dlb/c0de/modernmd/drizzle.config.ts'
TypeError: Cannot destructure property 'resourceArn' of 'connection' as it is undefined.
at drizzle (/home/dlb/c0de/modernmd/node_modules/src/aws-data-api/pg/driver.ts:171:10)
at preparePostgresDB (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:65238:22)
at async Object.handler (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:88458:39)
at async run (/home/dlb/c0de/modernmd/node_modules/drizzle-kit/bin.cjs:86944:7)
4 Replies
Ed
Ed5d ago
i have the exact same issue when i upgrade to the latest drizzle orm and kit.
David L. Bowman
David L. BowmanOP5d ago
do you have a working version, could you tell me the versions?
Ed
Ed5d ago
i don't. i used to yesterday but all of a sudden it broke. i didn't change anything i managed to get rid of the resourceArn issue by modifying a file (one tiny change) but now i have the error: "Error: The result contains the unsupported data type "CHAR"." and i have no idea what to do i fixed the driver.js file for the aws-data-api. i change this line const { connection = {}, ...drizzleConfig } = params[0]; to include the "= {}"
David L. Bowman
David L. BowmanOP2d ago
@Ed , I'm trying to hire a professional AWS person help me, if I find an answer, I'll let you know.
Want results from more Discord servers?
Add your server