Created
October 10, 2018 02:49
-
-
Save therealplato/07cd6f1f5acc0421370594c18b44d90a to your computer and use it in GitHub Desktop.
kops: WIP terraform support for --api-ssl-certificate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/upup/pkg/fi/cloudup/awstasks/load_balancer.go b/upup/pkg/fi/cloudup/awstasks/load_balancer.go | |
index 257c2b066..01baebd99 100644 | |
--- a/upup/pkg/fi/cloudup/awstasks/load_balancer.go | |
+++ b/upup/pkg/fi/cloudup/awstasks/load_balancer.go | |
@@ -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 { | |
@@ -696,13 +697,19 @@ func (_ *LoadBalancer) RenderTerraform(t *terraform.TerraformTarget, a, e, chang | |
if err != nil { | |
return fmt.Errorf("error parsing load balancer listener port: %q", loadBalancerPort) | |
} | |
- | |
- tf.Listener = append(tf.Listener, &terraformLoadBalancerListener{ | |
+ tl := terraformLoadBalancerListener{ | |
InstanceProtocol: "TCP", | |
InstancePort: listener.InstancePort, | |
LBPort: loadBalancerPortInt, | |
LBProtocol: "TCP", | |
- }) | |
+ } | |
+ if e.SSLCertificateID != "" { | |
+ tl.InstanceProtocol = "SSL" | |
+ tl.LBProtocol = "SSL" | |
+ tl.SSLCertificateID = e.SSLCertificateID | |
+ } | |
+ | |
+ tf.Listener = append(tf.Listener, &tl) | |
} | |
if e.HealthCheck != nil { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment