terraform-google-modules/terraform-google-bigquery

Incorrect terraform version constraint

kamalmarhubi opened this issue · 1 comments

TL;DR

The module lists its terraform version constraint as >= 0.13, however it doesn't work on versions earlier than 1.3.0 because it assumes that optional object attributes are available.

Expected behavior

Using any version of terraform >= 0.13, I should be able to run terraform init successfully when using this module.

Observed behavior

$ TFENV_TERRAFORM_VERSION=1.2.9 terraform init
Initializing modules...
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Optional object type attributes are experimental
│ 
│   on .terraform/modules/bigquery/variables.tf line 97:
│   97: variable "tables" {
│ 
│ This feature is currently an opt-in experiment, subject to change in future releases based on feedback.
│ 
│ Activate the feature for this module by adding module_variable_optional_attrs to the list of active experiments.
╵

╷
│ Error: Optional object type attributes are experimental
│ 
│   on .terraform/modules/bigquery/variables.tf line 125:
│  125: variable "views" {
│ 
│ This feature is currently an opt-in experiment, subject to change in future releases based on feedback.
│ 
│ Activate the feature for this module by adding module_variable_optional_attrs to the list of active experiments.
╵

╷
│ Error: Optional object type attributes are experimental
│ 
│   on .terraform/modules/bigquery/variables.tf line 137:
│  137: variable "materialized_views" {
│ 
│ This feature is currently an opt-in experiment, subject to change in future releases based on feedback.
│ 
│ Activate the feature for this module by adding module_variable_optional_attrs to the list of active experiments.
╵

╷
│ Error: Optional object type attributes are experimental
│ 
│   on .terraform/modules/bigquery/variables.tf line 166:
│  166: variable "external_tables" {
│ 
│ This feature is currently an opt-in experiment, subject to change in future releases based on feedback.
│ 
│ Activate the feature for this module by adding module_variable_optional_attrs to the list of active experiments.
╵

Terraform Configuration

$ ls
main.tf
$ cat main.tf
module "bigquery" {
  source  = "terraform-google-modules/bigquery/google"
  version = "~> 7.0"

  dataset_id                  = "foo"
  dataset_name                = "foo"
  description                 = "some description"
  project_id                  = "<PROJECT ID>"
  location                    = "US"
  default_table_expiration_ms = 3600000
}


### Terraform Version

```sh
This happens with any version prior to 1.3.0. Here's the output on 1.2.9:


$ TFENV_TERRAFORM_VERSION=1.2.9 terraform version
Terraform v1.2.9
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v5.4.0

Your version of Terraform is out of date! The latest version
is 1.6.3. You can update by downloading from https://www.terraform.io/downloads.html


### Additional information

_No response_

Fixed by #278