Skip to content
GitHubXDiscord

Endpoint

The Endpoint resource lets you manage AWS DMS Endpoints used for database migration services, enabling connections to various database sources and targets.

Create a basic AWS DMS Endpoint with required properties and some common optional properties.

import AWS from "alchemy/aws/control";
const dmsEndpoint = await AWS.DMS.Endpoint("myDmsEndpoint", {
EndpointType: "source",
EngineName: "mysql",
ServerName: "mysql.example.com",
Port: 3306,
DatabaseName: "myDatabase",
Username: "admin",
Password: "securePassword123",
Tags: [
{ Key: "Environment", Value: "Production" }
]
});

Configure an AWS DMS Endpoint with advanced options such as SSL mode and additional connection attributes.

const secureDmsEndpoint = await AWS.DMS.Endpoint("secureDmsEndpoint", {
EndpointType: "target",
EngineName: "postgres",
ServerName: "postgres.example.com",
Port: 5432,
DatabaseName: "targetDatabase",
Username: "dbUser",
Password: "superSecurePassword456",
SslMode: "require",
ExtraConnectionAttributes: "ssl=true;sslcafile=/path/to/certificate",
Tags: [
{ Key: "Environment", Value: "Staging" }
]
});

Create endpoints for different database engines like Oracle and MongoDB.

Here’s how to create an endpoint for an Oracle database:

const oracleDmsEndpoint = await AWS.DMS.Endpoint("oracleDmsEndpoint", {
EndpointType: "source",
EngineName: "oracle",
ServerName: "oracle.example.com",
Port: 1521,
DatabaseName: "oracleDb",
Username: "oracleUser",
Password: "oraclePassword789",
OracleSettings: {
AccessRoleArn: "arn:aws:iam::123456789012:role/dms-access-role",
OraclePath: "myPath",
UseBimodal: true
},
Tags: [
{ Key: "DatabaseType", Value: "Oracle" }
]
});

Create an endpoint for a MongoDB database:

const mongoDmsEndpoint = await AWS.DMS.Endpoint("mongoDmsEndpoint", {
EndpointType: "target",
EngineName: "mongodb",
ServerName: "mongodb.example.com",
Port: 27017,
DatabaseName: "mongoDb",
Username: "mongoUser",
Password: "mongoPassword101112",
MongoDbSettings: {
AuthMechanism: "SCRAM_SHA_1",
AuthSource: "admin"
},
Tags: [
{ Key: "DatabaseType", Value: "MongoDB" }
]
});