Skip to content

Commit b7d7737

Browse files
committed
Add connection metadata, metadata.display.yaml
1 parent c1370b1 commit b7d7737

File tree

6 files changed

+347
-3
lines changed

6 files changed

+347
-3
lines changed

modules/instance_template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
4747
| project\_id | The GCP project ID | `string` | `null` | no |
4848
| region | Region where the instance template should be created. | `string` | `null` | no |
4949
| resource\_policies | A list of self\_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported. | `list(string)` | `[]` | no |
50-
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. | <pre>object({<br> email = string<br> scopes = set(string)<br> })</pre> | n/a | yes |
50+
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account. | <pre>object({<br> email = string<br> scopes = optional(set(string), ["cloud-platform"])<br> })</pre> | n/a | yes |
5151
| shielded\_instance\_config | Not used unless enable\_shielded\_vm is true. Shielded VM configuration for the instance. | <pre>object({<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> enable_integrity_monitoring = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
5252
| source\_image | Source disk image. If neither source\_image nor source\_image\_family is specified, defaults to the latest public Rocky Linux 9 optimized for GCP image. | `string` | `""` | no |
5353
| source\_image\_family | Source image family. If neither source\_image nor source\_image\_family is specified, defaults to the latest public Rocky Linux 9 optimized for GCP image. | `string` | `"rocky-linux-9-optimized-gcp"` | no |
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-vm-instance-template-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: instance_template
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-vm
26+
sourceType: git
27+
dir: /modules/instance_template
28+
ui:
29+
input:
30+
variables:
31+
access_config:
32+
name: access_config
33+
title: Access Config
34+
additional_disks:
35+
name: additional_disks
36+
title: Additional Disks
37+
additional_networks:
38+
name: additional_networks
39+
title: Additional Networks
40+
alias_ip_range:
41+
name: alias_ip_range
42+
title: Alias Ip Range
43+
auto_delete:
44+
name: auto_delete
45+
title: Auto Delete
46+
automatic_restart:
47+
name: automatic_restart
48+
title: Automatic Restart
49+
can_ip_forward:
50+
name: can_ip_forward
51+
title: Can Ip Forward
52+
confidential_instance_type:
53+
name: confidential_instance_type
54+
title: Confidential Instance Type
55+
description:
56+
name: description
57+
title: Description
58+
disk_encryption_key:
59+
name: disk_encryption_key
60+
title: Disk Encryption Key
61+
disk_labels:
62+
name: disk_labels
63+
title: Disk Labels
64+
disk_resource_policies:
65+
name: disk_resource_policies
66+
title: Disk Resource Policies
67+
disk_size_gb:
68+
name: disk_size_gb
69+
title: Disk Size Gb
70+
disk_type:
71+
name: disk_type
72+
title: Disk Type
73+
enable_confidential_vm:
74+
name: enable_confidential_vm
75+
title: Enable Confidential Vm
76+
enable_nested_virtualization:
77+
name: enable_nested_virtualization
78+
title: Enable Nested Virtualization
79+
enable_shielded_vm:
80+
name: enable_shielded_vm
81+
title: Enable Shielded Vm
82+
gpu:
83+
name: gpu
84+
title: Gpu
85+
instance_description:
86+
name: instance_description
87+
title: Instance Description
88+
ipv6_access_config:
89+
name: ipv6_access_config
90+
title: Ipv6 Access Config
91+
labels:
92+
name: labels
93+
title: Labels
94+
machine_type:
95+
name: machine_type
96+
title: Machine Type
97+
maintenance_interval:
98+
name: maintenance_interval
99+
title: Maintenance Interval
100+
metadata:
101+
name: metadata
102+
title: Metadata
103+
min_cpu_platform:
104+
name: min_cpu_platform
105+
title: Min Cpu Platform
106+
name_prefix:
107+
name: name_prefix
108+
title: Name Prefix
109+
network:
110+
name: network
111+
title: Network
112+
network_ip:
113+
name: network_ip
114+
title: Network Ip
115+
nic_type:
116+
name: nic_type
117+
title: Nic Type
118+
on_host_maintenance:
119+
name: on_host_maintenance
120+
title: On Host Maintenance
121+
preemptible:
122+
name: preemptible
123+
title: Preemptible
124+
project_id:
125+
name: project_id
126+
title: Project Id
127+
region:
128+
name: region
129+
title: Region
130+
resource_policies:
131+
name: resource_policies
132+
title: Resource Policies
133+
service_account:
134+
name: service_account
135+
title: Service Account
136+
shielded_instance_config:
137+
name: shielded_instance_config
138+
title: Shielded Instance Config
139+
source_image:
140+
name: source_image
141+
title: Source Image
142+
source_image_family:
143+
name: source_image_family
144+
title: Source Image Family
145+
source_image_project:
146+
name: source_image_project
147+
title: Source Image Project
148+
spot:
149+
name: spot
150+
title: Spot
151+
spot_instance_termination_action:
152+
name: spot_instance_termination_action
153+
title: Spot Instance Termination Action
154+
stack_type:
155+
name: stack_type
156+
title: Stack Type
157+
startup_script:
158+
name: startup_script
159+
title: Startup Script
160+
subnetwork:
161+
name: subnetwork
162+
title: Subnetwork
163+
subnetwork_project:
164+
name: subnetwork_project
165+
title: Subnetwork Project
166+
tags:
167+
name: tags
168+
title: Tags
169+
threads_per_core:
170+
name: threads_per_core
171+
title: Threads Per Core
172+
total_egress_bandwidth_tier:
173+
name: total_egress_bandwidth_tier
174+
title: Total Egress Bandwidth Tier
175+
runtime:
176+
outputs:
177+
access_config:
178+
alt_defaults:
179+
- type: ALTERNATE_TYPE_DC
180+
value:
181+
nat_ip: null
182+
network_tier: PREMIUM

modules/instance_template/metadata.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,27 @@ spec:
223223
description: Metadata, provided as a map
224224
varType: map(string)
225225
defaultValue: {}
226+
connections:
227+
- source:
228+
source: github.com/terraform-google-modules/terraform-google-memorystore
229+
version: "~> 10.0.0"
230+
spec:
231+
outputExpr: env_vars
232+
- source:
233+
source: github.com/terraform-google-modules/terraform-google-sql-db//modules/postgresql
234+
version: "~> 21.0.0"
235+
spec:
236+
outputExpr: env_vars
237+
- source:
238+
source: github.com/terraform-google-modules/terraform-google-sql-db//modules/mysql
239+
version: "~> 22.0.0"
240+
spec:
241+
outputExpr: env_vars
242+
- source:
243+
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
244+
version: "~> 4.3.0"
245+
spec:
246+
outputExpr: env_vars
226247
- name: min_cpu_platform
227248
description: "Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform"
228249
varType: string
@@ -264,9 +285,16 @@ spec:
264285
varType: |-
265286
object({
266287
email = string
267-
scopes = set(string)
288+
scopes = optional(set(string), ["cloud-platform"])
268289
})
269290
required: true
291+
connections:
292+
- source:
293+
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
294+
version: "~> 4.3.0"
295+
spec:
296+
outputExpr: email
297+
inputPath: email
270298
- name: shielded_instance_config
271299
description: Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance.
272300
varType: |-
@@ -328,12 +356,18 @@ spec:
328356
outputs:
329357
- name: name
330358
description: Name of instance template
359+
type: string
331360
- name: self_link
332361
description: Self-link of instance template
362+
type: string
333363
- name: self_link_unique
334364
description: Unique self-link of instance template (recommended output to use instead of self_link)
365+
type: string
335366
- name: tags
336367
description: Tags that will be associated with instance(s)
368+
type:
369+
- list
370+
- string
337371
requirements:
338372
roles:
339373
- level: Project

modules/instance_template/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ variable "metadata" {
327327
variable "service_account" {
328328
type = object({
329329
email = string
330-
scopes = set(string)
330+
scopes = optional(set(string), ["cloud-platform"])
331331
})
332332
description = "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#service_account."
333333
}

modules/mig/metadata.display.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-vm-mig-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: Managed Instance Group (MIG)
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-vm
26+
sourceType: git
27+
dir: /modules/mig
28+
ui:
29+
input:
30+
variables:
31+
autoscaler_name:
32+
name: autoscaler_name
33+
title: Autoscaler Name
34+
autoscaling_cpu:
35+
name: autoscaling_cpu
36+
title: Autoscaling Cpu
37+
autoscaling_enabled:
38+
name: autoscaling_enabled
39+
title: Autoscaling Enabled
40+
autoscaling_lb:
41+
name: autoscaling_lb
42+
title: Autoscaling Lb
43+
autoscaling_metric:
44+
name: autoscaling_metric
45+
title: Autoscaling Metric
46+
autoscaling_mode:
47+
name: autoscaling_mode
48+
title: Autoscaling Mode
49+
autoscaling_scale_in_control:
50+
name: autoscaling_scale_in_control
51+
title: Autoscaling Scale In Control
52+
cooldown_period:
53+
name: cooldown_period
54+
title: Cooldown Period
55+
distribution_policy_target_shape:
56+
name: distribution_policy_target_shape
57+
title: Distribution Policy Target Shape
58+
distribution_policy_zones:
59+
name: distribution_policy_zones
60+
title: Distribution Policy Zones
61+
health_check:
62+
name: health_check
63+
title: Health Check
64+
health_check_name:
65+
name: health_check_name
66+
title: Health Check Name
67+
hostname:
68+
name: hostname
69+
title: Hostname
70+
instance_template:
71+
name: instance_template
72+
title: Instance Template
73+
labels:
74+
name: labels
75+
title: Labels
76+
max_replicas:
77+
name: max_replicas
78+
title: Max Replicas
79+
mig_name:
80+
name: mig_name
81+
title: Mig Name
82+
mig_timeouts:
83+
name: mig_timeouts
84+
title: Mig Timeouts
85+
min_replicas:
86+
name: min_replicas
87+
title: Min Replicas
88+
named_ports:
89+
name: named_ports
90+
title: Named Ports
91+
project_id:
92+
name: project_id
93+
title: Project Id
94+
region:
95+
name: region
96+
title: Region
97+
scaling_schedules:
98+
name: scaling_schedules
99+
title: Scaling Schedules
100+
stateful_disks:
101+
name: stateful_disks
102+
title: Stateful Disks
103+
stateful_ips:
104+
name: stateful_ips
105+
title: Stateful Ips
106+
target_pools:
107+
name: target_pools
108+
title: Target Pools
109+
target_size:
110+
name: target_size
111+
title: Target Size
112+
update_policy:
113+
name: update_policy
114+
title: Update Policy
115+
wait_for_instances:
116+
name: wait_for_instances
117+
title: Wait For Instances

0 commit comments

Comments
 (0)