Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/services/rdb/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,16 @@ func getIPConfigUpdate(d *schema.ResourceData, ipFieldName string) (ipamConfig *

return ipamConfig, staticConfig
}

// LoadBalancerDiffSuppressFunc suppresses diff when load_balancer is not set
func LoadBalancerDiffSuppressFunc(k, oldValue, newValue string, d *schema.ResourceData) bool {
if !strings.HasPrefix(k, "load_balancer") {
return false
}

if _, exists := d.GetOk("load_balancer"); !exists {
return true
}

return false
}
10 changes: 6 additions & 4 deletions internal/services/rdb/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@ func ResourceInstance() *schema.Resource {
Description: "Certificate of the database instance",
},
"load_balancer": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Description: "Load balancer of the database instance",
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Load balancer of the database instance",
DiffSuppressFunc: LoadBalancerDiffSuppressFunc,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
// Computed
Expand Down
1,281 changes: 763 additions & 518 deletions internal/services/rdb/testdata/instance-endpoints.cassette.yaml

Large diffs are not rendered by default.

Loading