provider/aws: Safely get ELB values (#7585)
- removes dereferences to avoid nil crashes
This commit is contained in:
parent
8c6d71daf6
commit
3cea29176f
|
@ -336,10 +336,15 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
lb := describeResp.LoadBalancerDescriptions[0]
|
lb := describeResp.LoadBalancerDescriptions[0]
|
||||||
|
|
||||||
d.Set("name", *lb.LoadBalancerName)
|
d.Set("name", lb.LoadBalancerName)
|
||||||
d.Set("dns_name", *lb.DNSName)
|
d.Set("dns_name", lb.DNSName)
|
||||||
d.Set("zone_id", *lb.CanonicalHostedZoneNameID)
|
d.Set("zone_id", lb.CanonicalHostedZoneNameID)
|
||||||
d.Set("internal", *lb.Scheme == "internal")
|
|
||||||
|
var scheme bool
|
||||||
|
if lb.Scheme != nil {
|
||||||
|
scheme = *lb.Scheme == "internal"
|
||||||
|
}
|
||||||
|
d.Set("internal", scheme)
|
||||||
d.Set("availability_zones", flattenStringList(lb.AvailabilityZones))
|
d.Set("availability_zones", flattenStringList(lb.AvailabilityZones))
|
||||||
d.Set("instances", flattenInstances(lb.Instances))
|
d.Set("instances", flattenInstances(lb.Instances))
|
||||||
d.Set("listener", flattenListeners(lb.ListenerDescriptions))
|
d.Set("listener", flattenListeners(lb.ListenerDescriptions))
|
||||||
|
|
Loading…
Reference in New Issue