-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables.tf
146 lines (124 loc) · 3.99 KB
/
variables.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
## Instance topology
variable "engine" {
description = "Database Instance's engine version (e.g. PostgreSQL-11)."
type = string
}
variable "ha_enabled" {
description = "Enable or disable high availability for the database instance."
type = bool
default = false
}
variable "name" {
description = "Name of the Database Instance"
type = string
}
variable "node_type" {
description = "Type of database instance you want to create (e.g. db-dev-s)."
type = string
}
variable "settings" {
description = "Database settings configuration"
type = map(string)
default = null
}
## Network
variable "private_network" {
description = "Describes the private network you want to connect to your cluster. If not set, a public network will be provided."
type = object({
pn_id = string
ip_net = optional(string)
enable_ipam = optional(bool)
})
default = null
}
## Storage
variable "enable_encryption" {
description = "Enable encryption at rest for the Database Instance."
type = bool
default = true
}
variable "volume_type" {
description = "Type of volume where data are stored (bssd, lssd, sbs_5k or sbs_15k)."
type = string
default = "lssd"
validation {
condition = contains(["bssd", "lssd", "sbs_5k", "sbs_15k"], var.volume_type)
error_message = "Volumes can only be one of 'bssd', 'lssd', 'sbs_5k' or 'sbs_15k'."
}
}
variable "volume_size_in_gb" {
description = "Volume size (in GB) when volume_type is set to bssd. Must be a multiple of 5000000000."
type = number
default = null
}
## Backup
variable "backup_disabled" {
description = "Disable automated backup for the database instance."
type = bool
default = false
}
variable "backup_same_region" {
description = "Whether logical backups are stored in the same region as the database instance."
type = bool
default = false
}
variable "backup_schedule_frequency" {
description = "Backup schedule frequency in hours."
type = number
default = 24
}
variable "backup_schedule_retention" {
description = "Backup schedule retention in days."
type = number
default = 7
}
## User informations
variable "user_name" {
description = "Identifier for the first user of the database instance. **Warning** Changing the user_name will recreate the Database Instance."
type = string
validation {
condition = can(regex("^[-_a-zA-Z0-9]{1,63}$", var.user_name))
error_message = "Username can contain up to 63 characters and must start with a letter. Only alphanumeric characters, underscores, and dashes are accepted."
}
}
variable "user_password" {
description = "Password for the first user of the database instance. A random password will be generated if null."
sensitive = true
type = string
default = null
}
## Read replicas
variable "replica_enabled" {
description = "Whether to create a read replica or not."
type = bool
default = true
}
variable "replica_private_network" {
description = "Describes the private network you want to connect to your read replica."
type = object({
pn_id = string
ip_net = string
})
default = null
}
variable "replica_region" {
description = "Region in which the replica should be created. Ressource will be created in the same region than the master if null."
type = string
default = null
}
## Scaleway tenancy
variable "project_id" {
description = "ID of the project the instance is associated with. Ressource will be created in the project set at the provider level if null."
type = string
default = null
}
variable "region" {
description = "Region in which the instance should be created. Ressource will be created in the region set at the provider level if null."
type = string
default = null
}
variable "tags" {
type = list(string)
description = "Tags associated with the server and dedicated ip address."
default = []
}