Skip to content

Commit 226926f

Browse files
Deprecate google_firebase_project_location (#8301) (#15526)
* Add deprecation message to google_firebase_project_location * Address review feedback on new resources * add ruby type to docs --------- Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
1 parent fbc4b0c commit 226926f

File tree

3 files changed

+71
-6
lines changed

3 files changed

+71
-6
lines changed

.changelog/8301.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note: deprecation
2+
firebase: deprecated `google_firebase_project_location` in favor of `google_firebase_storage_bucket` and `google_firestore_database`
3+
```

website/docs/guides/version_5_upgrade.html.markdown

+65-6
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,6 @@ resource "google_firebaserules_ruleset" "firestore" {
178178
}
179179
```
180180

181-
## Resource: `google_firebase_web_app`
182-
183-
### `deletion_policy` now defaults to `DELETE`
184-
185-
Previously, `google_firebase_web_app` deletions default to `ABANDON`, which means to only stop tracking the WebApp in Terraform. The actual app is not deleted from the Firebase project. If you are relying on this behavior, set `deletion_policy` to `ABANDON` explicitly in the new version.
186-
187181
## Resource: `google_cloud_run_v2_job`
188182

189183
### `startup_probe` and `liveness_probe` are now removed
@@ -205,6 +199,71 @@ it will use the default value from the API which is `FALSE`. If you want to
205199
enable endpoint independent mapping, then explicity set the value of
206200
`enable_endpoint_independent_mapping` field to `TRUE`.
207201

202+
203+
## Resource: `google_firebase_project_location`
204+
205+
### `google_firebase_project_location` is now removed
206+
207+
In `4.X`, `google_firebase_project_location` would implicitly trigger creation of an App Engine application with a default Cloud Storage bucket and Firestore database, located in the specified `location_id`. In `5.0.0`, these resources should instead be set up explicitly using `google_app_engine_application` `google_firebase_storage_bucket`, and `google_firestore_database`.
208+
209+
For more information on configuring Firebase resources with Terraform, see [Get started with Terraform and Firebase](https://firebase.google.com/docs/projects/terraform/get-started).
210+
211+
#### Upgrade instructions
212+
213+
If you have existing resources created using `google_firebase_project_location`:
214+
1. Remove the `google_firebase_project_location` block
215+
1. Add blocks according to "New config" in this section for any of the following that you need: `google_app_engine_application`, `google_firebase_storage_bucket`, and/or `google_firestore_database`.
216+
1. Import the existing resources corresponding to the blocks added in the previous step:
217+
`terraform import google_app_engine_application.default <project-id>`
218+
`terraform import google_firebase_storage_bucket.default-bucket <project-id>/<project-id>.appspot.com`
219+
`terraform import google_firestore_database.default "<project-id>/(default)"`
220+
221+
#### Old config
222+
223+
```hcl
224+
resource "google_firebase_project_location" "basic" {
225+
provider = google-beta
226+
project = google_firebase_project.default.project
227+
228+
location_id = "us-central"
229+
}
230+
```
231+
232+
#### New config
233+
234+
Assuming you use both the default Storage bucket and Firestore, an equivalent configuration would be:
235+
236+
```hcl
237+
resource "google_app_engine_application" "default" {
238+
provider = google-beta
239+
project = google_firebase_project.default.project
240+
location_id = "us-central"
241+
database_type = "CLOUD_FIRESTORE"
242+
243+
depends_on = [
244+
google_firestore_database.default
245+
]
246+
}
247+
248+
resource "google_firebase_storage_bucket" "default-bucket" {
249+
provider = google-beta
250+
project = google_firebase_project.default.project
251+
bucket_id = google_app_engine_application.default.default_bucket
252+
}
253+
254+
resource "google_firestore_database" "default" {
255+
project = google_firebase_project.default.project
256+
name = "(default)"
257+
location_id = "nam5"
258+
type = "FIRESTORE_NATIVE"
259+
}
260+
```
261+
262+
## Resource: `google_firebase_web_app`
263+
264+
### `deletion_policy` now defaults to `DELETE`
265+
266+
Previously, `google_firebase_web_app` deletions default to `ABANDON`, which means to only stop tracking the WebApp in Terraform. The actual app is not deleted from the Firebase project. If you are relying on this behavior, set `deletion_policy` to `ABANDON` explicitly in the new version.
208267
## Resource: `google_compute_autoscaler` (beta)
209268

210269
### `metric.filter` now defaults to `resource.type = gce_instance`

website/docs/r/firebase_project_location.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ To get more information about ProjectLocation, see:
3737
* How-to Guides
3838
* [Official Documentation](https://firebase.google.com/)
3939

40+
~> **Warning:** google_firebase_project_location is deprecated in favor of explicitly configuring `google_app_engine_application`
41+
and `google_firestore_database`. This resource will be removed in the next major release of the provider.
42+
4043
## Example Usage - Firebase Project Location Basic
4144

4245

0 commit comments

Comments
 (0)