diff --git a/modules/compute-vm/README.md b/modules/compute-vm/README.md
index 69a68447f..5f6e18e3e 100644
--- a/modules/compute-vm/README.md
+++ b/modules/compute-vm/README.md
@@ -683,9 +683,9 @@ module "instance" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [name](variables.tf#L235) | Instance name. | string | ✓ | |
-| [network_interfaces](variables.tf#L240) | Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed. | list(object({…})) | ✓ | |
-| [project_id](variables.tf#L277) | Project id. | string | ✓ | |
-| [zone](variables.tf#L369) | Compute zone. | string | ✓ | |
+| [network_interfaces](variables.tf#L240) | Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed. | list(object({…})) | ✓ | |
+| [project_id](variables.tf#L278) | Project id. | string | ✓ | |
+| [zone](variables.tf#L370) | Compute zone. | string | ✓ | |
| [attached_disk_defaults](variables.tf#L17) | Defaults for attached disks options. | object({…}) | | {…} |
| [attached_disks](variables.tf#L37) | Additional disks, if options is null defaults will be used in its place. Source type is one of 'image' (zonal disks in vms and template), 'snapshot' (vm), 'existing', and null. | list(object({…})) | | [] |
| [boot_disk](variables.tf#L83) | Boot disk properties. | object({…}) | | {…} |
@@ -703,13 +703,13 @@ module "instance" {
| [labels](variables.tf#L217) | Instance labels. | map(string) | | {} |
| [metadata](variables.tf#L223) | Instance metadata. | map(string) | | {} |
| [min_cpu_platform](variables.tf#L229) | Minimum CPU platform. | string | | null |
-| [options](variables.tf#L255) | Instance options. | object({…}) | | {…} |
-| [scratch_disks](variables.tf#L282) | Scratch disks configuration. | object({…}) | | {…} |
-| [service_account](variables.tf#L294) | Service account email and scopes. If email is null, the default Compute service account will be used unless auto_create is true, in which case a service account will be created. Set the variable to null to avoid attaching a service account. | object({…}) | | {} |
-| [shielded_config](variables.tf#L304) | Shielded VM configuration of the instances. | object({…}) | | null |
-| [snapshot_schedules](variables.tf#L314) | Snapshot schedule resource policies that can be attached to disks. | map(object({…})) | | {} |
-| [tag_bindings](variables.tf#L357) | Tag bindings for this instance, in key => tag value id format. | map(string) | | null |
-| [tags](variables.tf#L363) | Instance network tags for firewall rule targets. | list(string) | | [] |
+| [options](variables.tf#L256) | Instance options. | object({…}) | | {…} |
+| [scratch_disks](variables.tf#L283) | Scratch disks configuration. | object({…}) | | {…} |
+| [service_account](variables.tf#L295) | Service account email and scopes. If email is null, the default Compute service account will be used unless auto_create is true, in which case a service account will be created. Set the variable to null to avoid attaching a service account. | object({…}) | | {} |
+| [shielded_config](variables.tf#L305) | Shielded VM configuration of the instances. | object({…}) | | null |
+| [snapshot_schedules](variables.tf#L315) | Snapshot schedule resource policies that can be attached to disks. | map(object({…})) | | {} |
+| [tag_bindings](variables.tf#L358) | Tag bindings for this instance, in key => tag value id format. | map(string) | | null |
+| [tags](variables.tf#L364) | Instance network tags for firewall rule targets. | list(string) | | [] |
## Outputs
diff --git a/modules/compute-vm/main.tf b/modules/compute-vm/main.tf
index 6d20a3238..e236e454b 100644
--- a/modules/compute-vm/main.tf
+++ b/modules/compute-vm/main.tf
@@ -237,6 +237,8 @@ resource "google_compute_instance" "default" {
network = config.value.network
subnetwork = config.value.subnetwork
network_ip = try(config.value.addresses.internal, null)
+ nic_type = config.value.nic_type
+ stack_type = config.value.stack_type
dynamic "access_config" {
for_each = config.value.nat ? [""] : []
content {
@@ -251,7 +253,6 @@ resource "google_compute_instance" "default" {
ip_cidr_range = config_alias.value
}
}
- nic_type = config.value.nic_type
}
}
@@ -374,6 +375,8 @@ resource "google_compute_instance_template" "default" {
network = config.value.network
subnetwork = config.value.subnetwork
network_ip = try(config.value.addresses.internal, null)
+ nic_type = config.value.nic_type
+ stack_type = config.value.stack_type
dynamic "access_config" {
for_each = config.value.nat ? [""] : []
content {
@@ -388,7 +391,6 @@ resource "google_compute_instance_template" "default" {
ip_cidr_range = config_alias.value
}
}
- nic_type = config.value.nic_type
}
}
diff --git a/modules/compute-vm/variables.tf b/modules/compute-vm/variables.tf
index e6a0a4c36..6d04f01b6 100644
--- a/modules/compute-vm/variables.tf
+++ b/modules/compute-vm/variables.tf
@@ -240,15 +240,16 @@ variable "name" {
variable "network_interfaces" {
description = "Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed."
type = list(object({
- nat = optional(bool, false)
network = string
subnetwork = string
+ alias_ips = optional(map(string), {})
+ nat = optional(bool, false)
+ nic_type = optional(string)
+ stack_type = optional(string)
addresses = optional(object({
internal = optional(string)
external = optional(string)
}), null)
- alias_ips = optional(map(string), {})
- nic_type = optional(string)
}))
}