-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
82 lines (69 loc) · 2 KB
/
main.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
module "networking" {
source = "./modules/networking"
namespace = var.namespace
zone = var.zone
}
module "storage" {
source = "./modules/storage"
namespace = var.namespace
zone = var.zone
network = module.networking.network
}
module "database" {
source = "./modules/database"
namespace = var.namespace
network = module.networking.network
zone = var.zone
}
module "app_uks" {
source = "./modules/app_uks"
namespace = var.namespace
network = module.networking.network
zone = var.zone
deploy_nginx_ingress = var.deploy_nginx_ingress
}
module "app_lb" {
source = "./modules/app_lb"
namespace = var.namespace
network = module.networking.network
zone = var.zone
fqdn = local.fqdn
}
#module "redis" {
# source = "./modules/redis"
# namespace = var.namespace
# network = module.networking.network
# zone = var.zone
#}
locals {
other_envs = {
# "BUCKET" = module.storage.bucket_connection_string
# "MYSQL" = module.database.connection_string
# "REDIS" = module.redis.connection_string
# Fake value. no meaning.
"AWS_REGION" = "var-must-be-set-despite-not-needed"
}
env_vars = merge(
local.other_envs,
var.other_wandb_env,
)
}
locals {
fqdn = var.subdomain == null ? var.domain_name : "${var.subdomain}.${var.domain_name}"
url = "https://${local.fqdn}"
}
module "wandb_app" {
source = "wandb/wandb/kubernetes"
version = "1.14.1"
license = var.license
wandb_replicas = 1
host = local.url
bucket = module.storage.bucket_connection_string
bucket_queue = "internal://"
database_connection_string = module.database.connection_string
#redis_connection_string = module.redis.connection_string
other_wandb_env = merge({
# Fake value. no meaning. But required.
"AWS_REGION" = "var-must-be-set-despite-not-needed"
}, var.other_wandb_env)
}