Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_bigquery_table : optional field range is required #5645

Closed
ndechandon opened this issue Feb 11, 2020 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#3457, #6280 or hashicorp/terraform-provider-google-beta#2030
Assignees
Labels

Comments

@ndechandon
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

terraform:0.12.7

provider "google" {
  region  = "europe-west1"
  version = "3.7.0"
}

Affected Resource(s)

  • google_bigquery_table

Terraform Configuration Files

resource "google_bigquery_table" "table" {
  dataset_id = google_bigquery_dataset.xxx.dataset_id
  table_id = "sheet"
  project = var.project
  schema = file("${path.module}/schemas/sheet.json")

  external_data_configuration {
    autodetect = true
    source_format = "GOOGLE_SHEETS"
    ignore_unknown_values = true

    google_sheets_options {
      skip_leading_rows = 1
    }

    source_uris = [
      "https://drive.google.com/open?id=xxxx",
    ]
  }
}

Debug Output

Panic Output

Error: "external_data_configuration.0.google_sheets_options.0.range": one of 
`external_data_configuration.0.google_sheets_options.0.range` must be specified

on folder/file.tf line 1, in resource "google_bigquery_table" "sheet":
   1: resource "google_bigquery_table" "sheet" {

Expected Behavior

Range field should not be required in the config.

Actual Behavior

Range is required

Important Factoids

I think this PR GoogleCloudPlatform/magic-modules#2608 brought an incorrect input control.

Because the AtLeastOneOf condition is expecting only one field for Range and skip_leading_rows:

https://github.com/hashicorp/magic-modules/blob/master/third_party/terraform/resources/resource_bigquery_table.go.erb#L166-L177

@ghost ghost added the bug label Feb 11, 2020
@edwardmedia edwardmedia self-assigned this Feb 11, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Feb 11, 2020

@chrisst below error occurs on the resource example as well when I call tf plan https://www.terraform.io/docs/providers/google/r/bigquery_table.html

Error: "external_data_configuration.0.google_sheets_options.0.range": one of `external_data_configuration.0.google_sheets_options.0.range` must be specified

  on main.tf line 44, in resource "google_bigquery_table" "sheet":
  44: resource "google_bigquery_table" "sheet" {

@ghost
Copy link

ghost commented Jun 4, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.