-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostgres_managed.tf
43 lines (34 loc) · 1.21 KB
/
postgres_managed.tf
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resource "digitalocean_database_user" "harbor" {
cluster_id = local.postgres_cluster_id
name = var.database_user_pg
}
resource "digitalocean_database_db" "harbor_notaryserver" {
cluster_id = local.postgres_cluster_id
name = "notary_server"
}
resource "digitalocean_database_db" "harbor_notarysigner" {
cluster_id = local.postgres_cluster_id
name = "notary_signer"
}
resource "digitalocean_database_db" "harbor_registry" {
cluster_id = local.postgres_cluster_id
name = "registry"
}
resource "digitalocean_database_cluster" "harbor_postgres" {
count = var.postgres_cluster_name == "" ? 1 : 0
name = "harbor-postgres"
engine = "pg"
version = "13"
size = var.database_size_pg
region = data.digitalocean_kubernetes_cluster.harbor.region
private_network_uuid = data.digitalocean_kubernetes_cluster.harbor.vpc_uuid
node_count = var.database_node_count_pg
}
resource "digitalocean_database_firewall" "harbor_postgres" {
count = var.firewall_databases == true ? 1 : 0
cluster_id = local.postgres_cluster_id
rule {
type = "k8s"
value = data.digitalocean_kubernetes_cluster.harbor.id
}
}