diff --git a/examples/terraform/aws-complete/provision.tf b/examples/terraform/aws-complete/provision.tf index 53262dff..185c901f 100644 --- a/examples/terraform/aws-complete/provision.tf +++ b/examples/terraform/aws-complete/provision.tf @@ -8,19 +8,15 @@ locals { module "provision" { source = "terraform-mirantis-modules/provision-aws/mirantis" - name = var.name - network = { - cidr = var.network.cidr - public_subnet_count = 1 - private_subnet_count = 0 - enable_vpn_gateway = false - enable_nat_gateway = false - tags = local.tags - } + name = var.name + network = var.network + subnets = var.subnets // pass in a mix of nodegroups with the platform information nodegroups = { for k, ngd in local.nodegroups_wplatform : k => { - ami : ngd.ami + source_image = { + ami = ngd.ami + } count : ngd.count type : ngd.type keypair_id : module.key.keypair_id diff --git a/examples/terraform/aws-complete/variables.tf b/examples/terraform/aws-complete/variables.tf index 43cda58a..e90cac62 100644 --- a/examples/terraform/aws-complete/variables.tf +++ b/examples/terraform/aws-complete/variables.tf @@ -14,30 +14,45 @@ variable "name" { type = string } +# === Networking === variable "network" { description = "Network configuration" type = object({ - cidr = string - public_subnet_count = number - private_subnet_count = number + cidr = string + enable_nat_gateway = optional(bool, false) + enable_vpn_gateway = optional(bool, false) + tags = optional(map(string), {}) }) default = { - cidr = "172.31.0.0/16" - public_subnet_count = 3 - private_subnet_count = 3 + enable_nat_gateway = false + enable_vpn_gateway = false + cidr = "172.31.0.0/16" + tags = {} } } +# === subnets === +variable "subnets" { + description = "The subnets configuration" + type = map(object({ + cidr = string + nodegroups = list(string) + private = optional(bool, false) + })) + default = {} +} + +# === Machines === variable "nodegroups" { description = "A map of machine group definitions" type = map(object({ + role = string platform = string type = string - count = number - volume_size = number - role = string - public = bool - user_data = string + count = optional(number, 1) + volume_size = optional(number, 100) + public = optional(bool, true) + user_data = optional(string, "") })) } diff --git a/examples/terraform/aws-simple/variables.tf b/examples/terraform/aws-simple/variables.tf index 381526a7..333318ad 100644 --- a/examples/terraform/aws-simple/variables.tf +++ b/examples/terraform/aws-simple/variables.tf @@ -43,7 +43,6 @@ variable "subnets" { } # === Machines === - variable "nodegroups" { description = "A map of machine group definitions" type = map(object({ diff --git a/test/smoke/smoke_test.go b/test/smoke/smoke_test.go index 533025fa..11cd0fd1 100644 --- a/test/smoke/smoke_test.go +++ b/test/smoke/smoke_test.go @@ -32,7 +32,9 @@ var LAUNCHPAD = map[string]interface{}{ // configure the network stack var NETWORK = map[string]interface{}{ - "cidr": "172.31.0.0/16", + "cidr": "172.31.0.0/16", + "enable_nat_gateway": false, + "enable_vpn_gateway": false, } var SUBNETS = map[string]interface{}{ "main": map[string]interface{}{