-
Notifications
You must be signed in to change notification settings - Fork 368
/
metadata.yaml
321 lines (320 loc) · 13 KB
/
metadata.yaml
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: blueprints.cloud.google.com/v1alpha1
kind: BlueprintMetadata
metadata:
name: terraform-google-vm-mig
annotations:
config.kubernetes.io/local-config: "true"
spec:
info:
title: Managed Instance Group (MIG)
source:
repo: https://github.com/terraform-google-modules/terraform-google-vm
sourceType: git
dir: /modules/mig
version: 12.1.0
actuationTool:
flavor: Terraform
version: ">=1.3.0"
description: {}
content:
examples:
- name: additional_disks
location: examples/instance_template/additional_disks
- name: alias_ip_range
location: examples/instance_template/alias_ip_range
- name: autoscaler
location: examples/mig/autoscaler
- name: confidential_computing
location: examples/confidential_computing
- name: confidential_computing
location: examples/instance_template/confidential_computing
- name: confidential_computing_intel
location: examples/confidential_computing_intel
- name: disk_snapshot
location: examples/compute_instance/disk_snapshot
- name: encrypted_disks
location: examples/instance_template/encrypted_disks
- name: full
location: examples/mig/full
- name: full
location: examples/umig/full
- name: healthcheck
location: examples/mig/healthcheck
- name: mig_stateful
location: examples/mig_stateful
- name: multiple_interfaces
location: examples/compute_instance/multiple_interfaces
- name: named_ports
location: examples/umig/named_ports
- name: next_hop
location: examples/compute_instance/next_hop
- name: simple
location: examples/compute_instance/simple
- name: simple
location: examples/instance_template/simple
- name: simple
location: examples/mig/simple
- name: simple
location: examples/mig_with_percent/simple
- name: simple
location: examples/preemptible_and_regular_instance_templates/simple
- name: simple
location: examples/umig/simple
- name: static_ips
location: examples/umig/static_ips
- name: tags
location: examples/compute_instance/tags
interfaces:
variables:
- name: project_id
description: The Google Cloud project ID
varType: string
- name: hostname
description: Hostname prefix for instances
varType: string
defaultValue: default
- name: mig_name
description: Managed instance group name. When variable is empty, name will be derived from var.hostname.
varType: string
defaultValue: ""
- name: region
description: The Google Cloud region where the managed instance group resides.
varType: string
required: true
- name: instance_template
description: Instance template self_link used to create compute instances
varType: string
required: true
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-vm//modules/instance_template
version: ~> 12.0
spec:
outputExpr: self_link
- name: target_size
description: The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set.
varType: number
defaultValue: 1
- name: target_pools
description: The target load balancing pools to assign this group to.
varType: list(string)
defaultValue: []
- name: distribution_policy_target_shape
description: MIG target distribution shape (EVEN, BALANCED, ANY, ANY_SINGLE_ZONE)
varType: string
- name: distribution_policy_zones
description: The distribution policy, i.e. which zone(s) should instances be create in. Default is all zones in given region.
varType: list(string)
defaultValue: []
- name: stateful_disks
description: Disks created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-disks-in-migs
varType: |-
list(object({
device_name = string
delete_rule = string
}))
defaultValue: []
- name: stateful_ips
description: Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs
varType: |-
list(object({
interface_name = string
delete_rule = string
is_external = bool
}))
defaultValue: []
- name: update_policy
description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy
varType: |-
list(object({
max_surge_fixed = optional(number)
instance_redistribution_type = optional(string)
max_surge_percent = optional(number)
max_unavailable_fixed = optional(number)
max_unavailable_percent = optional(number)
min_ready_sec = optional(number)
replacement_method = optional(string)
minimal_action = string
type = string
most_disruptive_allowed_action = optional(string)
}))
defaultValue: []
- name: health_check_name
description: Health check name. When variable is empty, name will be derived from var.hostname.
varType: string
defaultValue: ""
- name: health_check
description: Health check to determine whether instances are responsive and able to do work
varType: |-
object({
type = string
initial_delay_sec = number
check_interval_sec = number
healthy_threshold = number
timeout_sec = number
unhealthy_threshold = number
response = string
proxy_header = string
port = number
request = string
request_path = string
host = string
enable_logging = bool
})
defaultValue:
check_interval_sec: 30
enable_logging: false
healthy_threshold: 1
host: ""
initial_delay_sec: 30
port: 80
proxy_header: NONE
request: ""
request_path: /
response: ""
timeout_sec: 10
type: ""
unhealthy_threshold: 5
- name: autoscaler_name
description: Autoscaler name. When variable is empty, name will be derived from var.hostname.
varType: string
defaultValue: ""
- name: autoscaling_enabled
description: Creates an autoscaler for the managed instance group
varType: string
defaultValue: "false"
- name: max_replicas
description: The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
varType: number
defaultValue: 10
- name: min_replicas
description: The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0.
varType: number
defaultValue: 2
- name: cooldown_period
description: The number of seconds that the autoscaler should wait before it starts collecting information from a new instance.
varType: number
defaultValue: 60
- name: autoscaling_mode
description: Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode
varType: string
- name: autoscaling_cpu
description: Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization
varType: |-
list(object({
target = number
predictive_method = string
}))
defaultValue: []
- name: autoscaling_metric
description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric
varType: |-
list(object({
name = string
target = number
type = string
}))
defaultValue: []
- name: autoscaling_lb
description: Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization
varType: list(map(number))
defaultValue: []
- name: scaling_schedules
description: Autoscaling, scaling schedule block. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#scaling_schedules
varType: |-
list(object({
disabled = bool
duration_sec = number
min_required_replicas = number
name = string
schedule = string
time_zone = string
}))
defaultValue: []
- name: autoscaling_scale_in_control
description: Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control
varType: |-
object({
fixed_replicas = number
percent_replicas = number
time_window_sec = number
})
defaultValue:
fixed_replicas: null
percent_replicas: null
time_window_sec: null
- name: named_ports
description: Named name and named port. https://cloud.google.com/load-balancing/docs/backend-service#named_ports
varType: |-
list(object({
name = string
port = number
}))
defaultValue: []
- name: wait_for_instances
description: Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out.
varType: string
defaultValue: "false"
- name: mig_timeouts
description: "Times for creation, deleting and updating the MIG resources. Can be helpful when using wait_for_instances to allow a longer VM startup time. "
varType: |-
object({
create = string
update = string
delete = string
})
defaultValue:
create: 5m
delete: 15m
update: 5m
- name: labels
description: Labels, provided as a map
varType: map(string)
defaultValue: {}
outputs:
- name: health_check_self_links
description: All self_links of healthchecks created for the instance group.
type:
- list
- string
- name: instance_group
description: Instance-group url of managed instance group
type: string
- name: instance_group_manager
description: An instance of google_compute_region_instance_group_manager of the instance group.
- name: self_link
description: Self-link of managed instance group
type: string
requirements:
roles:
- level: Project
roles:
- roles/owner
- roles/compute.admin
- roles/compute.networkAdmin
- roles/iam.serviceAccountUser
- roles/compute.instanceAdmin
services:
- cloudresourcemanager.googleapis.com
- storage-api.googleapis.com
- serviceusage.googleapis.com
- compute.googleapis.com
- iam.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 4.48, < 7"
- source: hashicorp/google-beta
version: ">= 4.48, < 7"