generated from cgs-earth/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
64 lines (52 loc) · 1.68 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 configuration
provider "google" {
project = var.project_id
region = var.region
credentials = file(var.credentials)
}
# Enable required APIs
resource "google_project_service" "apis" {
for_each = toset([
"sqladmin.googleapis.com",
"run.googleapis.com",
"cloudbuild.googleapis.com",
"secretmanager.googleapis.com"
])
service = each.key
disable_on_destroy = false
}
resource "google_artifact_registry_repository" "wqp" {
location = var.region
repository_id = "wqp-docker-repo"
format = "DOCKER"
}
data "external" "generate_partitions" {
program = ["uv", "run", "./src/wqp/partitions.py"]
}
module "database" {
source = "./modules/database"
project_id = var.project_id
region = var.region
database_password = var.database_password
depends_on = [google_project_service.apis]
}
module "frost" {
source = "./modules/frost"
project_id = var.project_id
region = var.region
wqp_url = var.wqp_url
database_instance = module.database.instance
database_name = module.database.database_name
database_user = module.database.user_name
database_password = var.database_password
depends_on = [module.database, google_artifact_registry_repository.wqp]
}
module "dagster" {
source = "./modules/dagster"
project_id = var.project_id
region = var.region
frost_uri = module.frost.service_uri
slack_bot_token = var.slack_bot_token
partitions = data.external.generate_partitions.result
depends_on = [module.frost, google_artifact_registry_repository.wqp]
}