-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
114 lines (100 loc) · 2.88 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
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
provider "google" {
version = "~> 3.37.0"
credentials = file("./.keys/terraform.json")
project = var.project
region = var.region
}
provider "google-beta" {
version = "~> 3.37.0"
credentials = file("./.keys/terraform.json")
project = var.project
region = var.region
}
resource "google_project_service" "service" {
count = length(var.project_services)
project = var.project
service = element(var.project_services, count.index)
disable_on_destroy = false
disable_dependent_services = false
}
provider "null" {
version = "~> 2.1.2"
}
provider "random" {
version = "~> 2.3"
}
resource "random_password" "auth" {
length = 16
special = true
override_special = "_%@"
}
module "network" {
source = "./network"
services = google_project_service.service
project = var.project
region = var.region
}
module "ssl" {
source = "./ssl"
domain = var.domain
services = google_project_service.service
}
module "dns" {
source = "./dns"
static_ip = module.network.static_ip
domain = var.domain
services = google_project_service.service
}
module "service-accounts" {
source = "./service-accounts"
services = google_project_service.service
}
module "firestore" {
source = "./firestore"
services = google_project_service.service
collection = var.collection
project = var.project
}
module "pubsub" {
source = "./pubsub"
services = google_project_service.service
topic = var.topic
}
module "compute" {
source = "./compute"
image_name = var.image_name
image_version = var.image_version
registry = var.registry
project = var.project
services = google_project_service.service
service_account_email = module.service-accounts.default_account
static_ip = module.network.static_ip
static_ip_id = module.network.static_ip
ssl_cert_id = module.ssl.id
vpc_link = module.network.vpc_link
sheet_id = var.sheet_id
tab_id = var.tab_id
start_row = var.start_row
topic = var.topic
basic_auth_pass = random_password.auth.result
redis_url = var.redis_url
collection = var.collection
}
module "scheduler" {
source = "./scheduler"
services = google_project_service.service
project = var.project
region = var.region
timezone = var.timezone
app_url = module.compute.app_url
basic_auth_pass = random_password.auth.result
}
module "build" {
source = "./build"
services = google_project_service.service
project = var.project
topic = var.topic
image_name = var.image_name
owner = var.owner
repo = var.repo
}