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

add SSL certificate ARN to Terraform output #6082

Merged
merged 1 commit into from
Nov 18, 2018
Merged
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
24 changes: 18 additions & 6 deletions upup/pkg/fi/cloudup/awstasks/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ type terraformLoadBalancerListener struct {
InstanceProtocol string `json:"instance_protocol"`
LBPort int64 `json:"lb_port"`
LBProtocol string `json:"lb_protocol"`
SSLCertificateID string `json:"ssl_certificate_id,omitempty"`
}

type terraformLoadBalancerHealthCheck struct {
Expand Down Expand Up @@ -697,12 +698,23 @@ func (_ *LoadBalancer) RenderTerraform(t *terraform.TerraformTarget, a, e, chang
return fmt.Errorf("error parsing load balancer listener port: %q", loadBalancerPort)
}

tf.Listener = append(tf.Listener, &terraformLoadBalancerListener{
InstanceProtocol: "TCP",
InstancePort: listener.InstancePort,
LBPort: loadBalancerPortInt,
LBProtocol: "TCP",
})
if listener.SSLCertificateID != "" {
tf.Listener = append(tf.Listener, &terraformLoadBalancerListener{
InstanceProtocol: "SSL",
InstancePort: listener.InstancePort,
LBPort: loadBalancerPortInt,
LBProtocol: "SSL",
SSLCertificateID: listener.SSLCertificateID,
})
} else {
tf.Listener = append(tf.Listener, &terraformLoadBalancerListener{
InstanceProtocol: "TCP",
InstancePort: listener.InstancePort,
LBPort: loadBalancerPortInt,
LBProtocol: "TCP",
})
}

}

if e.HealthCheck != nil {
Expand Down