https://github.com/epomatti/aws-dms-migration
AWS DMS database migration exercise with RDS database targets.
https://github.com/epomatti/aws-dms-migration
aws aws-dms aws-rds ec2 mysql rds-aurora rds-mysql terraform
Last synced: about 2 months ago
JSON representation
AWS DMS database migration exercise with RDS database targets.
- Host: GitHub
- URL: https://github.com/epomatti/aws-dms-migration
- Owner: epomatti
- License: mit
- Created: 2022-08-12T03:00:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-13T17:36:48.000Z (over 2 years ago)
- Last Synced: 2025-01-17T18:44:36.098Z (3 months ago)
- Topics: aws, aws-dms, aws-rds, ec2, mysql, rds-aurora, rds-mysql, terraform
- Language: HCL
- Homepage:
- Size: 383 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Data Migration Service (DMS)
Migration sandbox from a mocked on-premises MySQL server database to AWS RDS (MySQL, Postgres, Aurora).
## Crete the source database
Create the EC2 source database infrastructure:
```sh
terraform -chdir='ec2-mysql' init
terraform -chdir='ec2-mysql' apply -auto-approve
```MySQL will be installed and running via user-data.
Log into the VM using SSM.
Use `sudo mysql` and execute the contexts of file [`prepare-database-.sql`](ec2-mysql/prepare-database-.sql) available in this repository. You can use your favorite SQL editor at this point too.
Once the objects are created, execute the procedure to populate the table.
```sql
CALL populate();
```The database now have items to be replicated to RDS.
## Create the migration resources
This will create the migration instance, and the RDS databse instances.
First create the variables:
```sh
touch aws-dms/.auto.tfvars# Add the source endpoint - it can be the IP or DNS
ec2_mysql_endpoint = ""
```Create the infrastructure:
```sh
terraform -chdir='aws-dms' init
terraform -chdir='aws-dms' apply -auto-approve
```Once done, connect to the console and check the connection tests.
https://sa-east-1.console.aws.amazon.com/dms/v2/home?region=sa-east-1#endpointList
If the endpoint connections tests are successful, replication is ready to start. Move to the DMS migration tasks blade and start the migrations.
https://sa-east-1.console.aws.amazon.com/dms/v2/home?region=sa-east-1#tasks
All tasks once started should run successfully:
## Clean-up
Delete the infrastructure to avoid costs:
```sh
terraform -chdir='aws-dms' destroy -auto-approve
terraform -chdir='ec2-mysql' destroy -auto-approve
```