您好,我在为 ALB 监听器设置多个证书时遇到问题。 这是我的 CF 模板的片段:
DiscoveryListenerHTTPS:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- DiscoveryLoadBalancer
- DiscoveryLoadBalancerTargetGroup
Properties:
Certificates:
- CertificateArn: !Ref CertificateArn1
- CertificateArn: !Ref CertificateArn2
响应是:
最多可以指定“1”个证书 ARN,但指定了“2”个(服务:AmazonElasticLoadBalancingV2;状态代码:400;错误代码:TooManyCertificates;请求 ID:XXXXXXXXX)
最佳答案
编辑:由于@chris-pollard 和@adamkgray 的回答改进了答案
这对我有用,您可以为 HTTPS 监听器指定多个 SSL 证书。
对于 HTTPS,您不能在AWS::ElasticLoadBalancingV2::Listener 上直接指定多个证书。资源。 相反,您必须创建一个 AWS::ElasticLoadBalancingV2::ListenerCertificate模板中的资源以获取其他证书。
以下是 443 端口监听器的示例,该监听器使用默认证书,然后是包含至少一个证书并与之前创建的监听器关联的证书列表:
Listener443:
DependsOn:
- LoadBalancer
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
Certificates:
- CertificateArn: !Ref CertificateARN
LoadBalancerArn: !Ref LoadBalancer
DefaultActions:
- Type: fixed-response
FixedResponseConfig:
ContentType: text/plain
MessageBody: "Not Found"
StatusCode: 404
Port: 443
Protocol: HTTPS
CertificatesList:
Type: AWS::ElasticLoadBalancingV2::ListenerCertificate
Properties:
Certificates:
- CertificateArn: !Ref CertificateARN2
ListenerArn: !Ref Listener443
关于amazon-web-services - 如何为 AWS::ElasticLoadBalancingV2::Listener 设置多个证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54447250/