MigrationProject
The MigrationProject resource allows you to manage AWS Database Migration Service (DMS) migration projects, providing a framework for defining and controlling the migration of databases to AWS. For more information, refer to the AWS DMS MigrationProjects documentation.
Minimal Example
Section titled “Minimal Example”Create a basic migration project with required properties and a few common optional settings.
import AWS from "alchemy/aws/control";
const basicMigrationProject = await AWS.DMS.MigrationProject("basicMigrationProject", { MigrationProjectName: "CustomerDBMigration", Description: "Migration project for customer database", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Department", Value: "IT" } ]});
Advanced Configuration
Section titled “Advanced Configuration”Configure a migration project with additional settings such as source and target data provider descriptors and transformation rules.
const advancedMigrationProject = await AWS.DMS.MigrationProject("advancedMigrationProject", { MigrationProjectName: "OrderDBMigration", Description: "Migration project for order database", SourceDataProviderDescriptors: [ { DataProviderType: "RDS", DatabaseName: "OrderDB", Engine: "mysql" } ], TargetDataProviderDescriptors: [ { DataProviderType: "S3", BucketName: "my-s3-bucket", Prefix: "migrations/" } ], TransformationRules: JSON.stringify([ { RuleType: "AddColumn", SourceColumn: "oldColumn", TargetColumn: "newColumn", TransformationType: "string" } ])});
Using Schema Conversion Application Attributes
Section titled “Using Schema Conversion Application Attributes”Create a migration project that specifies schema conversion application attributes for better control over schema transformations.
const schemaConversionProject = await AWS.DMS.MigrationProject("schemaConversionProject", { MigrationProjectName: "ProductDBMigration", Description: "Migration project for product database", SchemaConversionApplicationAttributes: { SchemaConversionApplicationVersion: "1.0", TargetDatabaseType: "PostgreSQL" }});
Adoption of Existing Resources
Section titled “Adoption of Existing Resources”Create a migration project while adopting an existing resource if it already exists.
const adoptMigrationProject = await AWS.DMS.MigrationProject("adoptMigrationProject", { MigrationProjectIdentifier: "existingMigrationProjectId", MigrationProjectName: "AdoptedMigrationProject", adopt: true});