Skip to content

Instantly share code, notes, and snippets.

@katesclau
Created January 17, 2017 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katesclau/e9f3a0120cf6f7e86fd233dbd3999d5d to your computer and use it in GitHub Desktop.
Save katesclau/e9f3a0120cf6f7e86fd233dbd3999d5d to your computer and use it in GitHub Desktop.
resource "aws_iam_server_certificate" "tutorial_cert" {
name_prefix = "${var.elb_name}-cert"
certificate_body = "${file(${var.cert_file})}"
private_key = "${file(${var.key_file})}"
lifecycle {
create_before_destroy = true
}
}
resource "aws_elb" "classic_elb" {
name = "${var.elb_name}"
internal = "${var.internal}"
availability_zones = ["${var.availability_zone}"]
idle_timeout = "${var.idle_timeout}"
connection_draining = "${var.connection_draining}"
connection_draining_timeout = "${var.connection_draining_timeout}"
# Added this SSL entry point
listener {
instance_port = 8080
instance_protocol = "http"
lb_port = 443
lb_protocol = "https"
ssl_certificate_id = "${aws_iam_server_certificate.tutorial_cert.arn}"
}
listener {
instance_port = 8080
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment