MySQL Database Service Replication: easy deployment with Terraform

Recently, we discovered how to setup Disaster Recovery in OCI MySQL Database Service using inbound/outbound replication.

In this article we will see how we can deploy MDS replication architecture very easily using Terraform and OCI Resource Manager.

The current modules available as example on my github ( allows you to deploy architectures like these:

We can deploy replica for a single MySQL Instance or for a MySQL HA Instance.

Let’s see how do deploy such solution using OCI Resource Manager Stack.

To start, just click on this button below:

Deploy to Oracle Cloud

This will open the OCI dashboard console and load the Terraform modules. You need to acknowledge the Oracle Terms of Use:

And you can provide a different name if you want:

Then we need to fill the required variables, only 5 !

For this example, I will create 2 MDS instances. The Source will be in London and the Replica in Amsterdam:

I’m fine with the proposed shape selection, so I leave the default values:

After clicking on Next, I can see the summary and I just click on Create:

Now, I need to wait while all resources are provisioned in OCI…

After a while, we will get something like this if all succeeded:

In the outputs section, we can see the necessary information to connect to our system:

As you can see, a compute instance with MySQL Shell is also deployed on each region.

In this example, if we go in the Amsterdam region, we can see a MDS instance having an active replication channel from London:

As you can see, it was very easy to deploy such architecture with a connection between 2 regions in OCI and enable MySQL replication and it took about 8 minutes only:

In the next article, I will show you how to deploy an architecture like this using Terraform manually from your laptop.

Enjoy MySQL and MySQL Database Service on OCI !

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.