Terraform resource google_spanner_instance doesn't recognise "Edition" resource argument

Im trying to use “Edition” resource argument in latest release version >=6.0.1 for resource “google_spanner_instance”. When I try to add “edition” it fails to accept. the Terraform provider for Google Cloud does not support setting the [edition] attribute directly within the [google_spanner_instance] resource. Can someone help me on this ?

Maybe move this under the Google provider section and / or file a provider bug if you think there’s a provider bug?

What’s the version of the Terraform Google provider you’re using, and what error are you getting?

From the docs, it appears that the current version, at least, supports an enum for the edition attribute:
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/spanner_instance.html

Im using latest TF "required_version = “>= 1.5.7” and google = {
source = “hashicorp/google”
version = “>= 6.0.1”

when I try to add “edition = var.edition” under “resource “google_spanner_instance” and I get this error
" Unexpected attribute: An attribute named “edition” is not expected hereTerraform”

Error: Unsupported argument

│ in resource “google_spanner_instance” “common”:
│ edition = var.edition

│ An argument named “edition” is not expected here.

Based on the docs above, looks like this attribute was introduced in 6.4.0 (you could probably verify by looking at the changelog).

You can see the current provider version in the given directory / state by running terraform version - probably terraform init -upgrade would be sufficient if you’ve got it locked to an older version, but I’d suggest updating the required provider version as well, since, as you’ve seen, the version you’re using now doesn’t support it.

Not sure why “>= 6.x.x” is not pointing to latest version, So I hardcoded latest version as “6.6.0” and I could see “edition” attribute is working fine. But still via VS code IDE it throws error. may be I will try updating the VS code version. Otherwise, “edition” is working fine.

If you’re using a lockfile , >= 6.x.x will stay with the latest version already installed unless you either set a higher constraint or run terraform init -upgrade, so my guess is that you had an older version locked.

Not sure about having the IDE hints work properly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.