hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.3k stars 1.73k forks source link

google_spanner_database - Giving error for database_dialect #11528

Closed GomathiMarisamy closed 1 year ago

GomathiMarisamy commented 2 years ago

An argument named "database_dialect" is not expected here.

Affected Resource(s)

shuyama1 commented 2 years ago

Hi @GomathiMarisamy! Thanks for filing the issue! Would you mind providing more information about this issue and also sharing your config and debug log, so that I can test and reproduce the error? Thanks a lot!

GomathiMarisamy commented 2 years ago

/**

resource "google_spanner_database" "database" { count = var.enabled ? 1 : 0

project = var.project_id name = var.database_name instance = var.instance_name ddl = var.ddl_statements deletion_protection = var.deletion_protection database_dialect = var.database_dialect timeouts { create = var.timeout delete = var.timeout update = var.timeout }

} terraform { required_providers { google-beta = { source = "hashicorp/google-beta" version = ">= 4.17.0" } } } provider "google-beta" {

configuration options

}

and terraform calling code is this

module "trex_cloud_spanner" { source = "*****/m-spanner/google" version = "1.0.1"
project_id = var.PROJECT_ID config = var.SPANNER_CONFIG display_name = var.SPANNER_DISPLAY_NAME name = var.SPANNER_NAME num_nodes = 1 labels = { classification = var.SPANNER_LABELS_CLASSIFICATION, data_owner = var.SPANNER_LABELS_DATA_OWNER } }

module "trex_spanner_database" { source = "*****/m-spanner-database/google"
providers = { google-beta = google-beta.spanner } version = "1.1.1-b20220420151158" project_id = var.PROJECT_ID database_name = var.SPANNER_CAMUNDA_DATABASE_NAME deletion_protection = var.SPANNER_DATABASE_DELETION_PROTECTION
database_dialect = var.SPANNER_DATABASE_DIALECT instance_name = module.trex_cloud_spanner.instance_name depends_on = [module.trex_cloud_spanner] }

Getting this error Error: Unsupported argument

on .terraform/modules/trex_spanner_database/main.tf line 25, in resource "google_spanner_database" "database": 25: database_dialect = var.database_dialect

An argument named "database_dialect" is not expected here.

[error]Error: The process '/azp/agent/_work/_tool/terraform/0.13.5/x64/terraform' failed with exit code 1

Finishing: Terraform Validate

shuyama1 commented 2 years ago

Thanks for sharing! Looks like you are using modules. Could you double check if those modules are up-to-date that contain the database_dialect field. Support for database_dialect was added in v4.17.0 of the provider. So the newly added feature could be easier not included in the outdated modules.

GomathiMarisamy commented 2 years ago

I have added my module code also in my previous comments. We are using google-beta version 4.17.0 in our module

google-beta = { source = "hashicorp/google-beta" version = ">= 4.17.0" }

melinath commented 1 year ago

b/259266323

rileykarson commented 1 year ago

Closing as stale

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.