Created
January 17, 2017 16:49
-
-
Save katesclau/e9f3a0120cf6f7e86fd233dbd3999d5d to your computer and use it in GitHub Desktop.
This file contains 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
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