Skip to content

Commit

Permalink
Add "path" property to rewrite config for firebase hosting version (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdietrichstein authored and BBBmau committed May 8, 2024
1 parent 825fee1 commit 5464e70
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mmv1/products/firebasehosting/Version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ examples:
site_id: site-id
test_env_vars:
project_id: :PROJECT_NAME
- !ruby/object:Provider::Terraform::Examples
name: 'firebasehosting_version_path'
min_version: 'beta'
primary_resource_id: 'default'
vars:
site_id: site-id
test_env_vars:
project_id: :PROJECT_NAME
- !ruby/object:Provider::Terraform::Examples
name: 'firebasehosting_version_cloud_run'
min_version: 'beta'
Expand Down Expand Up @@ -112,18 +120,28 @@ properties:
exactly_one_of:
- glob
- regex
- !ruby/object:Api::Type::String
name: path
description:
The URL path to rewrite the request to.
exactly_one_of:
- path
- function
- run
- !ruby/object:Api::Type::String
name: function
description:
The function to proxy requests to. Must match the exported
function name exactly.
exactly_one_of:
- path
- function
- run
- !ruby/object:Api::Type::NestedObject
name: run
description: The request will be forwarded to Cloud Run.
exactly_one_of:
- path
- function
- run
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 {
rewrites {
glob = "**"
path = "/index.html"
}
}
}

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 = "Path Rewrite"
}

0 comments on commit 5464e70

Please sign in to comment.