-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.tf
More file actions
26 lines (23 loc) · 689 Bytes
/
database.tf
File metadata and controls
26 lines (23 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
resource "random_string" "rancherdb" {
length = 6
special = false
numeric = false
upper = false
lower = true
}
resource "digitalocean_database_cluster" "rancherdb" {
name = random_string.rancherdb.result
engine = "pg"
version = "15"
size = var.database_size
region = var.database_region
node_count = var.database_node_count
}
resource "digitalocean_database_firewall" "rancherdb-fw-controller" {
depends_on = [digitalocean_droplet.control-plane-init, digitalocean_droplet.control-plane-replica]
cluster_id = digitalocean_database_cluster.rancherdb.id
rule {
type = "tag"
value = "${var.cluster_name}-control-plane"
}
}