Skip to content

Commit

Permalink
PRODENG-2861 Fixed the complete example according to provision module
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar <[email protected]>
  • Loading branch information
cranzy committed Jan 28, 2025
1 parent 0e28bdc commit 970cf74
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
16 changes: 6 additions & 10 deletions examples/terraform/aws-complete/provision.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 26 additions & 11 deletions examples/terraform/aws-complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}))
}

Expand Down
1 change: 0 additions & 1 deletion examples/terraform/aws-simple/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ variable "subnets" {
}

# === Machines ===

variable "nodegroups" {
description = "A map of machine group definitions"
type = map(object({
Expand Down
4 changes: 3 additions & 1 deletion test/smoke/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"public_subnet_count": 1,
"private_subnet_count": 0,
}
var SUBNETS = map[string]interface{}{
"main": map[string]interface{}{
Expand Down

0 comments on commit 970cf74

Please sign in to comment.