From c4810eb30270dff1e5f18fb9e56c12ff6ff51ac4 Mon Sep 17 00:00:00 2001 From: Aditya Saha Date: Thu, 5 Oct 2023 10:51:35 -0400 Subject: [PATCH] Parse nil region for global lb --- digitalocean/loadbalancer/resource_loadbalancer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/digitalocean/loadbalancer/resource_loadbalancer.go b/digitalocean/loadbalancer/resource_loadbalancer.go index 2b099249d..53585245f 100644 --- a/digitalocean/loadbalancer/resource_loadbalancer.go +++ b/digitalocean/loadbalancer/resource_loadbalancer.go @@ -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) @@ -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 {