-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvariables.tf
More file actions
91 lines (75 loc) · 2.79 KB
/
variables.tf
File metadata and controls
91 lines (75 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#------------------------------------------------------------------------------#
# Cloud Auto Join
#------------------------------------------------------------------------------#
# Random suffix for Auto-join and resource naming
resource "random_string" "suffix" {
length = 4
special = false
upper = false
}
# Prefix for resource names
variable "prefix" {
description = "The prefix used for all resources in this plan"
default = "learn-consul-nomad-vms"
}
# Random prefix for resource names
locals {
name = "${var.prefix}-${random_string.suffix.result}"
}
# Random Auto-Join for Consul servers
# Nomad servers will use Consul to join the cluster
locals {
retry_join_consul = "provider=aws tag_key=ConsulJoinTag tag_value=auto-join-${random_string.suffix.result}"
}
#------------------------------------------------------------------------------#
# AWS Related Variables
#------------------------------------------------------------------------------#
variable "allowlist_ip" {
description = "IP to allow access for the security groups (set 0.0.0.0/0 for world)"
default = "0.0.0.0/0"
}
variable "server_instance_type" {
description = "The AWS instance type to use for servers."
default = "t3.micro"
}
variable "client_instance_type" {
description = "The AWS instance type to use for clients."
default = "t3.small"
}
variable "root_block_device_size" {
description = "The volume size of the root block device."
default = 16
}
#------------------------------------------------------------------------------#
# Cluster Related Variables
#------------------------------------------------------------------------------#
# Used to define Consul datacenter and Nomad region
variable "domain" {
description = "Domain used to deploy Consul and Nomad and to generate TLS certificates."
default = "global"
}
# Used to define Consul and Nomad domain
variable "datacenter" {
description = "Datacenter used to deploy Consul and Nomad and to generate TLS certificates."
default = "dc1"
}
# Number of Consul and Nomad server instances to start
variable "server_count" {
description = "The number of servers to provision."
default = "2"
}
# Number of externally accessible Consul and Nomad client instances to start
# They will be used to deploy API Gateways and reverse proxies to access services
# in the Consul datacenter
variable "public_client_count" {
description = "The number of clients to provision."
default = "2"
}
#------------------------------------------------------------------------------#
# HCP Packer
#------------------------------------------------------------------------------#
variable "hcp_packer_bucket_name" {
type = string
description = "Name of the HCP Packer bucket containing the Nomad image"
default = "nomad-consul"
}