forked from flolu/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
85 lines (70 loc) · 2.21 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
82
83
84
85
terraform {
backend "gcs" {
bucket = "flolu-auth-demo-terraform-state"
prefix = "production"
}
}
module "kubernetes" {
source = "./modules/google-kubernetes-engine"
project = var.google_cloud_project
region = var.gke_zone
machine_type = "e2-small"
}
module "cert_manager" {
source = "./modules/kubernetes-cert-manager"
kubernetes_endpoint = module.kubernetes.endpoint
email = var.email
}
module "ingress" {
source = "./modules/kubernetes-nginx-ingress"
domain = var.domain
kubernetes_endpoint = module.kubernetes.endpoint
}
module "dns" {
source = "./modules/domain-name-system"
ip = module.ingress.ip
domain = var.domain
}
module "mongodb" {
source = "./modules/mongodb-atlas"
atlas_project_id = var.atlas_project_id
mongodbatlas_public_key = var.mongodbatlas_public_key
mongodbatlas_private_key = var.mongodbatlas_private_key
}
module "configuration" {
source = "./modules/kubernetes-configuration"
environment = var.environment
base_domain = var.domain
client_url = var.client_url
api_url = var.api_url
realtime_url = var.realtime_url
mongodb_database = module.mongodb.database
mongodb_url = module.mongodb.url
mongodb_user = module.mongodb.user
mongodb_password = module.mongodb.password
refresh_token_secret = var.refresh_token_secret
access_token_secret = var.access_token_secret
github_client_id = var.github_client_id
github_client_secret = var.github_client_secret
kubernetes_endpoint = module.kubernetes.endpoint
}
module "api" {
source = "./modules/api-service"
image = var.api_image
config_name = module.configuration.name
}
module "realtime" {
source = "./modules/realtime-service"
image = var.realtime_image
config_name = module.configuration.name
}
module "client" {
source = "./modules/client"
image = var.client_image
environment = var.environment
api_url = var.api_url
github_client_id = var.github_client_id
github_redirect_url = var.github_redirect_url
realtime_url = var.realtime_url
domain = var.domain
}