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

Add upgrade guide for forwarding rule validation #2666

Merged
merged 2 commits into from
Nov 13, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ so Terraform knows to manage them.
- [Resource: `google_cloudiot_registry`](#resource-google_cloudiot_registry)
- [Resource: `google_composer_environment`](#resource-google_composer_environment)
- [Resource: `google_compute_forwarding_rule`](#resource-google_compute_forwarding_rule)
- [Resource: `google_compute_global_forwarding_rule`](#resource-google_global_compute_forwarding_rule)
- [Resource: `google_compute_instance`](#resource-google_compute_instance)
- [Resource: `google_compute_instance_template`](#resource-google_compute_instance_template)
- [Resource: `google_compute_network`](#resource-google_compute_network)
Expand Down Expand Up @@ -391,6 +392,55 @@ in config files, `enable_private_endpoint` is now required on the `google_compos

`ip_version` is not used for regional forwarding rules.

### `ip_address` is now strictly validated to enforce literal IP address format

Previously documentation suggested Terraform could use the same range of valid
IP Address formats for `ip_address` as accepted by the API (e.g. named addresses
or URLs to GCP Address resources). However, the server returns only literal IP
addresses and thus caused diffs on re-apply (i.e. a permadiff). We amended
documenation to say Terraform only accepts literal IP addresses.

This is now strictly validated. While this shouldn't have a large breaking
impact as users would have already run into permadiff issues on re-apply,
there might be validation errors for existing configs. The solution is be to
replace other address formats with the IP address, either manually or by
interpolating values from a `google_compute_address` resource.

#### Old Config (that would have permadiff)

```hcl
resource "google_compute_address" "my-addr" {
name = "my-addr"
}

resource "google_compute_forwarding_rule" "frule" {
name = "my-forwarding-rule"

address = google_compute_address.my-addr.self_link
}
```

#### New Config

```hcl
resource "google_compute_address" "my-addr" {
name = "my-addr"
}

resource "google_compute_forwarding_rule" "frule" {
name = "my-forwarding-rule"

address = google_compute_address.my-addr.address
}
```

## Resource: `google_compute_global_forwarding_rule`

### `ip_address` is now validated to enforce literal IP address format

See [`google_compute_forwarding_rule`][#resource-google_compute_forwarding_rule].


## Resource: `google_compute_instance`

### `interface` is now required on block `google_compute_instance.scratch_disk`
Expand Down