-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvariables.tf
272 lines (231 loc) · 8.37 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
#################
# Provider
#################
variable "region" {
description = "(Deprecated from version 1.4.0)The region used to launch this module resources."
type = string
default = ""
}
variable "profile" {
description = "(Deprecated from version 1.4.0)The profile name as set in the shared credentials file. If not set, it will be sourced from the ALICLOUD_PROFILE environment variable."
type = string
default = ""
}
variable "shared_credentials_file" {
description = "(Deprecated from version 1.4.0)This is the path to the shared credentials file. If this is not set and a profile is specified, $HOME/.aliyun/config.json will be used."
type = string
default = ""
}
variable "skip_region_validation" {
description = "(Deprecated from version 1.4.0)Skip static validation of region ID. Used by users of alternative AlibabaCloud-like APIs or users w/ access to regions that are not public (yet)."
type = bool
default = false
}
#################
# MySQL Database
#################
variable "create_database" {
description = "Whether to create multiple databases. If true, the `databases` should not be empty."
type = bool
default = true
}
variable "databases" {
description = "A list mapping used to add multiple databases. Each item supports keys: name, character_set and description. It should be set when create_database = true."
type = list(map(string))
default = []
}
#################
# MySQL Database account
#################
variable "create_account" {
description = "Whether to create a new account. If true, the `account_name` should not be empty."
type = bool
default = true
}
variable "existing_instance_id" {
description = "The Id of an existing mysql instance. If set, the `create_instance` will be ignored."
type = string
default = ""
}
variable "account_name" {
description = "Name of a new database account. It should be set when create_account = true."
type = string
default = ""
}
variable "account_password" {
description = "Operation database account password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters."
type = string
default = ""
}
variable "account_type" {
description = "Privilege type of account. Normal: Common privilege. Super: High privilege.Default to Normal."
type = string
default = "Normal"
}
variable "account_privilege" {
description = "The privilege of one account access database."
type = string
default = "ReadOnly"
}
#################
# Mysql Instance
#################
variable "create_instance" {
description = "Whether to create mysql instance. If false, you can use a existing MySQL instance by setting `existing_instance_id`."
type = bool
default = true
}
variable "engine_version" {
description = "RDS Database version. Value options can refer to the latest docs [CreateDBInstance](https://www.alibabacloud.com/help/doc-detail/26228.htm) `EngineVersion`"
type = string
default = ""
}
variable "instance_name" {
description = "The name of MySQL Instance."
type = string
default = ""
}
variable "instance_type" {
description = "MySQL Instance type, for example: mysql.n1.micro.1. full list is : https://www.alibabacloud.com/help/zh/doc-detail/26312.htm"
type = string
default = ""
}
variable "instance_storage" {
description = "The storage capacity of the instance. Unit: GB. The storage capacity increases at increments of 5 GB. For more information, see [Instance Types](https://www.alibabacloud.com/help/doc-detail/26312.htm)."
type = number
default = 20
}
variable "instance_charge_type" {
description = "The instance charge type. Valid values: Prepaid and Postpaid. Default to Postpaid."
type = string
default = "Postpaid"
}
variable "period" {
description = "The duration that you will buy MySQL Instance (in month). It is valid when instance_charge_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1"
type = number
default = 1
}
variable "security_ips" {
description = " List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32])."
type = list(string)
default = []
}
variable "vswitch_id" {
description = "The virtual switch ID to launch MySQL Instances in one VPC."
type = string
default = ""
}
variable "security_group_ids" {
description = "List of VPC security group ids to associate with mysql instance."
type = list(string)
default = []
}
variable "tags" {
description = "A mapping of tags to assign to the mysql."
type = map(string)
default = {}
}
#################
# MySQL Backup policy
#################
variable "create_backup_policy" {
description = "Whether to create backup policy."
type = bool
default = true
}
variable "backup_retention_period" {
description = "Instance backup retention days. Valid values: [7-730]. Default to 7."
type = number
default = 7
}
variable "log_backup_retention_period" {
description = "Instance log backup retention days. Valid values: [7-730]. Default to 7. It can be larger than 'retention_period'."
type = number
default = 7
}
variable "preferred_backup_time" {
description = " MySQL Instance backup time, in the format of HH:mmZ- HH:mmZ. "
type = string
default = "02:00Z-03:00Z"
}
variable "preferred_backup_period" {
description = "MySQL Instance backup period."
type = list(string)
default = []
}
variable "enable_backup_log" {
description = "Whether to backup instance log. Default to true."
type = bool
default = false
}
#################
# MySQL Connection
#################
variable "allocate_public_connection" {
description = "Whether to allocate public connection for a MySQL instance. If true, the connection_prefix can not be empty."
type = bool
default = false
}
variable "connection_prefix" {
description = "Prefix of an Internet connection string."
type = string
default = ""
}
variable "port" {
description = " Internet connection port. Valid value: [3001-3999]. Default to 3306."
type = number
default = 3306
}
#############
# cms_alarm
#############
variable "enable_alarm_rule" {
description = "Whether to enable alarm rule. Default to true. "
type = bool
default = true
}
variable "alarm_rule_name" {
description = "The alarm rule name. "
type = string
default = ""
}
variable "alarm_rule_period" {
description = "Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds. "
type = number
default = 300
}
variable "alarm_rule_statistics" {
description = "Statistical method. It must be consistent with that defined for metrics. Valid values: ['Average', 'Minimum', 'Maximum']. Default to 'Average'. "
type = string
default = "Average"
}
variable "alarm_rule_operator" {
description = "Alarm comparison operator. Valid values: ['<=', '<', '>', '>=', '==', '!=']. Default to '=='. "
type = string
default = "=="
}
variable "alarm_rule_threshold" {
description = "Alarm threshold value, which must be a numeric value currently. "
type = string
default = ""
}
variable "alarm_rule_triggered_count" {
description = "Number of consecutive times it has been detected that the values exceed the threshold. Default to 3. "
type = number
default = 3
}
variable "alarm_rule_contact_groups" {
description = "List contact groups of the alarm rule, which must have been created on the console. "
type = list(string)
default = []
}
variable "alarm_rule_silence_time" {
description = "Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400. "
type = number
default = 86400
}
variable "alarm_rule_effective_interval" {
description = "The interval of effecting alarm rule. It foramt as 'hh:mm-hh:mm', like '0:00-4:00'."
type = string
default = "0:00-2:00"
}