-
Notifications
You must be signed in to change notification settings - Fork 0
/
trove.tf
130 lines (115 loc) · 2.51 KB
/
trove.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
variable "network_uuid" {
type = map(any)
default = {
"codfw1dev" = "05a5494a-184f-4d5c-9e98-77ae61c56daa" # lan-flat-cloudinstances2b
"eqiad1" = "7425e328-560c-4f00-8e99-706f3fb90bb4" # lan-flat-cloudinstances2b
}
}
variable "db_flavor_uuid" {
type = map(any)
default = {
"codfw1dev" = "b1c8399c-87da-4262-86af-dfb6552e550e"
"eqiad1" = "b204f489-f1a5-4d91-9a11-af1ae8b66bea"
}
}
variable "region" {
type = map(any)
default = {
"codfw1dev" = "codfw1dev-r"
"eqiad1" = "eqiad1-r"
}
}
variable "db_size" {
type = map(any)
default = {
"codfw1dev" = "1"
"eqiad1" = "2"
}
}
variable "maria_version" {
type = map(any)
default = {
"codfw1dev" = "10.5.10"
"eqiad1" = "10.5.10"
}
}
variable "mysql_version" {
type = map(any)
default = {
"codfw1dev" = "5.7.29"
"eqiad1" = "5.7.29"
}
}
variable "psql_version" {
type = map(any)
default = {
"codfw1dev" = "12.7"
"eqiad1" = "12.7"
}
}
resource "openstack_db_instance_v1" "postgresql" {
region = var.region[var.datacenter]
name = "tf-postgresql"
flavor_id = var.db_flavor_uuid[var.datacenter]
size = var.db_size[var.datacenter]
network {
uuid = var.network_uuid[var.datacenter]
}
user {
name = "infra"
host = "%"
password = "notapassword"
databases = ["tf-postgresql"]
}
database {
name = "tf-postgresql"
}
datastore {
version = var.psql_version[var.datacenter]
type = "postgresql"
}
}
resource "openstack_db_instance_v1" "mysql" {
region = var.region[var.datacenter]
name = "tf-mysql"
flavor_id = var.db_flavor_uuid[var.datacenter]
size = var.db_size[var.datacenter]
network {
uuid = var.network_uuid[var.datacenter]
}
user {
name = "infra"
host = "%"
password = "notapassword"
databases = ["tf-mysql"]
}
database {
name = "tf-mysql"
}
datastore {
version = var.mysql_version[var.datacenter]
type = "mysql"
}
}
resource "openstack_db_instance_v1" "mariadb" {
region = var.region[var.datacenter]
name = "tf-mariadb"
flavor_id = var.db_flavor_uuid[var.datacenter]
size = var.db_size[var.datacenter]
network {
uuid = var.network_uuid[var.datacenter]
}
user {
name = "infra"
host = "%"
password = "notapassword"
databases = ["tf-mariadb"]
}
database {
name = "tf-mariadb"
}
datastore {
version = var.maria_version[var.datacenter]
type = "mariadb"
}
}