-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.server.tf
168 lines (148 loc) · 6.97 KB
/
variables.server.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
variable "administrator_login" {
type = string
default = null
description = "(Optional) The Administrator login for the PostgreSQL Flexible Server. Required when `create_mode` is `Default` and `authentication.password_auth_enabled` is `true`."
}
variable "administrator_password" {
type = string
default = null
description = "(Optional) The Password associated with the `administrator_login` for the PostgreSQL Flexible Server. Required when `create_mode` is `Default` and `authentication.password_auth_enabled` is `true`."
sensitive = true
}
variable "authentication" {
type = object({
active_directory_auth_enabled = optional(bool)
password_auth_enabled = optional(bool)
tenant_id = optional(string)
})
default = null
description = <<-EOT
- `active_directory_auth_enabled` - (Optional) Whether or not Active Directory authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `false`.
- `password_auth_enabled` - (Optional) Whether or not password authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `true`.
- `tenant_id` - (Optional) The Tenant ID of the Azure Active Directory which is used by the Active Directory authentication. `active_directory_auth_enabled` must be set to `true`.
EOT
}
variable "auto_grow_enabled" {
type = bool
default = null
description = "(Optional) Is the storage auto grow for PostgreSQL Flexible Server enabled? Defaults to `false`."
}
variable "backup_retention_days" {
type = number
default = null
description = "(Optional) The backup retention days for the PostgreSQL Flexible Server. Possible values are between `7` and `35` days."
}
variable "create_mode" {
type = string
default = null
description = "(Optional) The creation mode which can be used to restore or replicate existing servers. Possible values are `Default`, `GeoRestore`, `PointInTimeRestore`, `Replica` and `Update`."
}
variable "delegated_subnet_id" {
type = string
default = null
description = "(Optional) The ID of the virtual network subnet to create the PostgreSQL Flexible Server. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to the PostgreSQL Flexible Server, if not already delegated. Changing this forces a new PostgreSQL Flexible Server to be created."
}
variable "geo_redundant_backup_enabled" {
type = bool
default = null
description = "(Optional) Is Geo-Redundant backup enabled on the PostgreSQL Flexible Server. Defaults to `false`. Changing this forces a new PostgreSQL Flexible Server to be created."
}
variable "high_availability" {
type = object({
mode = string
standby_availability_zone = optional(string)
})
default = {
mode = "ZoneRedundant"
}
description = <<-EOT
- `mode` - (Required) The high availability mode for the PostgreSQL Flexible Server. Possible value are `SameZone` or `ZoneRedundant`.
- `standby_availability_zone` - (Optional) Specifies the Availability Zone in which the standby Flexible Server should be located.
EOT
}
variable "maintenance_window" {
type = object({
day_of_week = optional(string)
start_hour = optional(number)
start_minute = optional(number)
})
default = {
day_of_week = "0"
start_hour = 0
start_minute = 0
}
description = <<-EOT
- `day_of_week` - (Optional) The day of week for maintenance window, where the week starts on a Sunday, i.e. Sunday = `0`, Monday = `1`. Defaults to `0`.
- `start_hour` - (Optional) The start hour for maintenance window. Defaults to `0`.
- `start_minute` - (Optional) The start minute for maintenance window. Defaults to `0`.
EOT
}
variable "point_in_time_restore_time_in_utc" {
type = string
default = null
description = "(Optional) The point in time to restore from `source_server_id` when `create_mode` is `GeoRestore`, `PointInTimeRestore`. Changing this forces a new PostgreSQL Flexible Server to be created."
}
variable "private_dns_zone_id" {
type = string
default = null
description = "(Optional) The ID of the private DNS zone to create the PostgreSQL Flexible Server."
}
variable "public_network_access_enabled" {
type = bool
default = false
description = "(Optional) Whether the server is publicly accessible. Defaults to `false`."
}
variable "replication_role" {
type = string
default = null
description = "(Optional) The replication role for the PostgreSQL Flexible Server. Possible value is `None`."
}
variable "sku_name" {
type = string
default = null
description = "(Optional) The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the `tier` + `name` pattern (e.g. `B_Standard_B1ms`, `GP_Standard_D2s_v3`, `MO_Standard_E4s_v3`)."
}
variable "source_server_id" {
type = string
default = null
description = "(Optional) The resource ID of the source PostgreSQL Flexible Server to be restored. Required when `create_mode` is `GeoRestore`, `PointInTimeRestore` or `Replica`. Changing this forces a new PostgreSQL Flexible Server to be created."
}
variable "storage_mb" {
type = number
default = null
description = "(Optional) The max storage allowed for the PostgreSQL Flexible Server. Possible values are `32768`, `65536`, `131072`, `262144`, `524288`, `1048576`, `2097152`, `4193280`, `4194304`, `8388608`, `16777216` and `33553408`."
}
variable "storage_tier" {
type = string
default = null
description = "(Optional) The storage tier for the PostgreSQL Flexible Server. Possible values are `P4`, `P6`, `P10`, `P15`, `P20`, `P30`, `P40`, `P50`, `P60`, `P70` or `P80`."
validation {
condition = var.storage_tier != null ? contains(["P4", "P6", "P10", "P15", "P20", "P30", "P40", "P50", "P60", "P70", "P80"], var.storage_tier) : true
error_message = "The storage_tier must be one of the following values: P4, P6, P10, P15, P20, P30, P40, P50, P60, P70, P80."
}
}
variable "timeouts" {
type = object({
create = optional(string)
delete = optional(string)
read = optional(string)
update = optional(string)
})
default = null
description = <<-EOT
- `create` - (Defaults to 1 hour) Used when creating the PostgreSQL Flexible Server.
- `delete` - (Defaults to 1 hour) Used when deleting the PostgreSQL Flexible Server.
- `read` - (Defaults to 5 minutes) Used when retrieving the PostgreSQL Flexible Server.
- `update` - (Defaults to 1 hour) Used when updating the PostgreSQL Flexible Server.
EOT
}
variable "server_version" {
type = string
default = null
description = "(Optional) The version of PostgreSQL Flexible Server to use. Possible values are `11`,`12`, `13`, `14`, `15` and `16`. Required when `create_mode` is `Default`."
}
variable "zone" {
type = string
default = null
description = "(Optional) Specifies the Availability Zone in which the PostgreSQL Flexible Server should be located."
}