diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go index 4e584b9ed313..f72162a93267 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go @@ -2355,6 +2355,11 @@ func expandPrimaryKey(configured interface{}) *bigquery.TableConstraintsPrimaryK columns := []string{} for _, rawColumn := range raw["columns"].([]interface{}) { + if rawColumn == nil { + // Terraform reads "" as nil, which ends up crashing when we cast below + // sending "" to the API triggers a 400, which is okay. + rawColumn = "" + } columns = append(columns, rawColumn.(string)) } if len(columns) > 0 {