Skip to content
Sarah French edited this page Mar 12, 2024 · 20 revisions

Frequently Asked Questions

Does the provider have support for ____?

Resources in the provider tend to match up with the resource name in the REST API for a product. The Provider Documentation lists all resources available in the most recent version of the provider.

Note that not all GCP functionality makes sense to be added to Terraform. For something to make sense, it must:

  • have an associated REST API: To add it to the google or google-beta provider, that API must be publicly-accessible.
  • be able to be represented declaratively and idempotently: Long-lived infrastructure is a good fit for Terraform. Short-lived jobs are not, as it's not clear what the intent is if applied multiple times.

I've made a change to the providers. When will the feature be released?

Google provider releases are made every week on Monday close to EOD in Pacific time, unless there are extenuating circumstances.

You can monitor the release pages for the appropriate provider (google (GA) or google-beta) to determine if a weekly release cut is made, or a specific feature is included. We do not provide tracking bugs as part of our release process, nor tracking for individual features' release.

We cut our release branch on Tuesday nights, and release the following Monday. This means that any code change that is merged on a Monday or Tuesday will be released the following Monday, and any change that is merged W-F will be released the Monday after.

I've added the beta provider in my config. Why does it still use the GA provider?

If you want to use beta provider, provider = google-beta should be set explicitly on every resource, even if you’ve only defined a google-beta provider block or you've already added the beta provider in the required_providers block.

Please refer to Google Provider Versions for more detailed information.

What is the difference between id and project_id in the google_project resource?
Which one should I use?

id is an identifier for the project with the format projects/{{project}}, while project_id is the real project ID with the format {{project}}.

project_id should be used as the project argument in your configuration, as all resources should be able to accept the {{project}} format for the project field.

How do I update the Go version used by the Terraform providers `google` and `google-beta`?

Currently the process to update the Go version can be achieved in 3 PRs.

1) Update terraform-google-conversion The first, smallest PR to prepare is updating go.mod and go.sum in terraform-google-conversion:

  • Create a new branch in GoogleCloudPlatform/terraform-google-conversion or your fork
  • Edit the go.mod file to include the new Go version
  • Run go mod tidy to update the go.sum file, given the new Go version
  • Commit those changes using conventional commits, e.g. chore: update to Go 1.21.

Don't merge this PR yet, see the section on merge order below.

This PR is necessary because the go.mod and go.sum files of TGC aren't controlled by magic-modules. See this issue for details: https://github.com/hashicorp/terraform-provider-google/issues/17480

2) Update magic-modules: Dockerfiles

The second and third PRs are in GoogleCloudPlatform/magic-modules.

The second PR will update the Dockerfiles used in CI. You will need to perform updates like this:

  • Create a new branch in GoogleCloudPlatform/magic-modules
  • Edit .ci/containers/build-environment/Dockerfile to reference the new Go version
  • Edit .ci/containers/go-plus/Dockerfile to reference the new Go version
  • Commit those changes, and open a PR containing only changes to the Dockerfiles.

Don't merge this PR yet, see the section on merge order below.

Example diffs expected in this step from this past example:

-FROM golang:1.20-bullseye AS builder
+FROM golang:1.21-bullseye AS builder

3) Update magic-modules: Everything that uses the container images

The third PR will update the code that uses the containers made from the Dockerfiles above:

  • Create a new branch in GoogleCloudPlatform/magic-modules
  • Update the go.mo, go.sum, and .go-version files in the TPG and TPGB downstream repos
    • Update go.mod in your local clone of hashicorp/terraform-provider-google to contain the new Go version
    • Run go mod tidy in the project root to update go.sum
    • Copy the contents of the updated go.mod file into mmv1/third_party/terraform/go.mod.erb in magic-modules. Ensure <% autogen_exception -%> is still at the top of the file afterwards.
    • Copy the contents of the updated go.sum file into mmv1/third_party/terraform/go.sum in magic-modules.
    • Edit mmv1/third_party/terraform/.go-version to contain the new Go version. Note: this file impacts the release process and also controls the Go version used in TeamCity to test the provider.
  • Update the GitHub Action workflows and other CI files in GoogleCloudPlatform/magic-modules used to test and build the providers
  • Update other tools that run in CI and in PR checks that need to be kept in sync with the Go version used by the provider
  • After completing the above, perform some cautionary global searches in the codebase for the old Go version string.
  • Commit all your changes from the above steps, and open a PR

Don't merge this PR yet, see the section on merge order below.

Merge order

TBC following update to Go 1.21.

Merge order is:

  1. Merge the PR updating Dockerfiles
    • Merging this to main will result in a new version of the images being published
  2. Merge the PR updating everything else in magic-modules
  3. Merge the update to TGC
Clone this wiki locally