Skip to content

Commit

Permalink
fix permadiff of encryption_configuration in resource_bigquery_table …
Browse files Browse the repository at this point in the history
…when API returns an empty object (#9757) (#16926)

[upstream:e13491302ec24b3bee4a10d88b319d2cfa14067b]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jan 8, 2024
1 parent e5a8d2d commit 12fcca1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/9757.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
bigquery: Fix permadiff of encryption_configuration in resource_bigquery_table when API returns an empty object
```
4 changes: 4 additions & 0 deletions google/services/bigquery/resource_bigquery_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,10 @@ func flattenEncryptionConfiguration(ec *bigquery.EncryptionConfiguration) []map[
re := regexp.MustCompile(`(projects/.*/locations/.*/keyRings/.*/cryptoKeys/.*)/cryptoKeyVersions/.*`)
paths := re.FindStringSubmatch(ec.KmsKeyName)

if len(ec.KmsKeyName) == 0 {
return nil
}

if len(paths) > 0 {
return []map[string]interface{}{
{
Expand Down

0 comments on commit 12fcca1

Please sign in to comment.