Skip to content

Commit

Permalink
Cleaning up TF vars
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenomitch committed Jun 28, 2022
1 parent 5a04b2c commit 32d98c8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 26 deletions.
4 changes: 2 additions & 2 deletions aws_cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ resource "aws_autoscaling_group" "servers" {

resource "aws_autoscaling_group" "clients" {
desired_capacity = var.desired_clients
max_size = var.max_servers
min_size = var.min_servers
max_size = var.max_clients
min_size = var.min_clients

launch_configuration = aws_launch_configuration.client_launch.name
vpc_zone_identifier = aws_subnet.public.*.id
Expand Down
68 changes: 44 additions & 24 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ variable "authoritative_region" {
default = "us-east-1"
}

/* Not used unless multi-region Nomad is set up */

variable "replication_token" {
type = string
default = ""
Expand All @@ -33,6 +35,20 @@ variable "common_tag" {
default = "nomad-stack"
}

variable "cluster_name" {
type = string
default = "nomad-stack"
}

variable "associate_public_ip_address" {
type = bool
default = true
}

variable "key_name" {
type = string
default = "nomad-stack"
}

// PORTS

Expand Down Expand Up @@ -78,7 +94,7 @@ variable "whitelist_ip" {
default = "0.0.0.0/0"
}

// == ALB ==
// ALB

variable "base_amis" {
type = map(any)
Expand All @@ -91,52 +107,56 @@ variable "base_amis" {
description = "The id of the machine image (AMI) to use for the server. Ubuntu 20.04 LTS AMD 64"
}

variable "key_name" {
type = string
default = "nomad-stack"
}
// SERVER ASG

variable "server_instance_type" {
type = string
default = "t2.small"
variable "desired_servers" {
type = number
default = 1
}

variable "client_instance_type" {
type = string
default = "t2.small"
/*
Nomad should have one, three, or five servers by default.
Three is recommended for most production setups.
One is viable but does not allow for a high availibility raft cluster.
*/
variable "max_servers" {
type = number
default = 3
}

variable "desired_servers" {
variable "min_servers" {
type = number
default = 1
}

variable "server_instance_type" {
type = string
default = "t2.small"
}

variable "desired_clients" {
type = number
default = 1
default = 2
}

variable "max_servers" {
// == CLIENT ASG ==

variable "max_clients" {
type = number
default = 3
default = 10
}

variable "min_servers" {
variable "min_clients" {
type = number
default = 1
}

variable "cluster_name" {
variable "client_instance_type" {
type = string
default = "nomad-stack"
}

variable "associate_public_ip_address" {
type = bool
default = true
default = "t2.small"
}

// == SERVER DATA ==
// == SERVER & CLIENT DATA ==

variable "retry_join" {
type = map(any)
Expand Down

0 comments on commit 32d98c8

Please sign in to comment.