Currently we are working on a feature-level preview infrastructure for our application using the digitalocean terrafom provider (https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs). In doing so, we’d like to spin up the testable version of our digitalocean app as well as a new database cluster based on the backup of of one of our existing clusters to be able to test with real data. As per the docs this should not be an issue if we use the backup_restore feature: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/database_cluster
However, we are running into the issue, that the database is created successfully from the backup but the new database includes the trusted sources config of the existing database cluster which causes the app deployment to fail as it cannot access the db.
As such we’d need to be able to spin up the db cluster from backup without the trusted sources which would be added separately for our new instance. Has anyone experienced something similar or come up with a solution for this?
the config we’re using is
resource "digitalocean_database_cluster" "db_cluster" {
name = <our-db-name>
engine = "pg"
version = "14"
size = "db-s-1vcpu-1gb"
region = "fra1"
node_count = 1
depends_on = [
"<our-existing-db-cluster>"
]
}
resource "digitalocean_app" "our-app" {
spec {
... our working app spec
}
depends_on = [ digitalocean_database_cluster.db_cluster ]
}
resource "digitalocean_database_firewall" "db_firewall" {
cluster_id = digitalocean_database_cluster.db_cluster.id
rule {
type = "app"
value = digitalocean_app.our-app.id
}
depends_on = [ digitalocean_app.our-app ]
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.