Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_lb_backend_address_pool_address - when using this resource, values are no longer reset on azurerm_lb_backend_address_pool #26264

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
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,10 @@ func (r BackendAddressPoolAddressResource) Create() sdk.ResourceFunc {
})
}

backendAddressPool := loadbalancers.BackendAddressPool{
Properties: &loadbalancers.BackendAddressPoolPropertiesFormat{
LoadBalancerBackendAddresses: &addresses,
},
}
pool.Model.Properties.LoadBalancerBackendAddresses = &addresses

metadata.Logger.Infof("adding %s..", id)
err = lbClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, *poolId, backendAddressPool)
err = lbClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, *poolId, *pool.Model)
if err != nil {
return fmt.Errorf("updating %s: %+v", id, err)
}
Expand Down Expand Up @@ -478,11 +475,7 @@ func (r BackendAddressPoolAddressResource) Update() sdk.ResourceFunc {
}
}

backendAddressPool := loadbalancers.BackendAddressPool{
Properties: &loadbalancers.BackendAddressPoolPropertiesFormat{
LoadBalancerBackendAddresses: &addresses,
},
}
pool.Model.Properties.LoadBalancerBackendAddresses = &addresses

timeout, _ := ctx.Deadline()
lbStatus := &pluginsdk.StateChangeConf{
Expand All @@ -499,7 +492,7 @@ func (r BackendAddressPoolAddressResource) Update() sdk.ResourceFunc {
return fmt.Errorf("waiting for parent resource loadbalancer status to be ready error: %+v", err)
}

err = lbClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, poolId, backendAddressPool)
err = lbClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, poolId, *pool.Model)
if err != nil {
return fmt.Errorf("updating %s: %+v", *id, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,9 @@ func (BackendAddressPoolAddressResourceTests) Destroy(ctx context.Context, clien
}
}

backendAddressPool := loadbalancers.BackendAddressPool{
Properties: &loadbalancers.BackendAddressPoolPropertiesFormat{
LoadBalancerBackendAddresses: &newAddresses,
},
}
err = client.LoadBalancers.LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, poolId, backendAddressPool)
pool.Model.Properties.LoadBalancerBackendAddresses = &newAddresses

err = client.LoadBalancers.LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, poolId, *pool.Model)
if err != nil {
return nil, fmt.Errorf("updating %s: %+v", *id, err)
}
Expand Down
Loading