Skip to content

Commit 5786237

Browse files
authored
feat: added resource_manager_tags in instance_template sub-module (#501)
1 parent b56fabb commit 5786237

File tree

22 files changed

+486
-35
lines changed

22 files changed

+486
-35
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.23
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424
ENABLE_BPMETADATA := 1

metadata.display.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 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-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: terraform-google-vm
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-vm
26+
sourceType: git
27+
ui:
28+
input: {}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2025 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-compute-disk-snapshot-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: Compute Disk Snapshot
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-vm
26+
sourceType: git
27+
dir: /modules/compute_disk_snapshot
28+
ui:
29+
input:
30+
variables:
31+
disks:
32+
name: disks
33+
title: Disks
34+
module_depends_on:
35+
name: module_depends_on
36+
title: Module Depends On
37+
name:
38+
name: name
39+
title: Name
40+
project:
41+
name: project
42+
title: Project
43+
region:
44+
name: region
45+
title: Region
46+
snapshot_properties:
47+
name: snapshot_properties
48+
title: Snapshot Properties
49+
snapshot_retention_policy:
50+
name: snapshot_retention_policy
51+
title: Snapshot Retention Policy
52+
snapshot_schedule:
53+
name: snapshot_schedule
54+
title: Snapshot Schedule

modules/compute_disk_snapshot/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
version: 13.2.4
2929
actuationTool:
3030
flavor: Terraform
31-
version: ">=0.13.0"
31+
version: ">=1.3.0"
3232
description: {}
3333
content:
3434
examples:

modules/compute_disk_snapshot/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.13.0"
18+
required_version = ">=1.3.0"
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2025 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-compute-instance-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: Compute Instance
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-vm
26+
sourceType: git
27+
dir: /modules/compute_instance
28+
ui:
29+
input:
30+
variables:
31+
access_config:
32+
name: access_config
33+
title: Access Config
34+
add_hostname_suffix:
35+
name: add_hostname_suffix
36+
title: Add Hostname Suffix
37+
alias_ip_ranges:
38+
name: alias_ip_ranges
39+
title: Alias Ip Ranges
40+
deletion_protection:
41+
name: deletion_protection
42+
title: Deletion Protection
43+
hostname:
44+
name: hostname
45+
title: Hostname
46+
hostname_suffix_separator:
47+
name: hostname_suffix_separator
48+
title: Hostname Suffix Separator
49+
instance_template:
50+
name: instance_template
51+
title: Instance Template
52+
ipv6_access_config:
53+
name: ipv6_access_config
54+
title: Ipv6 Access Config
55+
labels:
56+
name: labels
57+
title: Labels
58+
network:
59+
name: network
60+
title: Network
61+
num_instances:
62+
name: num_instances
63+
title: Num Instances
64+
region:
65+
name: region
66+
title: Region
67+
resource_manager_tags:
68+
name: resource_manager_tags
69+
title: Resource Manager Tags
70+
resource_policies:
71+
name: resource_policies
72+
title: Resource Policies
73+
static_ips:
74+
name: static_ips
75+
title: Static Ips
76+
subnetwork:
77+
name: subnetwork
78+
title: Subnetwork
79+
subnetwork_project:
80+
name: subnetwork_project
81+
title: Subnetwork Project
82+
zone:
83+
name: zone
84+
title: Zone

modules/compute_instance/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
version: 13.2.4
2929
actuationTool:
3030
flavor: Terraform
31-
version: ">=0.13.0"
31+
version: ">=1.3.0"
3232
description: {}
3333
content:
3434
examples:

modules/compute_instance/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">=0.13.0"
18+
required_version = ">=1.3.0"
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"

modules/instance_template/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
4747
| preemptible | Allow the instance to be preempted | `bool` | `false` | no |
4848
| project\_id | The GCP project ID | `string` | n/a | yes |
4949
| region | Region where the instance template should be created. | `string` | n/a | yes |
50+
| resource\_manager\_tags | (Optional) A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag\_key\_id}, and values are in the format tagValues/456 | `map(string)` | `null` | no |
5051
| 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 |
5152
| 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> | `null` | no |
5253
| service\_account\_project\_roles | Roles to grant to the newly created cloud run SA in specified project. Should be used with create\_service\_account set to true and no input for service\_account | `list(string)` | `[]` | no |

modules/instance_template/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ resource "google_compute_instance_template" "tpl" {
120120
region = var.region
121121
min_cpu_platform = local.min_cpu_platform
122122
resource_policies = var.resource_policies
123+
resource_manager_tags = var.resource_manager_tags
124+
123125
dynamic "disk" {
124126
for_each = local.all_disks
125127
content {

0 commit comments

Comments
 (0)