0

尝试在 terraform 的经典负载均衡器中匹配我在 AWS ACM 创建的证书时遇到问题。

根据文档和示例,terraform 希望我提供已上传到 AWS IAM 的 SSL 证书。请参阅文档但这没有多大意义,因为我在 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"
  }
4

0 回答 0