-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
140 lines (122 loc) · 2.98 KB
/
variables.tf
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
variable "aws_credentials_file" {
description = "full path to your local AWS credentials file"
type = string
}
variable "aws_profile" {
description = "Name of the profile to use from the AWS credentials file"
type = string
}
variable "app_config" {
default = {
cloud = ""
app_name = ""
environment = ""
owner = ""
customer_name = "dev"
org_name = ""
base_name_prefix = ""
service_account_name = ""
rbac_role_name = ""
region = "us-gov-east-1"
base_domain = ""
kubernetes_version = "1.24"
dns_zone_id = ""
object_storage = {}
vpc = {
cidr_block = "10.0.0.0/16"
}
helm = {
chart_name = ""
chart_version = ""
chart_namespace = ""
chart_repository = ""
timeout = ""
}
kubernetes = {
private_cluster = true
cluster_name = ""
cp_node_type = ""
worker_node_type = ""
rbac_enabled = true # maps to enable_irsa EKS and role_based_access_control_enabled AKS
enable_kms = true
}
vpn = {
client_cidr_block = "172.16.0.0/20"
dns_servers = ["1.1.1.1", "1.0.0.1"]
session_timeout_hours = 8
retention_in_days = 365
}
repository = {
repository_name = ""
visibility = "private"
replication_regions = ["us-gov-west-1", "us-gov-east-1"]
}
managed_kubernetes = {
cluster_addons = {
coredns = {}
kube-proxy = {}
cni = {}
}
}
}
}
locals {
provider = var.cloud
provider_config = {
cloud = local.provider
node_types = var.node_types[local.provider]
cp_node_size = var.node_types[local.provider].large
worker_node_size = var.node_types[local.provider].xlarge
}
cp_nodes = var.managed_nodes["controlplane"]
worker_nodes = var.managed_nodes["worker"]
cluster_name = lower(join("-", [var.app_config.base_name_prefix, var.app_config.customer_name]))
base_name_prefix = "${var.app_config.app_name}-${var.app_config.environment}"
}
variable "managed_nodes" {
type = map(object({
count = optional(number)
type = string
disk_size = number
}))
default = {
controlplane = {
disk_size = 100
type = ""
}
worker = {
count = 3
disk_size = 100
type = ""
}
}
}
# 2cpu/8gb -> m5.large = d2as v5
# 4cpu/16gb -> m5.xlarge = d4as v5
# 8cpu/32gb -> m5.2xlarge = d8as v5
variable "node_types" {
default = {
aws = {
large = {
type = "m5.large"
}
xlarge = {
type = "m5.xlarge"
}
"2xlarge" = {
type = "m5.2xlarge"
}
}
azure = {
large = {
type = "Standard_D2as_v5"
}
xlarge = {
type = "Standard_D4as_v5"
}
"2xlarge" = {
type = "Standard_D8as_v5"
}
}
}
}