-
Notifications
You must be signed in to change notification settings - Fork 501
/
Copy pathfirebase.tf
49 lines (39 loc) · 1.19 KB
/
firebase.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
provider "google-beta" {
project = var.project
region = var.region
credentials = base64decode(google_service_account_key.firebase_key.private_key)
}
resource "google_service_account" "firebase" {
account_id = "firebase"
display_name = "FireBase Service Account"
depends_on = [
google_project_iam_member.owner,
google_project_service.firebase,
]
}
resource "google_project_iam_member" "service_account_firebase_admin" {
role = "roles/editor"
member = "serviceAccount:${google_service_account.firebase.email}"
}
resource "google_service_account_key" "firebase_key" {
service_account_id = google_service_account.firebase.name
}
resource "google_firebase_project" "default" {
provider = google-beta
depends_on = [
google_project_service.firebase,
google_project_iam_member.service_account_firebase_admin,
]
}
resource "google_firebase_project_location" "default" {
provider = google-beta
location_id = var.firebase_location
depends_on = [
google_firebase_project.default,
]
}
resource "google_firebase_web_app" "wild_workouts" {
provider = google-beta
display_name = "Wild Workouts"
depends_on = [google_firebase_project.default]
}