Setting multiple certificates on an aws_lb_listener using terraform

Viewed 3264

Using terraform, is there a way using aws_lb_listener to set multiple certificate arn?

Practicallyit seems "certificate_arn" field is accepting only one certificate arn. Is there a trick to add multiple certificates arn?

Something like:

resource "aws_lb_listener" "https" {
  certificate_arn     = ["${var.certificate1_arn}", "${var.certificate2_arn}"]

}
2 Answers

Seems like this is possible now with https://www.terraform.io/docs/providers/aws/r/lb_listener_certificate.html

This resource is for additional certificates and does not replace the default certificate on the listener.

resource "aws_lb_listener" "front_end" {
  # ...
}

resource "aws_lb_listener_certificate" "example" {
  listener_arn    = "${aws_lb_listener.front_end.arn}"
  certificate_arn = "${aws_acm_certificate.example.arn}"
}
Related