Skip to content
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
205 changes: 205 additions & 0 deletions website/docs/guides/version_7_upgrade.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: Handwritten ***
#
# ----------------------------------------------------------------------------
#
# This code is generated by Magic Modules using the following:
#
# Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/guides/version_7_upgrade.html.markdown
#
# DO NOT EDIT this file directly. Any changes made to this file will be
# overwritten during the next generation cycle.
#
# ----------------------------------------------------------------------------
page_title: "Terraform provider for Google Cloud 7.0.0 Upgrade Guide"
description: |-
Terraform provider for Google Cloud 7.0.0 Upgrade Guide
---

# Terraform Google Provider 7.0.0 Upgrade Guide

The `7.0.0` release of the Google provider for Terraform is a major version and
includes some changes that you will need to consider when upgrading. This guide
is intended to help with that process and focuses only on the changes necessary
to upgrade from the final `6.X` series release to `7.0.0`.

Most of the changes outlined in this guide have been previously marked as
deprecated in the Terraform `plan`/`apply` output throughout previous provider
releases, up to and including the final `6.X` series release. These changes,
such as deprecation notices, can always be found in the CHANGELOG of the
affected providers. [google](https://github.com/hashicorp/terraform-provider-google/blob/main/CHANGELOG.md)
[google-beta](https://github.com/hashicorp/terraform-provider-google-beta/blob/main/CHANGELOG.md)

## I accidentally upgraded to 7.0.0, how do I downgrade to `6.X`?

If you've inadvertently upgraded to `7.0.0`, first see the
[Provider Version Configuration Guide](#provider-version-configuration) to lock
your provider version; if you've constrained the provider to a lower version
such as shown in the previous version example in that guide, Terraform will pull
in a `6.X` series release on `terraform init`.

If you've only ran `terraform init` or `terraform plan`, your state will not
have been modified and downgrading your provider is sufficient.

If you've ran `terraform refresh` or `terraform apply`, Terraform may have made
state changes in the meantime.

* If you're using a local state, or a remote state backend that does not support
versioning, `terraform refresh` with a downgraded provider is likely sufficient
to revert your state. The Google provider generally refreshes most state
information from the API, and the properties necessary to do so have been left
unchanged.

* If you're using a remote state backend that supports versioning such as
[Google Cloud Storage](https://developer.hashicorp.com/terraform/language/settings/backends/gcs),
you can revert the Terraform state file to a previous version. If you do
so and Terraform had created resources as part of a `terraform apply` in the
meantime, you'll need to either delete them by hand or `terraform import` them
so Terraform knows to manage them.

## Provider Version Configuration

-> Before upgrading to version 7.0.0, it is recommended to upgrade to the most
recent `6.X` series release of the provider, make the changes noted in this guide,
and ensure that your environment successfully runs
[`terraform plan`](https://developer.hashicorp.com/terraform/cli/commands/plan)
without unexpected changes or deprecation notices.

It is recommended to use [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#requiring-providers)
when configuring Terraform providers. If you are following that recommendation,
update the version constraints in your Terraform configuration and run
[`terraform init`](https://developer.hashicorp.com/terraform/cli/commands/init) to download
the new version.

If you aren't using version constraints, you can use `terraform init -upgrade`
in order to upgrade your provider to the latest released version.

For example, given this previous configuration:

```hcl
terraform {
required_providers {
google = {
version = "~> 6.48.0"
}
}
}
```

An updated configuration:

```hcl
terraform {
required_providers {
google = {
version = "~> 7.0.0"
}
}
}
```

## Resources

## Resource: `google_artifact_registry_repository`

### `public_repository` fields have had their default values removed.

`public_repository` fields have had their default values removed. If your state has been reliant on them, they will need to be manually included into your configuration now.

## Resource: `google_bigtable_table_iam_binding`

### `instance` is now removed

`instance` has been removed in favor of `instance_name`.

## Resource: `google_bigtable_table_iam_member`

### `instance` is now removed

`instance` has been removed in favor of `instance_name`.

## Resource: `google_bigtable_table_iam_policy`

### `instance` is now removed

`instance` has been removed in favor of `instance_name`.

## Resource: `google_compute_subnetwork`

### `enable_flow_logs`is now removed

`enable_flow_logs` has been removed in favor of `log_config`.

## Resource: `google_notebooks_location` is now removed

This resource is not functional.

## Resource: `google_storage_bucket`

### `retention_period` changed to `string` data type

`retention_period` was changed to the [`string` data type](https://developer.hashicorp.com/terraform/language/expressions/types#string) to handle higher values for the bucket's retention period.

Terraform [Type Conversion](https://developer.hashicorp.com/terraform/language/expressions/types#type-conversion) will handle the change automatically for most configurations, and they will not need to be modified.

To reflect the new type explicitly, surround the current integer value in quotes, i.e. `retention_period = 10` -> `retention_period = "10"`.

## Resource: `google_gke_hub_membership`

### `description` is now removed

Remove `description` from your configuration after upgrade.

## Resource: `google_network_services_lb_traffic_extension`

### `load_balancing_scheme` is now required

`load_balancing_scheme` is now a required field.

## Resource: `google_storage_transfer_job`

### `transfer_spec.gcs_data_sink.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings."

### `transfer_spec.gcs_data_source.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings."

### `replication_spec.gcs_data_source.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings."

### `replication_spec.gcs_data_sink.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings."

## Resource: `google_cloudfunctions2_function`

### `event_trigger.event_type` is now required

The `event_type` field is now required when `event_trigger` is configured.

### `service_config.service` is changed from `Argument` to `Attribute`

Remove `service_config.service` from your configuration after upgrade.

## Resource: `google_cloud_run_v2_worker_pool`

### `template.containers.depends_on` is removed as it is not supported.

Remove `template.containers.depends_on` from your configuration after upgrade.

## Resource: `google_vertex_ai_endpoint`

### `enable_secure_private_service_connect` is removed as it is not available in the GA version of the API, only in the beta version.

## Resource: `google_vertex_ai_index`

### `metadata`, and `metadata.config` are now required. Resource creation would fail without these attributes already, so no change is necessary to existing configurations.

## Resource: `google_tpu_node` is now removed

`google_tpu_node` is removed in favor of `google_tpu_v2_vm`. For moving from TPU Node to TPU VM architecture, see https://cloud.google.com/tpu/docs/system-architecture-tpu-vm#from-tpu-node-to-tpu-vm.

## Resource: `google_project_service`

### `disable_on_destroy` now defaults to `false`

The default value for `disable_on_destroy` has been changed to `false`. The previous default (`true`) created a risk of unintended service disruptions, as destroying a single `google_project_service` resource would disable the API for the entire project.

Now, destroying the resource will only remove it from Terraform's state and leave the service enabled. To disable a service when the resource is destroyed, you must now make an explicit decision by setting `disable_on_destroy = true`.
Loading