providers/aws: resource ELB listeners [GH-314]
This commit is contained in:
parent
aee9c480b2
commit
51d66b678d
|
@ -337,6 +337,7 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("dns_name", lb.DNSName)
|
d.Set("dns_name", lb.DNSName)
|
||||||
d.Set("internal", lb.Scheme == "internal")
|
d.Set("internal", lb.Scheme == "internal")
|
||||||
d.Set("instances", flattenInstances(lb.Instances))
|
d.Set("instances", flattenInstances(lb.Instances))
|
||||||
|
d.Set("listener", flattenListeners(lb.Listeners))
|
||||||
d.Set("security_groups", lb.SecurityGroups)
|
d.Set("security_groups", lb.SecurityGroups)
|
||||||
d.Set("subnets", lb.Subnets)
|
d.Set("subnets", lb.Subnets)
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,21 @@ func flattenInstances(list []elb.Instance) []string {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Flattens an array of Listeners into a []map[string]interface{}
|
||||||
|
func flattenListeners(list []elb.Listener) []map[string]interface{} {
|
||||||
|
result := make([]map[string]interface{}, 0, len(list))
|
||||||
|
for _, i := range list {
|
||||||
|
result = append(result, map[string]interface{}{
|
||||||
|
"instance_port": i.InstancePort,
|
||||||
|
"instance_protocol": i.InstanceProtocol,
|
||||||
|
"ssl_certificate_id": i.SSLCertificateId,
|
||||||
|
"lb_port": i.LoadBalancerPort,
|
||||||
|
"lb_protocol": i.Protocol,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
// Takes the result of flatmap.Expand for an array of strings
|
// Takes the result of flatmap.Expand for an array of strings
|
||||||
// and returns a []string
|
// and returns a []string
|
||||||
func expandStringList(configured []interface{}) []string {
|
func expandStringList(configured []interface{}) []string {
|
||||||
|
|
Loading…
Reference in New Issue