-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
170 lines (145 loc) · 4.65 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
variable "project_id" {
type = string
description = "The name of the GCP project"
}
variable "alias_name" {
type = string
description = "The alias to use for naming dependent objects, such as service accounts, for the instance to avoid name/length conflicts"
default = ""
}
variable "display_name" {
type = string
description = "The display name of the instance"
default = ""
}
variable "name" {
type = string
description = "The name of the instance"
}
variable "labels" {
type = map(string)
description = "Instance labels"
default = {}
}
variable "edition" {
type = string
description = "The instance's configuration (e.g. regional-us-central1, regional-europe-west1, regional-asia-east1, multi-regional-us)"
default = "ENTERPRISE"
}
variable "instance_iam" {
type = list(object({
role = string
members = list(string)
}))
}
variable "processing_units" {
description = "Processing Units"
type = number
default = 1000
}
# database_dialect values: GOOGLE_STANDARD_SQL, POSTGRESQL
variable "databases" {
description = "A list of databases to be created"
type = list(object({
name = string
charset = string
collation = string
database_dialect = optional(string, "GOOGLE_STANDARD_SQL")
deletion_protection = optional(bool, false)
full_backup_enabled = optional(bool, false)
incremental_backup_enabled = optional(bool, false)
backup_expire_time = optional(string, "604800s")
backup_schedule = optional(string, "0 0 * * *")
// 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC.
// 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC.
// 0 2 * * * : once a day at 2 past midnight in UTC.
// 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC.
// 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
}))
}
variable "database_iam" {
type = map(object({
role = string
database_name = string
members = list(string)
}))
}
variable "config" {
type = string
description = "The name of the instance's configuration (e.g. staging: us-west1, europe-west-1, asia-east2 | prod: nam10, eur5, asia1 | see https://cloud.google.com/spanner/docs/instance-configurations)"
}
variable "deletion_protection" {
type = bool
default = false
}
# Optional Autoscaling
variable "autoscale_enabled" {
type = bool
description = "Enable autoscaling for the spanner instance"
default = false
}
variable "autoscale_in_cooling_minutes" {
type = number
default = 30
description = "Minutes to wait after scaling IN or OUT before a scale IN event can be processed."
}
variable "autoscale_out_cooling_minutes" {
type = number
default = 2
description = "Minutes to wait after scaling IN or OUT before a scale OUT event can be processed."
}
variable "autoscale_max_size" {
type = number
default = 2000
description = "Maximum size that the spanner instance can be scaled out to."
}
variable "autoscale_method" {
type = string
default = "LINEAR"
description = "Algorithm that should be used to manage the scaling of the spanner instance: STEPWISE, LINEAR, DIRECT"
}
variable "autoscale_min_size" {
type = number
default = 100
description = "Minimum size that the spanner instance can be scaled in to."
}
variable "autoscale_schedule" {
type = string
default = "*/2 * * * *"
}
variable "backup_schedule_name" {
type = string
default = ""
description = "Override the name used for the schedule. Useful if the generated name is too long or has a conflict."
}
variable "backup_schedule_region" {
description = "The schedule to be enabled on scheduler to trigger spanner DB backup"
type = string
default = "us-west1"
}
variable "backup_time_zone" {
description = "The timezone to be used for the backup schedule"
type = string
default = "America/Vancouver"
}
variable "autoscale_cpu_utilization" {
description = "What percentage of CPU utilization should trigger autoscaling"
type = number
default = 75
}
variable "autoscale_storage_utilization" {
description = "What percentage of storage utilization should trigger autoscaling"
type = number
default = 90
}
variable "pam_access" {
type = map(object({
name = string
role = string
max_time = string
auto_approve = bool
requesters = list(string)
approvers = optional(list(string)) # Required if auto_approve is true
}))
default = {}
}