Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployment/modules/gcp/gce/tesseract/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ resource "google_compute_region_instance_group_manager" "instance_group_manager"
}

base_instance_name = var.base_name
target_size = "3"
target_size = var.num_vms

update_policy {
type = "PROACTIVE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,43 @@ run "invalid_dates_not_after_limit_lowercase" {
var.not_after_limit,
]
}

run "valid_num_vms" {
command = plan

variables {
num_vms = 4
}
}

run "valid_num_vms_zero" {
command = plan

variables {
num_vms = 0
}
}

run "invalid_num_vms_negative" {
command = plan

variables {
num_vms = -1
}

expect_failures = [
var.num_vms,
]
}

run "invalid_num_vms_float" {
command = plan

variables {
num_vms = 2.5
}

expect_failures = [
var.num_vms,
]
}
12 changes: 12 additions & 0 deletions deployment/modules/gcp/gce/tesseract/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ variable "machine_type" {
default = "n2-standard-4"
}

variable "num_vms" {
description = "Number of VM instances to run in the regional managed instance group"
type = number
default = 3
nullable = false

validation {
condition = var.num_vms >= 0 && floor(var.num_vms) == var.num_vms
error_message = "num_vms must be a non-negative integer."
}
}

variable "bucket" {
description = "Log GCS bucket"
type = string
Expand Down
1 change: 1 addition & 0 deletions deployment/modules/gcp/tesseract/gce/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module "gce" {
docker_repo = var.docker_repo
server_docker_image = var.server_docker_image
machine_type = var.machine_type
num_vms = var.num_vms
not_after_start = var.not_after_start
not_after_limit = var.not_after_limit
bucket = module.storage.log_bucket.id
Expand Down
12 changes: 12 additions & 0 deletions deployment/modules/gcp/tesseract/gce/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ variable "machine_type" {
default = "n2-standard-4"
}

variable "num_vms" {
description = "Number of VM instances to run in the regional managed instance group"
type = number
default = 3
nullable = false

validation {
condition = var.num_vms >= 0 && floor(var.num_vms) == var.num_vms
error_message = "num_vms must be a non-negative integer."
}
}

variable "spanner_pu" {
description = "Amount of Spanner processing units"
type = number
Expand Down
Loading