尝试匹配在AWS ACM中使用terraform的经典负载均衡器创建的证书时遇到问题。
根据文档和示例,terraform希望我提供我已上传到AWS IAM的SSL证书。请参见documentation,但这没有多大意义,因为我在ACM中拥有证书。有人知道如何使用terraform配置此证书吗?
这是我遇到的错误
Error: Error creating ELB: ValidationError: Secure Listeners need to specify a SSLCertificateId
status code: 400, request id: c16d2c09-32b7-484f-9c51-e8a2d8fed1fe
on modules/ec2/loadbalancer.tf line 3, in resource "aws_elb" "bar":
3: resource "aws_elb" "sprint0_elb" {
resource "aws_elb" "bar" {
name = "foobar-terraform-elb"
availability_zones = ["us-east-2a", "us-east-2b", "us-east-2c"]
access_logs {
bucket = "foo"
bucket_prefix = "bar"
interval = 60
}
listener {
instance_port = 8000
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
listener {
instance_port = 8000
instance_protocol = "http"
lb_port = 443
lb_protocol = "https"
ssl_certificate_id = "arn:aws:acm:us-east-1:xxxxxxxxxxxxxxx:certificate/xxxxxx-xxxx-xxx-xxx-xxxxxxxxxx"
}