I have certificate in aws certificate manager.
How I connect this certificate to aws_alb_listener in terraform?
Right now I take the certs from files in my computer.
resource "aws_alb_listener" "alb_front_https" {
load_balancer_arn = "${aws_alb.demo_eu_alb.arn}"
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-Ext-2018-06"
certificate_arn = "${aws_iam_server_certificate.lb_cert.arn}"
default_action {
target_group_arn = "${aws_alb_target_group.nginx.arn}"
type = "forward"
}
}
resource "aws_iam_server_certificate" "lb_cert" {
name = "lb_cert-${var.app}"
certificate_body = "${file("./www.xxx.com/cert.pem")}"
private_key = "${file("./www.xxx.com/privkey.pem")}"
certificate_chain = "${file("./www.xxx.com/chain.pem")}"
}
I want to aws_alb_listener to use certificate on aws certificate manager.
How to do that in terraform?
