Skip to content

Commit

Permalink
Upgrade guide: Add guidance for removing empty strings from `provider…
Browse files Browse the repository at this point in the history
…` blocks (#9048)

* Add guidance for removing empty strings from `provider` blocks

* Update code block to use tf formatting, instead of diff
  • Loading branch information
SarahFrench authored Sep 22, 2023
1 parent 91afc18 commit 1e00951
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ The new annotations model is similar to the new labels model and will be applied

There are now two annotation-related fields with the new model, the `annotations` and the output-only `effective_annotations` fields.

### Updates to how empty strings are handled in the `provider` block

In 5.0.0+ any empty strings set in the `provider` block will be used and not ignored. Previously any empty strings used as arguments in the `provider` block were ignored and did not contribute to configuration of the provider.

Users should remove empty string arguments to avoid errors during plan/apply stages.

```tf
provider "google" {
credentials = "" # this line should be removed
project = "my-project"
region = "us-central1"
zone = "" # this line should be removed
}
```

### Changes to how default `location`, `region` and `zone` values are obtained for resources

Currently, when configuring resources that require a `location`, `region` or `zone` field you have the choice of specifying it in the resource block or allowing default values to be used. Default [region](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#region) or [zone](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#zone) values can be configured in the provider block or by providing values through environment variables.
Expand Down

0 comments on commit 1e00951

Please sign in to comment.