diff --git a/mmv1/products/bigqueryreservation/CapacityCommitment.yaml b/mmv1/products/bigqueryreservation/CapacityCommitment.yaml index 17649a1bfcff..bd51ff262e37 100644 --- a/mmv1/products/bigqueryreservation/CapacityCommitment.yaml +++ b/mmv1/products/bigqueryreservation/CapacityCommitment.yaml @@ -31,6 +31,8 @@ import_format: [ 'projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}', ] +custom_code: !ruby/object:Provider::Terraform::CustomCode + constants: templates/terraform/constants/bigquery_reservation_capacity_commitment.go.erb examples: - !ruby/object:Provider::Terraform::Examples name: 'bigquery_reservation_capacity_commitment_basic' @@ -81,6 +83,7 @@ properties: 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 + diff_suppress_func: bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc - !ruby/object:Api::Type::String name: 'state' output: true diff --git a/mmv1/templates/terraform/constants/bigquery_reservation_capacity_commitment.go.erb b/mmv1/templates/terraform/constants/bigquery_reservation_capacity_commitment.go.erb new file mode 100644 index 000000000000..8af8fa7e5755 --- /dev/null +++ b/mmv1/templates/terraform/constants/bigquery_reservation_capacity_commitment.go.erb @@ -0,0 +1,6 @@ +func bigqueryReservationCapacityCommitmentPlanDiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool { + if (old == "FLEX" || old == "MONTHLY" || old == "ANNUAL") && new == old+"_FLAT_RATE" { + return true + } + return false +}