Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate google_firebase_project_location #6087

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Deprecate google_firebase_project_location (#8301)
* Add deprecation message to google_firebase_project_location

* Address review feedback on new resources

* add ruby type to docs

---------

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician and melinath committed Aug 16, 2023
commit f3147821de7b618c95e1837023055d77dfd827f0
3 changes: 3 additions & 0 deletions .changelog/8301.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note: deprecation
firebase: deprecated `google_firebase_project_location` in favor of `google_firebase_storage_bucket` and `google_firestore_database`
```
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func ResourceFirebaseProjectLocation() *schema.Resource {
Delete: schema.DefaultTimeout(20 * time.Minute),
},

DeprecationMessage: "Instead of using `google_firebase_project_location`, explicitly configure " +
"`google_app_engine_application.location_id` and `google_firestore_database.location_id`" +
"instead",

Schema: map[string]*schema.Schema{
"location_id": {
Type: schema.TypeString,
Expand Down
71 changes: 65 additions & 6 deletions website/docs/guides/version_5_upgrade.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ resource "google_firebaserules_ruleset" "firestore" {
}
```

## Resource: `google_firebase_web_app`

### `deletion_policy` now defaults to `DELETE`

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.

## Resource: `google_cloud_run_v2_job`

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


## Resource: `google_firebase_project_location`

### `google_firebase_project_location` is now removed

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`.

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).

#### Upgrade instructions

If you have existing resources created using `google_firebase_project_location`:
1. Remove the `google_firebase_project_location` block
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`.
1. Import the existing resources corresponding to the blocks added in the previous step:
`terraform import google_app_engine_application.default <project-id>`
`terraform import google_firebase_storage_bucket.default-bucket <project-id>/<project-id>.appspot.com`
`terraform import google_firestore_database.default "<project-id>/(default)"`

#### Old config

```hcl
resource "google_firebase_project_location" "basic" {
provider = google-beta
project = google_firebase_project.default.project

location_id = "us-central"
}
```

#### New config

Assuming you use both the default Storage bucket and Firestore, an equivalent configuration would be:

```hcl
resource "google_app_engine_application" "default" {
provider = google-beta
project = google_firebase_project.default.project
location_id = "us-central"
database_type = "CLOUD_FIRESTORE"

depends_on = [
google_firestore_database.default
]
}

resource "google_firebase_storage_bucket" "default-bucket" {
provider = google-beta
project = google_firebase_project.default.project
bucket_id = google_app_engine_application.default.default_bucket
}

resource "google_firestore_database" "default" {
project = google_firebase_project.default.project
name = "(default)"
location_id = "nam5"
type = "FIRESTORE_NATIVE"
}
```

## Resource: `google_firebase_web_app`

### `deletion_policy` now defaults to `DELETE`

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.
## Resource: `google_compute_autoscaler` (beta)

### `metric.filter` now defaults to `resource.type = gce_instance`
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/firebase_project_location.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ To get more information about ProjectLocation, see:
* How-to Guides
* [Official Documentation](https://firebase.google.com/)

~> **Warning:** google_firebase_project_location is deprecated in favor of explicitly configuring `google_app_engine_application`
and `google_firestore_database`. This resource will be removed in the next major release of the provider.

## Example Usage - Firebase Project Location Basic


Expand Down