Create certificate using cloudformation fails when using SubjectAlternativeNames

0

I am trying to use cloudformation to create a certificate. The domain is managed in route53.

Resources:
  SiteCert:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Ref DomainName
      DomainValidationOptions:
        - DomainName: !Ref DomainName
          HostedZoneId: !Ref HostedZoneId
      SubjectAlternativeNames:
        - !Sub
          - www.${Domain}
          - Domain: !Ref DomainName
      ValidationMethod: DNS

If I remove the SubjectAlternativeNames the cert is created, but with the alternate names it fails to create the second cname record which leaves the cert as in progress for 12 hours before failing and being deleted.

I can see in the cert manager that the domain name has a success status, but the alternate name stays as Pending validation.

In route53, the cname is created for the domain, but no record is created for the alternative names.

1개 답변
1
수락된 답변

Hello.

I think it will work if you also specify the subdomain in "DomainValidationOptions".
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-certificatemanager-certificate.html#cfn-certificatemanager-certificate-subjectalternativenames

Resources:
  SiteCert:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Ref DomainName
      DomainValidationOptions:
        - DomainName: !Ref DomainName
          HostedZoneId: !Ref HostedZoneId
        - DomainName: !Sub "www.${DomainName}"
          HostedZoneId: !Ref HostedZoneId
      SubjectAlternativeNames:
        - !Sub "www.${DomainName}"
      ValidationMethod: DNS
profile picture
전문가
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠