diff --git a/mmv1/products/firebasehosting/Version.yaml b/mmv1/products/firebasehosting/Version.yaml index 26e0f4971548..2552abbe52bf 100644 --- a/mmv1/products/firebasehosting/Version.yaml +++ b/mmv1/products/firebasehosting/Version.yaml @@ -53,6 +53,13 @@ examples: site_id: 'site-id' test_env_vars: project_id: 'PROJECT_NAME' + - name: 'firebasehosting_version_headers_regex' + primary_resource_id: 'default' + min_version: 'beta' + vars: + site_id: 'site-id' + test_env_vars: + project_id: 'PROJECT_NAME' - name: 'firebasehosting_version_path' primary_resource_id: 'default' min_version: 'beta' diff --git a/mmv1/templates/terraform/examples/firebasehosting_version_headers_regex.tf.tmpl b/mmv1/templates/terraform/examples/firebasehosting_version_headers_regex.tf.tmpl new file mode 100644 index 000000000000..89d9ebe06502 --- /dev/null +++ b/mmv1/templates/terraform/examples/firebasehosting_version_headers_regex.tf.tmpl @@ -0,0 +1,26 @@ +resource "google_firebase_hosting_site" "default" { + provider = google-beta + project = "{{index $.TestEnvVars "project_id"}}" + site_id = "{{index $.Vars "site_id"}}" +} + +resource "google_firebase_hosting_version" "default" { + provider = google-beta + site_id = google_firebase_hosting_site.default.site_id + config { + headers { + # Also okay to use glob + regex = "^~/headers$" + headers = { + my-header = "my-value" + } + } + } +} + +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 = "With custom headers" +} \ No newline at end of file