Compute VM module refactor (#3805)

* add ad for compute-vm refactor

* Exclue nic_type from validated fields, add split of main.tf and template.tf

* boot disk

* fix examples and fixtures

* attached disks

* fix further examples and module-level tests

* remove extra file

* fix mig examples

* finish refactoring variables

* align fast and other modules

* refactor(compute-vm): align examples and ADR with the newly implemented interface

This commit addresses the remaining references of the `instance_type` and `confidential_compute` parameters in the testing environment and updates the ADR.

* feat(compute-vm): add network_performance_config to instance and templates

This change implements the usage of the `network_performance_tier` variable we added earlier into the actual Terraform resources.

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
This commit is contained in:
Ludovico Magnocavallo
2026-03-26 12:31:40 +01:00
committed by GitHub
parent 2c39df6453
commit a4eb4d24fd
64 changed files with 1971 additions and 1119 deletions

View File

@@ -50,14 +50,14 @@ module "service-accounts" {
}
module "instances" {
source = "../../../modules/compute-vm"
for_each = { for k in local.instances : k.name => k }
project_id = each.value.project_id
zone = each.value.zone
name = each.key
instance_type = each.value.type
source = "../../../modules/compute-vm"
for_each = { for k in local.instances : k.name => k }
project_id = each.value.project_id
zone = each.value.zone
name = each.key
machine_type = each.value.type
boot_disk = {
initialize_params = {
source = {
image = each.value.image
}
}

View File

@@ -25,7 +25,7 @@ output "instance_ssh" {
description = "Instance SSH commands."
value = {
for k, v in module.instances : k => (
"gcloud compute ssh ${k} --project ${v.instance.project} --zone ${v.instance.zone}"
"gcloud compute ssh ${k} --project ${nonsensitive(v.instance.project)} --zone ${nonsensitive(v.instance.zone)}"
)
}
}