Skip to content

Commit

Permalink
added DSF for plan in google_bigquery_capacity_commitment (#7999) (#5748
Browse files Browse the repository at this point in the history
)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 8, 2023
1 parent 500e827 commit ff8b48b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/7999.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ import (
transport_tpg "github.com/hashicorp/terraform-provider-google-beta/google-beta/transport"
)

func bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool {
if (old == "FLEX" || old == "MONTHLY" || old == "ANNUAL") && new == old+"_FLAT_RATE" {
return true
}
return false
}

func ResourceBigqueryReservationCapacityCommitment() *schema.Resource {
return &schema.Resource{
Create: resourceBigqueryReservationCapacityCommitmentCreate,
Expand All @@ -49,9 +56,10 @@ func ResourceBigqueryReservationCapacityCommitment() *schema.Resource {

Schema: map[string]*schema.Schema{
"plan": {
Type: schema.TypeString,
Required: true,
Description: `Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan`,
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc,
Description: `Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan`,
},
"slot_count": {
Type: schema.TypeInt,
Expand Down

0 comments on commit ff8b48b

Please sign in to comment.