Registry / devops / cdk-dms-replication

cdk-dms-replication

JSON →
library0.1.10jsnpmunverified

L3 CDK constructs for Amazon Database Migration Service (DMS). Version 0.1.10 provides high-level constructs like DmsMigrationPipeline and DmsServerlessPipeline that bundle replication instance, endpoints, and tasks with secure defaults (private subnets, KMS encryption, auto security groups). Supports all DMS engines, full-load/CDC/full-load-and-CDC patterns, and includes fluent builders for table mappings and task settings. Actively maintained with monthly releases. Ships TypeScript types. Alternative to raw DMS CloudFormation resources — reduces boilerplate by ~80%.

npm install cdk-dms-replication
INSTALL
IMPORT
SIG · CDK-DMS-REPLICATIO
C
cdk-dms-replication
devopsjavascriptv0.1.10
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.

DmsMigrationPipeline
✓ import { DmsMigrationPipeline } from 'cdk-dms-replication'
✗ const DmsMigrationPipeline = require('cdk-dms-replication').DmsMigrationPipeline
The package is ESM-only. Named import from the package.
EndpointEngine
✓ import { EndpointEngine } from 'cdk-dms-replication'
✗ import { EndpointEngine } from 'aws-cdk-lib/aws-dms'
EndpointEngine is a custom enum provided by this package, not from aws-cdk-lib.
TableMappings
✓ import { TableMappings } from 'cdk-dms-replication'
✗ const TableMappings = require('cdk-dms-replication');
Named import. TableMappings is a fluent builder class.

Provision a complete DMS migration pipeline (replication instance, source/target endpoints, task) in ~20 lines of CDK code using DmsMigrationPipeline.

import * as cdk from 'aws-cdk-lib'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; import { DmsMigrationPipeline, EndpointEngine, MigrationType, TableMappings, } from 'cdk-dms-replication'; const app = new cdk.App(); const stack = new cdk.Stack(app, 'MigrationStack'); const vpc = ec2.Vpc.fromLookup(stack, 'Vpc', { isDefault: false }); new DmsMigrationPipeline(stack, 'Pipeline', { vpc, migrationType: MigrationType.FULL_LOAD_AND_CDC, sourceEndpoint: { engine: EndpointEngine.MYSQL, serverName: 'mysql.internal.example.com', port: 3306, username: 'dms_user', password: cdk.SecretValue.secretsManager('mysql-dms-password'), databaseName: 'orders', }, targetEndpoint: { engine: EndpointEngine.AURORA_POSTGRESQL, serverName: cluster.clusterEndpoint.hostname, port: 5432, username: 'dms_user', password: cdk.SecretValue.secretsManager('aurora-dms-password'), databaseName: 'orders', }, tableMappings: new TableMappings() .includeSchema('public') .excludeTable('public', 'audit_log') .toJson(), });
Debug
Known issues
deprecatedThe 'password' field in endpoint config is deprecated; use 'secretsManagerSecretId' with AWS Secrets Manager instead.
fix
Replace 'password: cdk.SecretValue.secretsManager(...)' with 'secretsManagerSecretId: 'your-secret-arn'' for better security.
affects: <=0.1.10
gotchaDmsServerlessPipeline requires 'maxCapacityUnits' to be a power of two (1,2,4,8,16,32,64,128,192,256,384). Other values will cause deployment failure.
fix
Set maxCapacityUnits to one of the allowed values: 1,2,4,8,16,32,64,128,192,256,384.
affects: >=0.1.0 <=0.1.10
gotchaTableMappings builder returns a JSON string, not an object. Passing the string directly to 'tableMappings' property is correct; do not call JSON.parse() or JSON.stringify() again.
fix
Use the result of .toJson() directly: tableMappings: new TableMappings().excludeTable('public', 'logs').toJson()
affects: >=0.1.0 <=0.1.10
breakingIn version 0.2.0 (planned), the 'sourceEndpoint' and 'targetEndpoint' properties will require ISecret instead of string-based passwords. Existing code using 'password' field will break.
fix
Migrate to use 'secretsManagerSecretId' and store passwords in Secrets Manager.
affects: <0.2.0
gotchaVPC passed to the construct must have at least two private subnets across different AZs. Using a VPC without private subnets or only one AZ will cause deployment failure.
fix
Ensure the VPC has at least two private subnets (e.g., cidrMask: 24, maxAzs: 2).
affects: >=0.1.0 <=0.1.10
Errors
Common errors & fixes
Error: The following resource(s) failed to create: [ReplicationInstance...]. InvalidParameterValue: The subnet ID 'subnet-xxx' does not exist.
VPC passed to the construct has a public subnet or the subnet ID is incorrect.
fix
Use ec2.Vpc.fromLookup or fromAttributes with correct subnet IDs. Ensure using private subnets.
TypeError: Cannot read properties of undefined (reading 'toJson')
Forgot to call .toJson() on the TableMappings instance, or used an object literal instead.
fix
Always call .toJson() on TableMappings: new TableMappings().includeAll().toJson()
Resource handler returned message: "Invalid endpoint argument: 'Password' must be a string"
Provided a SecretValue object instead of a string for the password field (deprecated).
fix
Use secretsManagerSecretId instead of password: sourceEndpoint: { ..., secretsManagerSecretId: 'my-secret-arn' }
ValidationError: The parameter 'MaxCapacityUnits' must be one of the following values: 1,2,4,8,16,32,64,128,192,256,384
Set maxCapacityUnits to a non-allowed value on DmsServerlessPipeline.
fix
Set maxCapacityUnits to a power of two from the allowed list: 1,2,4,8,16,32,64,128,192,256,384.
Upgrade
Version history
0.1.10latest on npm
Audit
Dependencies
aws-cdk-librequiredPeer dependency for AWS CDK infrastructure constructs.
constructsrequiredPeer dependency for CDK construct base class.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cdk-dms-replication — npm install cdk-dms-replication · libregistry