Skip to content

Commit

Permalink
Parse nil region for global lb (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
asaha2 authored Oct 5, 2023
1 parent 04fb557 commit 64c3ba0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion digitalocean/loadbalancer/resource_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ func resourceDigitalOceanLoadbalancerRead(ctx context.Context, d *schema.Resourc
d.Set("ip", loadbalancer.IP)
d.Set("status", loadbalancer.Status)
d.Set("algorithm", loadbalancer.Algorithm)
d.Set("region", loadbalancer.Region.Slug)
d.Set("redirect_http_to_https", loadbalancer.RedirectHttpToHttps)
d.Set("enable_proxy_protocol", loadbalancer.EnableProxyProtocol)
d.Set("enable_backend_keepalive", loadbalancer.EnableBackendKeepalive)
Expand All @@ -573,6 +572,10 @@ func resourceDigitalOceanLoadbalancerRead(ctx context.Context, d *schema.Resourc
d.Set("size", loadbalancer.SizeSlug)
}

if loadbalancer.Region != nil {
d.Set("region", loadbalancer.Region.Slug)
}

d.Set("disable_lets_encrypt_dns_records", loadbalancer.DisableLetsEncryptDNSRecords)

if err := d.Set("droplet_ids", flattenDropletIds(loadbalancer.DropletIDs)); err != nil {
Expand Down

0 comments on commit 64c3ba0

Please sign in to comment.