Closed GomathiMarisamy closed 1 year 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!
/**
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" {
}
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.
Finishing: Terraform Validate
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.
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" }
b/259266323
Closing as stale
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.
An argument named "database_dialect" is not expected here.
Affected Resource(s)