Skip to content

An automation script for managing AWS Database Migration Service (DMS) replication tasks.

Notifications You must be signed in to change notification settings

kcflan/aws-dms-automation

Repository files navigation

🚀 AWS DMS Automation Script 🎯

Effortlessly manage your AWS Database Migration Service (DMS) replication tasks using this automation script, built with TypeScript and the AWS SDK for JavaScript. Save costs and streamline your data migrations!


📋 Features

  • ✅ Validates Required Environment Variables – Ensures all necessary configurations are set.
  • ✅ Initializes AWS DMS Client – Seamless integration with AWS.
  • ✅ Manages Replication Tasks – Automates the start and stop of tasks efficiently.
  • ✅ Real-Time Status Updates – Monitors and updates the task status every 60 seconds (configurable).

🎯 Purpose

💰 Cost-Effective Migration Management

Why let an expensive dms.r5.32xlarge instance run indefinitely? This script automates the start and stop of DMS replication tasks, allowing you to:

  • 🚀 Use a dms.r6i.32xlarge instance for faster data transfers if you fancy.
  • 🔄 Manually downgrade the instance post-migration to minimize costs.
  • 💸 Avoid unnecessary charges by stopping tasks when not needed.

Because a little automation goes a long way in saving costs! 🤖💵


🚀 Getting Started

1. Clone the repository

git clone git@github.com:kcflan/aws-dms-automation.git
cd aws-dms-automation

2. Install the dependencies

npm install

3. Configure Environment Variables

Create an .env file in the root directory and fill it out using the .env.example as a guide.

Required Environment Variables:

🌍 REPLICATION_REGION: AWS region where your DMS replication task is located.
🔑 REPLICATION_ACCESS_KEY_ID: Your AWS access key ID.
🔒 REPLICATION_SECRET_ACCESS_KEY: Your AWS secret access key.
📜 REPLICATION_TASK_ARN: The ARN of the DMS replication task.
🖥️ REPLICATION_INSTANCE_ARN: The ARN of the DMS replication instance.

Optional Environment Variables:

🕰️ DELAY_SECONDS: (default every 60 seconds for a display message)
🔄 RESTART_AFTER_FAILURE: (default false, set true if you want the script to keep going and retry on a failed task)

🛠️ Build and Run

4. Build the Project

npm run build

5. Run the Script

npm run start

🐳 Docker Support

Build the Docker Image

npm run docker:build

Run the Docker Container

npm run docker:run

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.

Happy automating, you frugal bees! 🎉🚀🪙🐝

About

An automation script for managing AWS Database Migration Service (DMS) replication tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published