forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cloud Run and Cloud Functions integration with Firebase Hosting hashi…
- Loading branch information
1 parent
15a6c47
commit 3028eda
Showing
12 changed files
with
504 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
mmv1/templates/terraform/decoders/firebasehosting_release.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if err := d.Set("release_id", GetResourceNameFromSelfLink(res["name"].(string))); err != nil { | ||
return nil, err | ||
} | ||
|
||
return res, nil |
5 changes: 5 additions & 0 deletions
5
mmv1/templates/terraform/decoders/firebasehosting_version.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if err := d.Set("version_id", GetResourceNameFromSelfLink(res["name"].(string))); err != nil { | ||
return nil, err | ||
} | ||
|
||
return res, nil |
12 changes: 12 additions & 0 deletions
12
mmv1/templates/terraform/examples/firebasehosting_release_disable.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
resource "google_firebase_hosting_site" "default" { | ||
provider = google-beta | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
site_id = "<%= ctx[:vars]['site_id'] %>" | ||
} | ||
|
||
resource "google_firebase_hosting_release" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
type = "SITE_DISABLE" | ||
message = "Take down site" | ||
} |
32 changes: 32 additions & 0 deletions
32
mmv1/templates/terraform/examples/firebasehosting_release_in_channel.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "google_firebase_hosting_site" "default" { | ||
provider = google-beta | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
site_id = "<%= ctx[:vars]['site_id'] %>" | ||
} | ||
|
||
resource "google_firebase_hosting_version" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
config { | ||
redirects { | ||
glob = "/google/**" | ||
status_code = 302 | ||
location = "https://www.google.com" | ||
} | ||
} | ||
} | ||
|
||
resource "google_firebase_hosting_channel" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
channel_id = "<%= ctx[:vars]['channel_id'] %>" | ||
} | ||
|
||
resource "google_firebase_hosting_release" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
channel_id = google_firebase_hosting_channel.default.channel_id | ||
version_name = google_firebase_hosting_version.default.name | ||
message = "Test release in channel" | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
mmv1/templates/terraform/examples/firebasehosting_release_in_site.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
resource "google_firebase_hosting_site" "default" { | ||
provider = google-beta | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
site_id = "<%= ctx[:vars]['site_id'] %>" | ||
} | ||
|
||
resource "google_firebase_hosting_version" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
config { | ||
redirects { | ||
glob = "/google/**" | ||
status_code = 302 | ||
location = "https://www.google.com" | ||
} | ||
} | ||
} | ||
|
||
resource "google_firebase_hosting_release" "default" { | ||
provider = google-beta | ||
site_id = google_firebase_hosting_site.default.site_id | ||
version_name = google_firebase_hosting_version.default.name | ||
message = "Test release" | ||
} |
Oops, something went wrong.