我正在尝试为子域创建Cloudfront发行版,例如dev.example.com。但是,在添加了对象来源的详细信息之后,我输入了备用域名(CNAMES)部分并添加:dev.example.com,当我单击创建分发时,出现以下错误:
com.amazonaws.services.cloudfront.model.InvalidViewerCertificateException: To add an alternate domain name (CNAME) to a CloudFront distribution, you must attach a trusted certificate that validates your authorization to use the domain name. For more details, see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidViewerCertificate; Request ID: fb305ccd-21e7-4bf8-a55c-df1304c06ac1; Proxy: null)
我正在通过Route 53管理自己的domian dns。我已经通过ACM创建了一个证书,但是选择自定义SSL证书的选项显示为灰色。我已经看过AWS文档,但到目前为止找不到任何解决方案。
答案 0 :(得分:1)
此错误表示尝试使用的证书不正确。
必须在us-east-1
中为CloudFront分发创建您的ACM证书。原因是CloudFront是全局服务,全局服务只能附加us-east-1
中存在的区域服务。它们还将出现在us-east-1
区域下的CloudWatch和CloudTrail中。
它还必须涵盖您正在使用的域。对于您而言,dev.example.com
或*.example.com
必须包含在证书中。
答案 1 :(得分:1)
您必须在us-east-1中创建ACM证书。是吗?