Skip to content

Commit

Permalink
Fix params decoding and example values in google_bigquery_data_transf…
Browse files Browse the repository at this point in the history
…er_config (#11284) (#18898)

[upstream:155ff00adac6444186d40fa83222ff39853d9562]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 30, 2024
1 parent 1d53e98 commit 4d74ea5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/11284.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
bigquery: fixed a permadiff when handling "assets" params in the `google_bigquery_data_transfer_config` resource
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/bigquery_data_transfer_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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\"]"
}
}
```
Expand Down

0 comments on commit 4d74ea5

Please sign in to comment.