CloudFormation을 사용하여 여러 ACM SSL 또는 TLS 인증서를 Application Load Balancer와 연결하려면 어떻게 해야 합니까?

1분 분량
0

AWS CloudFormation을 사용하여 여러 AWS Certificate Manager SSL 및 TLS 인증서를 Application Load Balancer와 연결하고 싶습니다.

간략한 설명

보안 리스너를 위한 기본 SSL 서버를 추가하려면 AWS::ElasticLoadBalancingV2::Listener 리소스에 대해 인증서 속성을 사용합니다. 이 리소스는 하나의 인증서를 제공합니다. 인증서를 더 추가하려면 AWS::ElasticLoadBalancingV2::ListenerCertificate를 사용합니다. AWS::ElasticLoadBalancingV2::ListenerCertificate에는 인증서 목록을 수락하는 인증서 파라미터가 포함되어 있습니다.

해결 방법

다음 CloudFormation 템플릿을 사용하여 하나의 기본 인증서가 있는 Application Load Balancer 리스너를 생성합니다.

HTTPlistener:
  Type: 'AWS::ElasticLoadBalancingV2::Listener'
  DependsOn: ApplicationLoadBalancer
  Properties:
    DefaultActions:
      - Type: fixed-response
        FixedResponseConfig:
          ContentType: text/plain
          MessageBody: Success
          StatusCode: '200'
    LoadBalancerArn: >-
      arn:aws:elasticloadbalancing:<Region>:<AccountID>:loadbalancer/app/TestACMELB/1032d48308c9b37f
    Port: '443'
    Protocol: HTTPS
    Certificates:
      - CertificateArn: >-
          arn:aws:acm:<Region>:<AccountID>:certificate/cffb8a69-0817-4e04-bfb1-dac7426d6b90

다음 CloudFormation 템플릿을 사용하여 Application Load Balancer 리스너에 여러 인증서를 추가합니다.

AdditionalCertificates:
  Type: 'AWS::ElasticLoadBalancingV2::ListenerCertificate'
  DependsOn: HTTPlistener
  Properties:
    Certificates:
      - CertificateArn: >-
          arn:aws:acm:<Region>:<AccountID>:certificate/c71a3c29-e79d-40e6-8834-650fe0d54a3f
      - CertificateArn: >-
          arn:aws:acm:<Region>:<AccountID>:certificate/fff1c1ba-3d97-4735-b3d5-9c5269b75db3
    ListenerArn:
      Ref: HTTPlistener

AWS 공식
AWS 공식업데이트됨 2년 전