Changed the method of defining subnets in the main module.
This commit is contained in:
+20
-11
@@ -6,13 +6,13 @@ variable "project_id" {
|
||||
variable "region" {
|
||||
description = "The region for the resources."
|
||||
type = string
|
||||
default = "europe-central2"
|
||||
default = "us-west1"
|
||||
}
|
||||
|
||||
variable "zone" {
|
||||
description = "The zone for the resources."
|
||||
type = string
|
||||
default = "europe-central2-b"
|
||||
default = "us-west1-a"
|
||||
}
|
||||
|
||||
variable "network_name" {
|
||||
@@ -21,16 +21,25 @@ variable "network_name" {
|
||||
default = "dom-lab-network"
|
||||
}
|
||||
|
||||
variable "subnet_name" {
|
||||
description = "The name of the subnet."
|
||||
type = string
|
||||
default = "waw-default"
|
||||
}
|
||||
variable "subnets" {
|
||||
description = "A list of subnets to create."
|
||||
|
||||
variable "subnet_cidr" {
|
||||
description = "The CIDR range for the subnet."
|
||||
type = string
|
||||
default = "192.168.16.0/24"
|
||||
type = list(object({
|
||||
name = string
|
||||
cidr = string
|
||||
region = string
|
||||
}))
|
||||
|
||||
default = [{
|
||||
name = "waw-default"
|
||||
cidr = "192.168.16.0/24"
|
||||
region = "us-west1"
|
||||
}]
|
||||
|
||||
validation {
|
||||
condition = var.subnets[0].region != null
|
||||
error_message = "The region for the first subnet must be specified."
|
||||
}
|
||||
}
|
||||
|
||||
variable "ssh" {
|
||||
|
||||
Reference in New Issue
Block a user