Skip to content

Instantly share code, notes, and snippets.

@nickithewatt
Last active January 22, 2017 02:02
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 nickithewatt/37292124e9403525a31f095a1bc49351 to your computer and use it in GitHub Desktop.
Save nickithewatt/37292124e9403525a31f095a1bc49351 to your computer and use it in GitHub Desktop.
resource "aws_iam_server_certificate" "elb_cert" {
name_prefix = "letfdemo-cert-"
certificate_body = "${var.demo_env_cert_body}"
certificate_chain = "${var.demo_env_cert_chain}"
private_key = "${var.demo_env_cert_privkey}"
lifecycle {
create_before_destroy = true
}
}
resource "aws_elb" "web" {
name = "letfdemo-elb-www"
subnets = ["${aws_subnet.public.id}"]
security_groups = ["${aws_security_group.elb.id}"]
instances = ["${aws_instance.nginx.*.id}"]
listener {
instance_port = 80
instance_protocol = "http"
lb_port = 443
lb_protocol = "https"
ssl_certificate_id = "${aws_iam_server_certificate.elb_cert.arn}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment