-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.tf
48 lines (35 loc) · 895 Bytes
/
project.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
provider "google" {
alias = "seed"
}
provider "google" {
project = google_project.samatar_dev.project_id
}
variable "billing_account" {}
locals {
project_name = "samatar-dev"
}
resource "random_id" "project_id" {
byte_length = 4
prefix = "${local.project_name}-"
}
resource "google_project" "samatar_dev" {
provider = google.seed
name = local.project_name
project_id = random_id.project_id.hex
billing_account = var.billing_account
}
resource "google_project_service" "s" {
project = google_project.samatar_dev.project_id
service = each.key
for_each = {
for i in [
"cloudresourcemanager.googleapis.com",
"cloudbilling.googleapis.com",
"iam.googleapis.com",
"serviceusage.googleapis.com",
"storage-api.googleapis.com",
"containerregistry.googleapis.com",
"sqladmin.googleapis.com"
] : i => i
}
}