File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ locals {
2121 compute_region_zones = length (var. compute_instance_availability_zones ) == 0 ? data. google_compute_zones . in_region . names : var. compute_instance_availability_zones
2222}
2323
24- # Fetch most recent COS image
24+ # Fetch most recent Ubuntu image based on architecture
2525data "google_compute_image" "ubuntu" {
26- family = " ubuntu-2404-lts"
26+ family = " ubuntu-2404-lts- ${ var . compute_instance_architecture } "
2727 project = " ubuntu-os-cloud"
2828}
2929
Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ variable "compute_instance_type" {
3333 type = string
3434}
3535
36+ variable "compute_instance_architecture" {
37+ type = string
38+ default = " amd64"
39+ description = " The architecture of the compute instance (amd64 or arm64)"
40+
41+ validation {
42+ condition = contains ([" amd64" , " arm64" ], var. compute_instance_architecture )
43+ error_message = " Architecture must be either 'amd64' or 'arm64'."
44+ }
45+ }
46+
3647variable "compute_provision_public_ipv4_address" {
3748 type = bool
3849 default = true
You can’t perform that action at this time.
0 commit comments