|
| 1 | +--- |
| 2 | +# ---------------------------------------------------------------------------- |
| 3 | +# |
| 4 | +# *** AUTO GENERATED CODE *** Type: Handwritten *** |
| 5 | +# |
| 6 | +# ---------------------------------------------------------------------------- |
| 7 | +# |
| 8 | +# This code is generated by Magic Modules using the following: |
| 9 | +# |
| 10 | +# Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/guides/version_7_upgrade.html.markdown |
| 11 | +# |
| 12 | +# DO NOT EDIT this file directly. Any changes made to this file will be |
| 13 | +# overwritten during the next generation cycle. |
| 14 | +# |
| 15 | +# ---------------------------------------------------------------------------- |
| 16 | +page_title: "Terraform provider for Google Cloud 7.0.0 Upgrade Guide" |
| 17 | +description: |- |
| 18 | + Terraform provider for Google Cloud 7.0.0 Upgrade Guide |
| 19 | +--- |
| 20 | + |
| 21 | +# Terraform Google Provider 7.0.0 Upgrade Guide |
| 22 | + |
| 23 | +The `7.0.0` release of the Google provider for Terraform is a major version and |
| 24 | +includes some changes that you will need to consider when upgrading. This guide |
| 25 | +is intended to help with that process and focuses only on the changes necessary |
| 26 | +to upgrade from the final `6.X` series release to `7.0.0`. |
| 27 | + |
| 28 | +Most of the changes outlined in this guide have been previously marked as |
| 29 | +deprecated in the Terraform `plan`/`apply` output throughout previous provider |
| 30 | +releases, up to and including the final `6.X` series release. These changes, |
| 31 | +such as deprecation notices, can always be found in the CHANGELOG of the |
| 32 | +affected providers. [google](https://github.com/hashicorp/terraform-provider-google/blob/main/CHANGELOG.md) |
| 33 | +[google-beta](https://github.com/hashicorp/terraform-provider-google-beta/blob/main/CHANGELOG.md) |
| 34 | + |
| 35 | +## I accidentally upgraded to 7.0.0, how do I downgrade to `6.X`? |
| 36 | + |
| 37 | +If you've inadvertently upgraded to `7.0.0`, first see the |
| 38 | +[Provider Version Configuration Guide](#provider-version-configuration) to lock |
| 39 | +your provider version; if you've constrained the provider to a lower version |
| 40 | +such as shown in the previous version example in that guide, Terraform will pull |
| 41 | +in a `6.X` series release on `terraform init`. |
| 42 | + |
| 43 | +If you've only ran `terraform init` or `terraform plan`, your state will not |
| 44 | +have been modified and downgrading your provider is sufficient. |
| 45 | + |
| 46 | +If you've ran `terraform refresh` or `terraform apply`, Terraform may have made |
| 47 | +state changes in the meantime. |
| 48 | + |
| 49 | +* If you're using a local state, or a remote state backend that does not support |
| 50 | +versioning, `terraform refresh` with a downgraded provider is likely sufficient |
| 51 | +to revert your state. The Google provider generally refreshes most state |
| 52 | +information from the API, and the properties necessary to do so have been left |
| 53 | +unchanged. |
| 54 | + |
| 55 | +* If you're using a remote state backend that supports versioning such as |
| 56 | +[Google Cloud Storage](https://developer.hashicorp.com/terraform/language/settings/backends/gcs), |
| 57 | +you can revert the Terraform state file to a previous version. If you do |
| 58 | +so and Terraform had created resources as part of a `terraform apply` in the |
| 59 | +meantime, you'll need to either delete them by hand or `terraform import` them |
| 60 | +so Terraform knows to manage them. |
| 61 | + |
| 62 | +## Provider Version Configuration |
| 63 | + |
| 64 | +-> Before upgrading to version 7.0.0, it is recommended to upgrade to the most |
| 65 | +recent `6.X` series release of the provider, make the changes noted in this guide, |
| 66 | +and ensure that your environment successfully runs |
| 67 | +[`terraform plan`](https://developer.hashicorp.com/terraform/cli/commands/plan) |
| 68 | +without unexpected changes or deprecation notices. |
| 69 | + |
| 70 | +It is recommended to use [version constraints](https://developer.hashicorp.com/terraform/language/providers/requirements#requiring-providers) |
| 71 | +when configuring Terraform providers. If you are following that recommendation, |
| 72 | +update the version constraints in your Terraform configuration and run |
| 73 | +[`terraform init`](https://developer.hashicorp.com/terraform/cli/commands/init) to download |
| 74 | +the new version. |
| 75 | + |
| 76 | +If you aren't using version constraints, you can use `terraform init -upgrade` |
| 77 | +in order to upgrade your provider to the latest released version. |
| 78 | + |
| 79 | +For example, given this previous configuration: |
| 80 | + |
| 81 | +```hcl |
| 82 | +terraform { |
| 83 | + required_providers { |
| 84 | + google = { |
| 85 | + version = "~> 6.48.0" |
| 86 | + } |
| 87 | + } |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +An updated configuration: |
| 92 | + |
| 93 | +```hcl |
| 94 | +terraform { |
| 95 | + required_providers { |
| 96 | + google = { |
| 97 | + version = "~> 7.0.0" |
| 98 | + } |
| 99 | + } |
| 100 | +} |
| 101 | +``` |
| 102 | + |
| 103 | +## Resources |
| 104 | + |
| 105 | +## Resource: `google_artifact_registry_repository` |
| 106 | + |
| 107 | +### `public_repository` fields have had their default values removed. |
| 108 | + |
| 109 | +`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. |
| 110 | + |
| 111 | +## Resource: `google_bigtable_table_iam_binding` |
| 112 | + |
| 113 | +### `instance` is now removed |
| 114 | + |
| 115 | +`instance` has been removed in favor of `instance_name`. |
| 116 | + |
| 117 | +## Resource: `google_bigtable_table_iam_member` |
| 118 | + |
| 119 | +### `instance` is now removed |
| 120 | + |
| 121 | +`instance` has been removed in favor of `instance_name`. |
| 122 | + |
| 123 | +## Resource: `google_bigtable_table_iam_policy` |
| 124 | + |
| 125 | +### `instance` is now removed |
| 126 | + |
| 127 | +`instance` has been removed in favor of `instance_name`. |
| 128 | + |
| 129 | +## Resource: `google_compute_subnetwork` |
| 130 | + |
| 131 | +### `enable_flow_logs`is now removed |
| 132 | + |
| 133 | +`enable_flow_logs` has been removed in favor of `log_config`. |
| 134 | + |
| 135 | +## Resource: `google_notebooks_location` is now removed |
| 136 | + |
| 137 | +This resource is not functional. |
| 138 | + |
| 139 | +## Resource: `google_storage_bucket` |
| 140 | + |
| 141 | +### `retention_period` changed to `string` data type |
| 142 | + |
| 143 | +`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. |
| 144 | + |
| 145 | +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. |
| 146 | + |
| 147 | +To reflect the new type explicitly, surround the current integer value in quotes, i.e. `retention_period = 10` -> `retention_period = "10"`. |
| 148 | + |
| 149 | +## Resource: `google_gke_hub_membership` |
| 150 | + |
| 151 | +### `description` is now removed |
| 152 | + |
| 153 | +Remove `description` from your configuration after upgrade. |
| 154 | + |
| 155 | +## Resource: `google_network_services_lb_traffic_extension` |
| 156 | + |
| 157 | +### `load_balancing_scheme` is now required |
| 158 | + |
| 159 | +`load_balancing_scheme` is now a required field. |
| 160 | + |
| 161 | +## Resource: `google_storage_transfer_job` |
| 162 | + |
| 163 | +### `transfer_spec.gcs_data_sink.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings." |
| 164 | + |
| 165 | +### `transfer_spec.gcs_data_source.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings." |
| 166 | + |
| 167 | +### `replication_spec.gcs_data_source.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings." |
| 168 | + |
| 169 | +### `replication_spec.gcs_data_sink.path` Implemented validation to prevent strings from starting with a '/' character, while still permitting empty strings." |
| 170 | + |
| 171 | +## Resource: `google_cloudfunctions2_function` |
| 172 | + |
| 173 | +### `event_trigger.event_type` is now required |
| 174 | + |
| 175 | +The `event_type` field is now required when `event_trigger` is configured. |
| 176 | + |
| 177 | +### `service_config.service` is changed from `Argument` to `Attribute` |
| 178 | + |
| 179 | +Remove `service_config.service` from your configuration after upgrade. |
| 180 | + |
| 181 | +## Resource: `google_cloud_run_v2_worker_pool` |
| 182 | + |
| 183 | +### `template.containers.depends_on` is removed as it is not supported. |
| 184 | + |
| 185 | +Remove `template.containers.depends_on` from your configuration after upgrade. |
| 186 | + |
| 187 | +## Resource: `google_vertex_ai_endpoint` |
| 188 | + |
| 189 | +### `enable_secure_private_service_connect` is removed as it is not available in the GA version of the API, only in the beta version. |
| 190 | + |
| 191 | +## Resource: `google_vertex_ai_index` |
| 192 | + |
| 193 | +### `metadata`, and `metadata.config` are now required. Resource creation would fail without these attributes already, so no change is necessary to existing configurations. |
| 194 | + |
| 195 | +## Resource: `google_tpu_node` is now removed |
| 196 | + |
| 197 | +`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. |
| 198 | + |
| 199 | +## Resource: `google_project_service` |
| 200 | + |
| 201 | +### `disable_on_destroy` now defaults to `false` |
| 202 | + |
| 203 | +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. |
| 204 | + |
| 205 | +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`. |
0 commit comments