Skip to content

Commit 30ea91e

Browse files
committed
Reorder example to be dependencies last
1 parent f36b1ac commit 30ea91e

File tree

3 files changed

+75
-72
lines changed

3 files changed

+75
-72
lines changed

mmv1/templates/terraform/examples/firebase_app_hosting_backend_full.tf.tmpl

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
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 = google_service_account.service_account.email
11+
environment = "prod"
12+
13+
annotations = {
14+
"key" = "value"
15+
}
16+
17+
labels = {
18+
"key" = "value"
19+
}
20+
21+
depends_on = [google_project_service.fah]
22+
}
23+
124
### Include these blocks only once per project if you are starting from scratch ###
225
resource "google_service_account" "service_account" {
326
project = "{{index $.TestEnvVars "project_id"}}"
@@ -41,26 +64,3 @@ resource "google_project_service" "fah" {
4164
disable_on_destroy = false
4265
}
4366
###
44-
45-
resource "google_firebase_app_hosting_backend" "example" {
46-
project = "{{index $.TestEnvVars "project_id"}}"
47-
48-
# Choose the region closest to your users
49-
location = "us-central1"
50-
backend_id = "{{index $.Vars "backend_id"}}"
51-
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
52-
display_name = "My Backend"
53-
serving_locality = "GLOBAL_ACCESS"
54-
service_account = google_service_account.service_account.email
55-
environment = "prod"
56-
57-
annotations = {
58-
"key" = "value"
59-
}
60-
61-
labels = {
62-
"key" = "value"
63-
}
64-
65-
depends_on = [google_project_service.fah]
66-
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
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 = "/"
724
}
8-
depends_on = [google_project_iam_member.devconnect-secret]
925
}
1026

1127
resource "google_developer_connect_git_repository_link" "my-repository" {
@@ -17,12 +33,7 @@ resource "google_developer_connect_git_repository_link" "my-repository" {
1733
clone_uri = "https://github.com/myuser/myrepo.git"
1834
}
1935

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 ###
2637
resource "google_project_service_identity" "devconnect-p4sa" {
2738
provider = google-beta
2839

@@ -36,29 +47,21 @@ resource "google_project_iam_member" "devconnect-secret" {
3647
role = "roles/secretmanager.admin"
3748
member = google_project_service_identity.devconnect-p4sa.member
3849
}
50+
###
3951

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"
5859
}
60+
depends_on = [google_project_iam_member.devconnect-secret]
61+
}
5962

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+
###

mmv1/templates/terraform/examples/firebase_app_hosting_backend_minimal.tf.tmpl

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
resource "google_firebase_app_hosting_backend" "example" {
2+
project = "{{index $.TestEnvVars "project_id"}}"
3+
# Choose the region closest to your users
4+
5+
location = "us-central1"
6+
backend_id = "{{index $.Vars "backend_id"}}"
7+
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
8+
serving_locality = "GLOBAL_ACCESS"
9+
service_account = google_service_account.service_account.email
10+
11+
depends_on = [google_project_service.fah]
12+
}
13+
114
### Include these blocks only once per project if you are starting from scratch ###
215
resource "google_service_account" "service_account" {
316
project = "{{index $.TestEnvVars "project_id"}}"
@@ -25,16 +38,3 @@ resource "google_project_service" "fah" {
2538
disable_on_destroy = false
2639
}
2740
###
28-
29-
resource "google_firebase_app_hosting_backend" "example" {
30-
project = "{{index $.TestEnvVars "project_id"}}"
31-
# Choose the region closest to your users
32-
33-
location = "us-central1"
34-
backend_id = "{{index $.Vars "backend_id"}}"
35-
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
36-
serving_locality = "GLOBAL_ACCESS"
37-
service_account = google_service_account.service_account.email
38-
39-
depends_on = [google_project_service.fah]
40-
}

0 commit comments

Comments
 (0)