-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
64 lines (55 loc) · 1.55 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
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"
}
module "network" {
source = "./network"
services = google_project_service.service
}
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 "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.cloud_run_email
static_ip_id = module.network.static_ip
ssl_cert_id = module.ssl.id
}