Registry / devops / cdk-drizzle-migrate

cdk-drizzle-migrate

JSON →
library3.0.0jsnpmunverified

AWS CDK construct that runs Drizzle ORM migrations at deploy time against RDS (PostgreSQL, MariaDB, MySQL) or DSQL clusters. Version 3.0.0 requires Drizzle 1.x migration folders and Node >=24. Peer dependencies: aws-cdk-lib ^2.207.0 and constructs ^10.4.2. Ships TypeScript types. Released via semantic-release (angular). Differentiators: works in isolated subnets, uses Lambda for migration execution (max 15 min), integrates with CDK secrets.

npm install cdk-drizzle-migrate
INSTALL
IMPORT
SIG · CDK-DRIZZLE-MIGRAT
C
cdk-drizzle-migrate
devopsjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DrizzleMigrate
import { DrizzleMigrate } from "@berenddeboer/cdk-drizzle-migrate"
import { DrizzleMigrate } from "cdk-drizzle-migrate"
Note the npm scope @berenddeboer - not the plain package name. Common mistake due to package name mismatch.
DrizzleMigrate
const { DrizzleMigrate } = require("@berenddeboer/cdk-drizzle-migrate")
const DrizzleMigrate = require("@berenddeboer/cdk-drizzle-migrate")
CommonJS require with destructuring for named export. Default export not available.
DrizzleMigrateProps
import { DrizzleMigrateProps } from "@berenddeboer/cdk-drizzle-migrate"
Type import available since 3.0.0. Type for props interface.

Creates an RDS cluster and runs Drizzle migrations from the local 'migrations' folder at deploy time.

import { Stack, StackProps } from "aws-cdk-lib"; import { Vpc, SubnetType } from "aws-cdk-lib/aws-ec2"; import { DatabaseCluster } from "aws-cdk-lib/aws-rds"; import { DrizzleMigrate } from "@berenddeboer/cdk-drizzle-migrate"; import { Construct } from "constructs"; class MyStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); const vpc = new Vpc(this, "Vpc"); const database = new DatabaseCluster(this, "Database", { engine: DatabaseClusterEngine.auroraPostgres({ version: AuroraPostgresEngineVersion.VER_15_3 }), vpc, vpcSubnets: { subnetType: SubnetType.PRIVATE_ISOLATED }, credentials: Credentials.fromGeneratedSecret("dbuser"), }); new DrizzleMigrate(this, "DrizzleMigration", { dbSecret: database.secret!, migrationsPath: "migrations", vpc, vpcSubnets: { subnetType: SubnetType.PRIVATE_ISOLATED }, cluster: database, }); } }
Debug
Known issues
breakingVersion 3.0.0 targets Drizzle 1.x migration folders. Drizzle 0.x folders require version 2.x.
fix
Use cdk-drizzle-migrate@2.x for Drizzle 0.x or upgrade Drizzle to 1.x.
affects: >=3.0.0
breakingMinimum Node version is 24.0.0. Deploy environments must have Node >=24.
fix
Upgrade Node.js to 24.0.0 or higher.
affects: >=3.0.0
gotchaesbuild must be installed in CDK TypeScript projects, otherwise deployment may fail.
fix
Run 'npm i esbuild' in your project.
affects: *
gotchaLambda timeout is max 15 minutes. If migrations take longer, this construct cannot be used.
fix
Reduce migration runtime or use alternative migration approach.
affects: *
deprecatedThe package was previously published as 'cdk-drizzle-migrate' but imports use the scoped name '@berenddeboer/cdk-drizzle-migrate'.
fix
Use scoped import '@berenddeboer/cdk-drizzle-migrate'.
affects: *
gotchaThe construct assumes a unix shell with cp, mkdir, and curl available. Windows shells may not work.
fix
Deploy from a unix-like environment or container.
affects: *
Errors
Common errors & fixes
Cannot find module '@berenddeboer/cdk-drizzle-migrate'
Using unscoped package name 'cdk-drizzle-migrate' in import.
fix
Use import { DrizzleMigrate } from '@berenddeboer/cdk-drizzle-migrate'
The runtime version specified is not supported: nodejs24.x
Node.js 24.0.0 required but older runtime used in AWS Lambda or deploy environment.
fix
Ensure Node.js >=24 is installed and CDK is configured to use Node 24 Lambda runtime.
Cannot find module 'drizzle-kit'
drizzle-kit NOT installed as a dependency.
fix
Install drizzle-kit: npm install drizzle-kit --save-dev
missing or empty migrations path: migrations
The specified migrationsPath does not exist or is empty.
fix
Ensure the migrations folder exists and contains valid Drizzle migration files.
Property 'cluster' does not exist on type 'DrizzleMigrateProps'
Using an older version that did not support the 'cluster' property.
fix
Update to version 3.0.0 or pass handlerProps.securityGroups instead.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
aws-cdk-librequiredCDK framework peer dependency
constructsrequiredCDK constructs peer dependency
esbuildoptionalRecommended for CDK TypeScript projects
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
cdk-drizzle-migrate — npm install cdk-drizzle-migrate · libregistry