Skip to content

Commit 6484c65

Browse files
added DSF for plan in google_bigquery_capacity_commitment (#7999) (#14854)
Signed-off-by: Modular Magician <[email protected]>
1 parent 3741fd2 commit 6484c65

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.changelog/7999.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google/services/bigqueryreservation/resource_bigquery_capacity_commitment.go

+11-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ import (
3030
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
3131
)
3232

33+
func bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool {
34+
if (old == "FLEX" || old == "MONTHLY" || old == "ANNUAL") && new == old+"_FLAT_RATE" {
35+
return true
36+
}
37+
return false
38+
}
39+
3340
func ResourceBigqueryReservationCapacityCommitment() *schema.Resource {
3441
return &schema.Resource{
3542
Create: resourceBigqueryReservationCapacityCommitmentCreate,
@@ -49,9 +56,10 @@ func ResourceBigqueryReservationCapacityCommitment() *schema.Resource {
4956

5057
Schema: map[string]*schema.Schema{
5158
"plan": {
52-
Type: schema.TypeString,
53-
Required: true,
54-
Description: `Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan`,
59+
Type: schema.TypeString,
60+
Required: true,
61+
DiffSuppressFunc: bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc,
62+
Description: `Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan`,
5563
},
5664
"slot_count": {
5765
Type: schema.TypeInt,

0 commit comments

Comments
 (0)