Skip to content

Commit d11920c

Browse files
authored
chore: fix metadata and lint (#442)
1 parent 2602951 commit d11920c

File tree

17 files changed

+667
-641
lines changed

17 files changed

+667
-641
lines changed

autogen/variables.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
variable "project_id" {
2020
type = string
21-
description = "The GCP project ID"
21+
description = "The Google Cloud project ID"
2222
default = null
2323
}
2424

@@ -35,7 +35,7 @@ variable "mig_name" {
3535
}
3636

3737
variable "region" {
38-
description = "The GCP region where the managed instance group resides."
38+
description = "The Google Cloud region where the managed instance group resides."
3939
type = string
4040
}
4141

examples/confidential_computing/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ resource "google_kms_crypto_key_iam_binding" "crypto_key" {
6565
}
6666

6767
module "instance_template" {
68-
source = "../../modules/instance_template"
68+
source = "terraform-google-modules/vm/google//modules/instance_template"
69+
version = "~> 12.0"
6970

7071
region = var.region
7172
project_id = var.project_id

examples/instance_template/confidential_computing/main.tf

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

1717
module "instance_template" {
18-
source = "../../../modules/instance_template"
18+
source = "terraform-google-modules/vm/google//modules/instance_template"
19+
version = "~> 12.0"
1920

2021
region = var.region
2122
project_id = var.project_id

examples/umig/named_ports/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ module "umig" {
3333
source = "terraform-google-modules/vm/google//modules/umig"
3434
version = "~> 12.0"
3535

36-
project_id = var.project_id
37-
subnetwork = var.subnetwork
36+
project_id = var.project_id
37+
subnetwork = var.subnetwork
3838
subnetwork_project = var.project_id
39-
num_instances = var.num_instances
40-
hostname = "umig-named-ports"
41-
instance_template = module.instance_template.self_link
42-
named_ports = var.named_ports
43-
region = var.region
39+
num_instances = var.num_instances
40+
hostname = "umig-named-ports"
41+
instance_template = module.instance_template.self_link
42+
named_ports = var.named_ports
43+
region = var.region
4444
}

examples/umig/simple/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ module "umig" {
3434
source = "terraform-google-modules/vm/google//modules/umig"
3535
version = "~> 12.0"
3636

37-
project_id = var.project_id
38-
subnetwork = var.subnetwork
37+
project_id = var.project_id
38+
subnetwork = var.subnetwork
3939
subnetwork_project = var.project_id
40-
num_instances = var.num_instances
41-
hostname = "umig-simple"
42-
instance_template = module.instance_template.self_link
43-
region = var.region
40+
num_instances = var.num_instances
41+
hostname = "umig-simple"
42+
instance_template = module.instance_template.self_link
43+
region = var.region
4444
}

examples/umig/static_ips/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ module "umig" {
3434
source = "terraform-google-modules/vm/google//modules/umig"
3535
version = "~> 12.0"
3636

37-
project_id = var.project_id
38-
subnetwork = var.subnetwork
37+
project_id = var.project_id
38+
subnetwork = var.subnetwork
3939
subnetwork_project = var.project_id
40-
num_instances = var.num_instances
41-
hostname = "umig-static-ips"
42-
instance_template = module.instance_template.self_link
43-
static_ips = var.static_ips
44-
region = var.region
40+
num_instances = var.num_instances
41+
hostname = "umig-static-ips"
42+
instance_template = module.instance_template.self_link
43+
static_ips = var.static_ips
44+
region = var.region
4545
}

modules/compute_disk_snapshot/metadata.yaml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,6 @@ spec:
8080
location: examples/compute_instance/tags
8181
interfaces:
8282
variables:
83-
- name: disks
84-
description: List of self_links persistent disks to attach the snapshot policy to (ie. projects/project_id/disks/diskname/zones/zone_name)
85-
varType: list(string)
86-
defaultValue: []
87-
- name: module_depends_on
88-
description: List of modules or resources this module depends on
89-
varType: list(any)
90-
defaultValue: []
9183
- name: name
9284
description: Name of the resource policy to create
9385
varType: string
@@ -100,16 +92,6 @@ spec:
10092
description: Region where resource policy resides
10193
varType: string
10294
required: true
103-
- name: snapshot_properties
104-
description: The properties of the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#snapshot_properties
105-
varType: |-
106-
object(
107-
{
108-
guest_flush = bool
109-
labels = map(string)
110-
storage_locations = list(string)
111-
}
112-
)
11395
- name: snapshot_retention_policy
11496
description: The retention policy to be applied to the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#retention_policy
11597
varType: |-
@@ -150,6 +132,24 @@ spec:
150132
}
151133
)
152134
required: true
135+
- name: snapshot_properties
136+
description: The properties of the schedule policy. For more details see https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#snapshot_properties
137+
varType: |-
138+
object(
139+
{
140+
guest_flush = bool
141+
labels = map(string)
142+
storage_locations = list(string)
143+
}
144+
)
145+
- name: disks
146+
description: List of self_links persistent disks to attach the snapshot policy to (ie. projects/project_id/disks/diskname/zones/zone_name)
147+
varType: list(string)
148+
defaultValue: []
149+
- name: module_depends_on
150+
description: List of modules or resources this module depends on
151+
varType: list(any)
152+
defaultValue: []
153153
outputs:
154154
- name: attachments
155155
description: Disk attachments to the resource policy.
@@ -170,3 +170,8 @@ spec:
170170
- serviceusage.googleapis.com
171171
- compute.googleapis.com
172172
- iam.googleapis.com
173+
providerVersions:
174+
- source: hashicorp/google
175+
version: ">= 3.71, < 7"
176+
- source: hashicorp/null
177+
version: ">= 2.1"

modules/compute_instance/metadata.yaml

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,30 @@ spec:
8080
location: examples/compute_instance/tags
8181
interfaces:
8282
variables:
83+
- name: network
84+
description: Network to deploy to. Only one of network or subnetwork should be specified.
85+
varType: string
86+
defaultValue: ""
87+
- name: subnetwork
88+
description: Subnet to deploy to. Only one of network or subnetwork should be specified.
89+
varType: string
90+
defaultValue: ""
91+
- name: subnetwork_project
92+
description: The project that subnetwork belongs to
93+
varType: string
94+
defaultValue: ""
95+
- name: hostname
96+
description: Hostname of instances
97+
varType: string
98+
defaultValue: ""
99+
- name: add_hostname_suffix
100+
description: Adds a suffix to the hostname
101+
varType: bool
102+
defaultValue: true
103+
- name: static_ips
104+
description: List of static IPs for VM instances
105+
varType: list(string)
106+
defaultValue: []
83107
- name: access_config
84108
description: Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet.
85109
varType: |-
@@ -88,77 +112,53 @@ spec:
88112
network_tier = string
89113
}))
90114
defaultValue: []
91-
- name: add_hostname_suffix
92-
description: Adds a suffix to the hostname
93-
varType: bool
94-
defaultValue: true
95-
- name: alias_ip_ranges
96-
description: (Optional) An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
115+
- name: ipv6_access_config
116+
description: IPv6 access configurations. Currently a max of 1 IPv6 access configuration is supported. If not specified, the instance will have no external IPv6 Internet access.
97117
varType: |-
98118
list(object({
99-
ip_cidr_range = string
100-
subnetwork_range_name = string
119+
network_tier = string
101120
}))
102121
defaultValue: []
103-
- name: deletion_protection
104-
description: "Enable deletion protection on this instance. Note: you must disable deletion protection before removing the resource, or the instance cannot be deleted and the Terraform run will not complete successfully."
105-
varType: bool
106-
defaultValue: false
107-
- name: hostname
108-
description: Hostname of instances
122+
- name: num_instances
123+
description: Number of instances to create. This value is ignored if static_ips is provided.
124+
varType: number
125+
defaultValue: "1"
126+
- name: instance_template
127+
description: Instance template self_link used to create compute instances
128+
varType: string
129+
required: true
130+
- name: region
131+
description: Region where the instances should be created.
132+
varType: string
133+
- name: zone
134+
description: Zone where the instances should be created. If not specified, instances will be spread across available zones in the region.
109135
varType: string
110-
defaultValue: ""
111136
- name: hostname_suffix_separator
112137
description: Separator character to compose hostname when add_hostname_suffix is set to true.
113138
varType: string
114139
defaultValue: "-"
115-
- name: instance_template
116-
description: Instance template self_link used to create compute instances
117-
varType: string
118-
required: true
119-
- name: ipv6_access_config
120-
description: IPv6 access configurations. Currently a max of 1 IPv6 access configuration is supported. If not specified, the instance will have no external IPv6 Internet access.
140+
- name: deletion_protection
141+
description: "Enable deletion protection on this instance. Note: you must disable deletion protection before removing the resource, or the instance cannot be deleted and the Terraform run will not complete successfully."
142+
varType: bool
143+
defaultValue: false
144+
- name: alias_ip_ranges
145+
description: (Optional) An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
121146
varType: |-
122147
list(object({
123-
network_tier = string
148+
ip_cidr_range = string
149+
subnetwork_range_name = string
124150
}))
125151
defaultValue: []
152+
- name: resource_policies
153+
description: (Optional) A list of short names or 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.
154+
varType: list(string)
155+
defaultValue: []
126156
- name: labels
127157
description: (Optional) Labels to override those from the template, provided as a map
128158
varType: map(string)
129-
- name: network
130-
description: Network to deploy to. Only one of network or subnetwork should be specified.
131-
varType: string
132-
defaultValue: ""
133-
- name: num_instances
134-
description: Number of instances to create. This value is ignored if static_ips is provided.
135-
varType: number
136-
defaultValue: "1"
137-
- name: region
138-
description: Region where the instances should be created.
139-
varType: string
140159
- name: resource_manager_tags
141160
description: (Optional) A tag is a key-value pair that can be attached to a Google Cloud resource. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. This value is not returned by the API. In Terraform, this value cannot be updated and changing it will recreate the resource.
142161
varType: map(string)
143-
- name: resource_policies
144-
description: (Optional) A list of short names or 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.
145-
varType: list(string)
146-
defaultValue: []
147-
- name: static_ips
148-
description: List of static IPs for VM instances
149-
varType: list(string)
150-
defaultValue: []
151-
- name: subnetwork
152-
description: Subnet to deploy to. Only one of network or subnetwork should be specified.
153-
varType: string
154-
defaultValue: ""
155-
- name: subnetwork_project
156-
description: The project that subnetwork belongs to
157-
varType: string
158-
defaultValue: ""
159-
- name: zone
160-
description: Zone where the instances should be created. If not specified, instances will be spread across available zones in the region.
161-
varType: string
162162
outputs:
163163
- name: available_zones
164164
description: List of available zones in region
@@ -181,3 +181,6 @@ spec:
181181
- serviceusage.googleapis.com
182182
- compute.googleapis.com
183183
- iam.googleapis.com
184+
providerVersions:
185+
- source: hashicorp/google
186+
version: ">= 3.88, < 7"

0 commit comments

Comments
 (0)