-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.tf
65 lines (52 loc) · 1.69 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
provider "google" {
credentials = base64decode(var.google.credentials_json_b64)
project = var.google.project
region = var.google.region
zone = var.google.zone
}
resource "google_project_service" "gcp_services" {
for_each = toset([
"cloudresourcemanager.googleapis.com",
"cloudscheduler.googleapis.com",
"secretmanager.googleapis.com",
"compute.googleapis.com",
"cloudfunctions.googleapis.com",
"cloudbuild.googleapis.com",
])
service = each.key
disable_on_destroy = false
}
terraform {
backend "remote" {}
}
module "start_and_stop" {
source = "./modules/start-and-stop"
google = var.google
runner = var.runner
scaling = var.scaling
triggers = var.triggers
github_api_trigger_url = module.github_api.github_api_trigger_url
github_org = var.github.organisation
depends_on = [google_project_service.gcp_services]
}
module "github_api" {
source = "./modules/github-api"
secret_github_json = module.secrets.secret_github_json
google = var.google
depends_on = [google_project_service.gcp_services]
}
module "secrets" {
source = "./modules/secrets"
github = var.github
depends_on = [google_project_service.gcp_services]
}
module "github_hook" {
source = "./modules/github-hook"
google = var.google
secret_github_json = module.secrets.secret_github_json
start_and_stop_topic_name = module.start_and_stop.start_and_stop_topic_name
depends_on = [google_project_service.gcp_services]
}
output "github_webhook_url" {
value = module.github_hook.github_hook_trigger_url
}