Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRODENG-2861 Fixed the complete example according to provision module #552

Merged
merged 1 commit into from
Jan 29, 2025
Merged
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
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",
"enable_nat_gateway": false,
"enable_vpn_gateway": false,
}
var SUBNETS = map[string]interface{}{
"main": map[string]interface{}{
Expand Down