-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
64 lines (54 loc) · 1.53 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
locals {
credentials_file_path = var.credentials_path
}
provider "google" {
credentials = file(local.credentials_file_path)
version = "~> 3.30"
}
provider "google-beta" {
credentials = file(local.credentials_file_path)
version = "~> 3.30"
}
provider "gsuite" {
credentials = file(local.credentials_file_path)
impersonated_user_email = var.admin_email
oauth_scopes = [
"https://www.googleapis.com/auth/admin.directory.group",
"https://www.googleapis.com/auth/admin.directory.group.member",
]
version = "~> 0.1.12"
}
provider "null" {
version = "~> 2.1"
}
provider "random" {
version = "~> 2.2"
}
resource "google_folder" "prod" {
display_name = "gcp-prod"
parent = "organizations/${var.organization_id}"
}
module "etl" {
source = "terraform-google-modules/project-factory/google"
version = "9.0.0"
org_id = var.organization_id
random_project_id = true
name = "etl"
auto_create_network = false
billing_account = var.billing_account
folder_id = google_folder.prod.id
credentials_path = local.credentials_file_path
default_service_account = keep
}
module "api" {
source = "terraform-google-modules/project-factory/google"
version = "9.0.0"
org_id = var.organization_id
random_project_id = true
name = "api"
auto_create_network = false
billing_account = var.billing_account
folder_id = google_folder.prod.id
credentials_path = local.credentials_file_path
default_service_account = keep
}