Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Databases: Add online migration support #1331

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

danaelhe
Copy link
Member

Add resource digitalocean_database_online_migration to satisfy github issue #1287

Tests passing:

--- PASS: TestAccDigitalOceanDatabaseOnlineMigration_Basic (444.66s)
PASS
ok  	github.com/digitalocean/terraform-provider-digitalocean/digitalocean/database	(cached)

An example config:

resource "digitalocean_database_cluster" "source" {
  name       = "st01"
  engine     = "mysql"
  version    = "8"
  size       = "db-s-1vcpu-1gb"
  region     = "nyc1"
  node_count = 1
  tags       = ["production"]
}

resource "digitalocean_database_cluster" "destination" {
  name       = "dt01"
  engine     = "mysql"
  version    = "8"
  size       = "db-s-1vcpu-1gb"
  region     = "nyc1"
  node_count = 1
  tags       = ["production"]
}

resource "digitalocean_database_db" "source_db" {
  cluster_id = digitalocean_database_cluster.source.id
  name       = "terraform-db-om-source"
}

resource "digitalocean_database_online_migration" "foobar" {
  cluster_id = digitalocean_database_cluster.destination.id
  source {
    host = digitalocean_database_cluster.source.host
    db_name = digitalocean_database_db.source_db.name
    port = digitalocean_database_cluster.source.port
    username = digitalocean_database_cluster.source.user
    password = digitalocean_database_cluster.source.password
  }
  depends_on = [digitalocean_database_cluster.destination, digitalocean_database_cluster.source, digitalocean_database_db.source_db]
}

@danaelhe danaelhe added the feature New resources label Feb 24, 2025
@danaelhe danaelhe marked this pull request as ready for review February 24, 2025 21:56
@danaelhe danaelhe requested a review from a team February 24, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant