1
- resource "google_developer_connect_connection" "my-connection" {
2
- project = "{{index $.TestEnvVars "project_id"}}"
3
- location = "us-central1"
4
- connection_id = "tf-test-connection-new"
5
- github_config {
6
- github_app = "FIREBASE"
1
+ resource "google_firebase_app_hosting_backend" "example" {
2
+ project = "{{index $.TestEnvVars "project_id"}}"
3
+
4
+ # Choose the region closest to your users
5
+ location = "us-central1"
6
+ backend_id = "{{index $.Vars "backend_id"}}"
7
+ app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
8
+ display_name = "My Backend"
9
+ serving_locality = "GLOBAL_ACCESS"
10
+ service_account = "firebase-app-hosting-compute@{{index $.TestEnvVars "project_id"}}.iam.gserviceaccount.com"
11
+ environment = "prod"
12
+
13
+ annotations = {
14
+ "key" = "value"
15
+ }
16
+
17
+ labels = {
18
+ "key" = "value"
19
+ }
20
+
21
+ codebase {
22
+ repository = google_developer_connect_git_repository_link.my-repository.name
23
+ root_directory = "/"
7
24
}
8
- depends_on = [google_project_iam_member.devconnect-secret]
9
25
}
10
26
11
27
resource "google_developer_connect_git_repository_link" "my-repository" {
@@ -17,12 +33,7 @@ resource "google_developer_connect_git_repository_link" "my-repository" {
17
33
clone_uri = "https://github.com/myuser/myrepo.git"
18
34
}
19
35
20
- output "next_steps" {
21
- description = "Follow the action_uri if present to continue setup"
22
- value = google_developer_connect_connection.my-connection.installation_state
23
- }
24
-
25
- # Setup permissions. Only needed once per project
36
+ ### Include these blocks only once per project if you are starting from scratch ###
26
37
resource "google_project_service_identity" "devconnect-p4sa" {
27
38
provider = google-beta
28
39
@@ -36,29 +47,21 @@ resource "google_project_iam_member" "devconnect-secret" {
36
47
role = "roles/secretmanager.admin"
37
48
member = google_project_service_identity.devconnect-p4sa.member
38
49
}
50
+ ###
39
51
40
- resource "google_firebase_app_hosting_backend" "example" {
41
- project = "{{index $.TestEnvVars "project_id"}}"
42
-
43
- # Choose the region closest to your users
44
- location = "us-central1"
45
- backend_id = "{{index $.Vars "backend_id"}}"
46
- app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
47
- display_name = "My Backend"
48
- serving_locality = "GLOBAL_ACCESS"
49
- service_account = "firebase-app-hosting-compute@{{index $.TestEnvVars "project_id"}}.iam.gserviceaccount.com"
50
- environment = "prod"
51
-
52
- annotations = {
53
- "key" = "value"
54
- }
55
-
56
- labels = {
57
- "key" = "value"
52
+ ### Include these blocks only once per Github account ###
53
+ resource "google_developer_connect_connection" "my-connection" {
54
+ project = "{{index $.TestEnvVars "project_id"}}"
55
+ location = "us-central1"
56
+ connection_id = "tf-test-connection-new"
57
+ github_config {
58
+ github_app = "FIREBASE"
58
59
}
60
+ depends_on = [google_project_iam_member.devconnect-secret]
61
+ }
59
62
60
- codebase {
61
- repository = google_developer_connect_git_repository_link.my-repository.name
62
- root_directory = "/"
63
- }
64
- }
63
+ output "next_steps" {
64
+ description = "Follow the action_uri if present to continue setup"
65
+ value = google_developer_connect_connection.my-connection.installation_state
66
+ }
67
+ ###
0 commit comments