Skip to content

Commit

Permalink
Added suppress diff for aws_attributes.zone_id with value auto in…
Browse files Browse the repository at this point in the history
… `databricks_instance_pool` (#2518)

This fixes #2517
  • Loading branch information
alexott authored Jul 27, 2023
1 parent 541824f commit 6b7220a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pools/resource_instance_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pools

import (
"context"
"strings"

"github.com/databricks/terraform-provider-databricks/clusters"
"github.com/databricks/terraform-provider-databricks/common"
Expand Down Expand Up @@ -183,6 +184,10 @@ func ResourceInstancePool() *schema.Resource {
if v, err := common.SchemaPath(s, "aws_attributes", "spot_bid_price_percent"); err == nil {
v.Default = 100
}
common.MustSchemaPath(s, "aws_attributes", "zone_id").DiffSuppressFunc = func(k, oldValue, newValue string, d *schema.ResourceData) bool {
return oldValue != "" && strings.ToLower(newValue) == "auto"
}

if v, err := common.SchemaPath(s, "azure_attributes", "availability"); err == nil {
v.Default = clusters.AzureAvailabilityOnDemand
v.ValidateFunc = validation.StringInSlice([]string{
Expand Down

0 comments on commit 6b7220a

Please sign in to comment.