diff --git a/.changelog/11284.txt b/.changelog/11284.txt new file mode 100644 index 00000000000..da2ba1267f8 --- /dev/null +++ b/.changelog/11284.txt @@ -0,0 +1,3 @@ +```release-note:bug +bigquery: fixed a permadiff when handling "assets" params in the `google_bigquery_data_transfer_config` resource +``` \ No newline at end of file diff --git a/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config.go b/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config.go index 6555d8db8ce..aa89ba21601 100644 --- a/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config.go +++ b/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config.go @@ -1008,6 +1008,19 @@ func resourceBigqueryDataTransferConfigDecoder(d *schema.ResourceData, meta inte } } } + for k, v := range params { + switch v.(type) { + case []interface{}, map[string]interface{}: + value, err := json.Marshal(v) + if err != nil { + return nil, err + } + params[k] = string(value) + default: + params[k] = v + } + } + res["params"] = params } return res, nil diff --git a/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config_test.go b/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config_test.go index 726df2bf85e..ccdf9bdf5b1 100644 --- a/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config_test.go +++ b/google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config_test.go @@ -856,7 +856,7 @@ resource "google_bigquery_data_transfer_config" "salesforce_config" { "connector.authentication.username" = "" "connector.authentication.password" = "" "connector.authentication.securityToken" = "" - "assets" = "[asset-a, asset-b]" + "assets" = "[\"asset-a\",\"asset-b\"]" } } `, randomSuffix, randomSuffix) diff --git a/website/docs/r/bigquery_data_transfer_config.html.markdown b/website/docs/r/bigquery_data_transfer_config.html.markdown index 5a245d818da..fa35a001136 100644 --- a/website/docs/r/bigquery_data_transfer_config.html.markdown +++ b/website/docs/r/bigquery_data_transfer_config.html.markdown @@ -94,7 +94,7 @@ resource "google_bigquery_data_transfer_config" "salesforce_config" { "connector.authentication.username" = "username" "connector.authentication.password" = "password" "connector.authentication.securityToken" = "security-token" - "assets" = "[asset-a, asset-b]" + "assets" = "[\"asset-a\",\"asset-b\"]" } } ```