-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
219 lines (181 loc) · 8.67 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
# ---------------------------------------------------------------------------------------------------------------------
# REQUIRED PARAMETERS
# You must provide a value for each of these parameters.
# ---------------------------------------------------------------------------------------------------------------------
variable "gcp_project" {
description = "The project to deploy the instance group in"
type = string
}
variable "gcp_region" {
description = "All GCP resources will be launched in this Region."
type = string
}
variable "gcp_network" {
description = "The name of the VPC Network where all resources should be created."
type = string
}
variable "gcp_subnetwork" {
description = "The name of the VPC Subnetwork where all resources should be created."
type = string
}
variable "name" {
description = "The name of the instance group. This variable is used to namespace all resources created by this module."
type = string
}
variable "machine_type" {
description = "The machine type of the Compute Instance to run for each node in the instance group (e.g. n1-standard-1)."
type = string
}
variable "instance_template_name" {
description = "Set a name for instance template of instance group will be created."
type = string
}
# ---------------------------------------------------------------------------------------------------------------------
# OPTIONAL PARAMETERS
# These parameters have reasonable defaults.
# ---------------------------------------------------------------------------------------------------------------------
variable "description" {
description = "A description of the instance group; it will be added to the Compute Instance Template."
type = string
default = null
}
variable "tags" {
description = "The tag name the Compute Instances will uses to open firewall of network."
type = list(string)
default = []
}
variable "target_size" {
description = "The number of instance group will be deploy in instance groups"
type = number
default = 0
}
variable "startup_script" {
description = "A Startup Script to execute when the server first boots."
type = string
default = ""
}
variable "shutdown_script" {
description = "A Shutdown Script to execute when the server recieves a restart or stop event."
type = string
default = ""
}
variable "source_image" {
description = "The source image used to create the boot disk for a instance machine."
type = string
default = ""
}
variable "family_image" {
description = "The family image used to create the boot disk for a instance machine."
type = string
default = "debian-9"
}
# Use debian-cloud if use family_image is debian-9
variable "image_project_id" {
description = "The name of the GCP Project where the image is located. Useful when using a separate project for custom images. If empty, var.gcp_project_id will be used."
type = string
default = null
}
variable "network_project_id" {
description = "The name of the GCP Project where the network is located. Useful when using networks shared between projects. If empty, var.gcp_project_id will be used."
type = string
default = null
}
variable "service_account_scopes" {
description = "A list of service account scopes that will be added to the Compute Instance Template in addition to the scopes automatically added by this module."
type = list(string)
default = ["cloud-platform"]
}
variable "instance_group_target_pools" {
description = "To use a Load Balancer with the instance group, you must populate this value. Specifically, this is the list of Target Pool URLs to which new Compute Instances in the Instance Group created by this module will be added. Note that updating the Target Pools attribute does not affect existing Compute Instances."
type = list(string)
default = []
}
# Update Policy
variable "instance_group_update_policy_type" {
description = "The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls)."
type = string
default = "PROACTIVE"
}
variable "instance_group_update_policy_redistribution_type" {
description = "The instance redistribution policy for regional managed instance groups. Valid values are: 'PROACTIVE' and 'NONE'. If 'PROACTIVE', the group attempts to maintain an even distribution of VM instances across zones in the region. If 'NONE', proactive redistribution is disabled."
type = string
default = "PROACTIVE"
}
variable "instance_group_update_policy_minimal_action" {
description = "Minimal action to be taken on an instance. You can specify either 'RESTART' to restart existing instances or 'REPLACE' to delete and create new instances from the target template. If you specify a 'RESTART', the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action."
type = string
default = "REPLACE"
}
variable "instance_group_update_policy_max_surge_fixed" {
description = "The maximum number of instances that can be created above the specified targetSize during the update process. Conflicts with var.instance_group_update_policy_max_surge_percent. See https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager.html#max_surge_fixed for more information."
type = number
default = 3
}
variable "instance_group_update_policy_max_surge_percent" {
description = "The maximum number of instances(calculated as percentage) that can be created above the specified targetSize during the update process. Conflicts with var.instance_group_update_policy_max_surge_fixed. Only allowed for regional managed instance groups with size at least 10."
type = number
default = null
}
variable "instance_group_update_policy_max_unavailable_fixed" {
description = "The maximum number of instances that can be unavailable during the update process. Conflicts with var.instance_group_update_policy_max_unavailable_percent. It has to be either 0 or at least equal to the number of zones. If fixed values are used, at least one of var.instance_group_update_policy_max_unavailable_fixed or var.instance_group_update_policy_max_surge_fixed must be greater than 0."
type = number
default = 0
}
variable "instance_group_update_policy_max_unavailable_percent" {
description = "The maximum number of instances(calculated as percentage) that can be unavailable during the update process. Conflicts with var.instance_group_update_policy_max_unavailable_fixed. Only allowed for regional managed instance groups with size at least 10."
type = number
default = null
}
variable "instance_group_update_policy_min_ready_sec" {
description = "Minimum number of seconds to wait for after a newly created instance becomes available. This value must be between 0-3600."
type = number
default = 300
}
# Metadata
variable "custom_metadata" {
description = "A map of metadata key value pairs to assign to the Compute Instance metadata."
type = map(string)
default = {}
}
# Disk Settings
variable "preemptible" {
description = "Enable preemptible for machine."
type = bool
default = false
}
variable "enable_pubic_ip" {
description = "Enable adding public ip address for machine."
type = bool
default = false
}
variable "root_volume_disk_interface" {
description = "The disk interface to use for attaching this disk; either SCSI or NVME."
type = string
default = "SCSI"
}
variable "root_volume_disk_size_gb" {
description = "The size, in GB, of the root disk volume on each machine."
type = number
default = 30
}
variable "root_volume_disk_type" {
description = "The GCE disk type. Can be either pd-ssd, local-ssd, or pd-standard."
type = string
default = "pd-standard"
}
# Service Account Roles
variable "service_account_roles" {
type = list(string)
description = "Service account roles will apply for service account."
default = [
"roles/logging.logWriter",
"roles/monitoring.metricWriter",
"roles/monitoring.viewer",
"roles/compute.osLogin"
]
}
variable "members" {
description = "List of members in the standard GCP form: user:{email}, serviceAccount:{email}, group:{email}."
type = list(string)
default = []
}