@@ -59,6 +59,68 @@ resource "google_firebase_hosting_release" "default" {
59
59
message = "Redirect to Google"
60
60
}
61
61
```
62
+ ## Example Usage - Firebasehosting Version Headers
63
+
64
+
65
+ ``` hcl
66
+ resource "google_firebase_hosting_site" "default" {
67
+ provider = google-beta
68
+ project = "my-project-name"
69
+ site_id = "site-id"
70
+ }
71
+
72
+ resource "google_firebase_hosting_version" "default" {
73
+ provider = google-beta
74
+ site_id = google_firebase_hosting_site.default.site_id
75
+ config {
76
+ headers {
77
+ # Also okay to use regex
78
+ glob = "/headers/**"
79
+ headers = {
80
+ my-header = "my-value"
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ resource "google_firebase_hosting_release" "default" {
87
+ provider = google-beta
88
+ site_id = google_firebase_hosting_site.default.site_id
89
+ version_name = google_firebase_hosting_version.default.name
90
+ message = "With custom headers"
91
+ }
92
+ ```
93
+ ## Example Usage - Firebasehosting Version Headers Regex
94
+
95
+
96
+ ``` hcl
97
+ resource "google_firebase_hosting_site" "default" {
98
+ provider = google-beta
99
+ project = "my-project-name"
100
+ site_id = "site-id"
101
+ }
102
+
103
+ resource "google_firebase_hosting_version" "default" {
104
+ provider = google-beta
105
+ site_id = google_firebase_hosting_site.default.site_id
106
+ config {
107
+ headers {
108
+ # Also okay to use glob
109
+ regex = "^~/headers$"
110
+ headers = {
111
+ my-header = "my-value"
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ resource "google_firebase_hosting_release" "default" {
118
+ provider = google-beta
119
+ site_id = google_firebase_hosting_site.default.site_id
120
+ version_name = google_firebase_hosting_version.default.name
121
+ message = "With custom headers"
122
+ }
123
+ ```
62
124
## Example Usage - Firebasehosting Version Path
63
125
64
126
@@ -228,6 +290,12 @@ The following arguments are supported:
228
290
triggers Hosting to respond with a redirect to the specified destination path.
229
291
Structure is [ documented below] ( #nested_redirects ) .
230
292
293
+ * ` headers ` -
294
+ (Optional)
295
+ An array of objects, where each object specifies a URL pattern that, if matched to the request URL path,
296
+ triggers Hosting to apply the specified custom response headers.
297
+ Structure is [ documented below] ( #nested_headers ) .
298
+
231
299
232
300
<a name =" nested_rewrites " ></a >The ` rewrites ` block supports:
233
301
@@ -290,6 +358,20 @@ The following arguments are supported:
290
358
}
291
359
```
292
360
361
+ <a name =" nested_headers " ></a >The ` headers ` block supports:
362
+
363
+ * ` glob ` -
364
+ (Optional)
365
+ The user-supplied glob to match against the request URL path.
366
+
367
+ * ` regex ` -
368
+ (Optional)
369
+ The user-supplied RE2 regular expression to match against the request URL path.
370
+
371
+ * ` headers ` -
372
+ (Required)
373
+ The additional headers to add to the response. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
374
+
293
375
## Attributes Reference
294
376
295
377
In addition to the arguments listed above, the following computed attributes are exported:
0 commit comments