Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Terraform Google Provider 8 vs Beta: Which to Use?

· 6 min read · Home Tech

In this article
  1. Background: Why There Are Two Providers
  2. How the Two Providers Work Together
  3. uses google provider (GA)
  4. some beta-only field
  5. When to Use the Google Provider (GA)
  6. When to Use the Beta Provider
  7. How to Choose for a New Project
  8. Common Problems and Misconceptions
  9. Cost and Performance Considerations
  10. Alternatives and Best Practices
  11. Frequently Asked Questions

For most Terraform work with Google Cloud, you should use the google provider (version 8.x) for stable, production-ready resources; use the google-beta provider only when you need a feature that is still in beta and not yet available in the main provider. The two providers are separate plugins, but they share most of the same codebase and are designed to be used together in the same configuration.

Background: Why There Are Two Providers

Google Cloud releases new features and API capabilities continuously. Some are marked as “beta” because their APIs or behavior may change before general availability (GA). The Terraform Google providers mirror this distinction:

  • google – exposes only GA (generally available) features and resources.
  • google-beta – includes everything in google plus resources and fields that are still in beta.

Both providers are maintained by HashiCorp and Google, and they are released in lockstep (same version numbers). The “8” in the question refers to the major version line (e.g., 8.x.x) that both providers share.

How the Two Providers Work Together

In a Terraform configuration, you declare both providers and then explicitly tell Terraform which provider to use for each resource. A common pattern looks like this:

terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 8.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "~> 8.0"
    }
  }
}

provider "google" {
  project = "my-project"
  region  = "us-central1"
}

provider "google-beta" {
  project = "my-project"
  region  = "us-central1"
}

resource "google_compute_instance" "default" {

uses google provider (GA)

name = "vm" machine_type = "e2-medium" zone = "us-central1-a" } resource "google_compute_instance" "beta_instance" { provider = google-beta name = "vm-beta" machine_type = "e2-medium" zone = "us-central1-a"

some beta-only field

}

You can mix both in the same configuration. The provider argument on a resource selects which one to use. If you omit it, the default is google.

When to Use the Google Provider (GA)

Use the standard google provider for everything that is generally available. This is the safe default because:

  • Stability – GA features have a stable API and are unlikely to change in breaking ways.
  • Support – Google Cloud’s official support applies to GA features; beta features are often excluded from SLAs.
  • Predictability – Terraform plans and applies behave as expected; beta features can have bugs or sudden changes.

If you are building infrastructure for production, start with the google provider. Only reach for google-beta when you have a specific, documented need.

When to Use the Beta Provider

You should use google-beta when you need a resource or field that is only available in beta. Common examples include:

  • New resource types that haven’t reached GA (e.g., some google_cloud_run_v2 services initially).
  • New arguments on existing resources (e.g., a new setting on google_compute_instance).
  • Features that require a beta API version (e.g., certain AI/ML services).

You can check the provider documentation: each resource page shows whether it is GA or beta. If a resource is marked “beta” (or has beta-only arguments), you must use google-beta for that resource.

How to Choose for a New Project

Here is a practical decision process:

  1. List the GCP resources you need.
  2. Look up each resource in the Terraform registry – check if it is GA or beta.
  3. If all are GA, use only google.
  4. If any resource is beta, include google-beta and assign that resource to it.
  5. For mixed configurations, keep GA resources on google and beta resources on google-beta – this minimizes risk.
  6. If you are unsure whether a beta feature will change, avoid it for production; test in a non-production environment.

Remember: you can always migrate a resource from beta to GA later by changing the provider and removing beta-only fields (if they became GA).

Common Problems and Misconceptions

Misconception: “Beta provider is newer or better.” No – it is simply a superset. It includes the same GA code plus beta additions. Using it for everything is not recommended because you may accidentally use beta features without realizing it.

Problem: “I get errors about unknown fields.” If you specify a field that only exists in beta but your resource uses the google provider, Terraform will complain. The fix is to switch that resource to google-beta.

Problem: “My plan says the resource will be destroyed/recreated unexpectedly.” This can happen if a beta field changes its default or if you switch a resource from beta to GA. Always review the plan carefully.

Problem: “I have both providers, but Terraform says the resource doesn’t exist.” Ensure you have declared both providers in required_providers and that you have set the provider argument on the resource. Also, check that you are using the same version for both – mixing major versions (e.g., google 8 and google-beta 7) is not supported.

Cost and Performance Considerations

There is no direct cost difference between the two providers – they are both free and open-source. The cost implications come from the GCP resources you create, not the provider choice. However, using beta features can indirectly cost more if they are not optimized or if you need to rework infrastructure when the feature changes. Performance-wise, both providers have similar overhead; the main difference is that beta resources may have less mature code, which could occasionally lead to longer planning times or unexpected errors.

Alternatives and Best Practices

If you need a feature that is not yet in either provider, consider:

  • Using the REST API directly via google_project_service or a null_resource with a script – not recommended for long-term management.
  • Using a module that wraps the beta provider – many community modules already handle the provider selection.
  • Waiting for GA – if the feature is close to release, it may be better to wait than to adopt beta.

Best practices that apply to both providers:

  • Pin your provider versions (e.g., ~> 8.0) to avoid unexpected upgrades.
  • Use separate workspaces or environments for testing beta features.
  • Read the upgrade guides when moving between major versions – they often list breaking changes.
  • Always run terraform plan and review the diff before applying, especially when beta resources are involved.

Frequently Asked Questions

Can I use google and google-beta in the same configuration? Yes, absolutely. Declare both providers and use the provider argument on each resource to choose which one to use. This is the recommended approach for mixed GA/beta environments.

Is google-beta a separate binary or a different version of the same provider? It is a separate plugin with its own source (hashicorp/google-beta), but it is built from the same codebase and released with the same version numbers as hashicorp/google. They are not interchangeable – you cannot use google-beta as a drop-in replacement for google without changing resource definitions.

What happens when a beta feature becomes GA? The resource or field moves into the google provider. You can then update your configuration to use google instead of google-beta. Usually there is no breaking change, but you should test the plan. The provider documentation will mark the transition.

Does using google-beta affect my GCP SLA or support? Yes, indirectly. Beta GCP features are not covered by the same SLA as GA features. If you rely on a beta resource for production, you risk downtime without compensation. Always check GCP’s terms for beta services.

Why do I see “beta” fields in the google provider documentation? Some resource pages list beta-only arguments, but they are only usable with google-beta. The documentation marks them clearly (often with a “Beta” badge). If you try to use them with google, Terraform will error.

Should I pin both providers to the same version? Yes. It is best practice to keep google and google-beta at the same version to avoid compatibility issues. The providers are designed to work together, but using mismatched versions can cause subtle bugs.