Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用默认查看器证书创建AWS发行版将导致InvalidViewerCertificate_Php_Amazon Web Services_Amazon Cloudfront - Fatal编程技术网

Php 使用默认查看器证书创建AWS发行版将导致InvalidViewerCertificate

Php 使用默认查看器证书创建AWS发行版将导致InvalidViewerCertificate,php,amazon-web-services,amazon-cloudfront,Php,Amazon Web Services,Amazon Cloudfront,我正在尝试通过API创建新的AWS发行版,我正在设置: "ViewerCertificate": { "CloudFrontDefaultCertificate": true }, 这应该使用默认的CF证书,但因此我得到以下错误: InvalidViewerCertificate To add an alternate domain name (CNAME) to a CloudFront distribution, you must attach a trus

我正在尝试通过API创建新的AWS发行版,我正在设置:

    "ViewerCertificate": {
        "CloudFrontDefaultCertificate": true
    },
这应该使用默认的CF证书,但因此我得到以下错误:

InvalidViewerCertificate
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.

{
"DistributionConfig": {
    "Aliases": {
        "Quantity": 2,
        "Items": ["www.xxyz.com", "xyz.com"]
    },
    "DefaultRootObject": "",
    "Origins": {
        "Quantity": 1,
        "Items": [{
            "Id": "RJMn5FUTvrqoh-cloudfrontxyz.com",
            "DomainName": "chzsgor80ynsme.xyz.com",
            "OriginPath": "",
            "CustomHeaders": {
                "Quantity": 0
            },
            "CustomOriginConfig": {
                "HTTPPort": 80,
                "HTTPSPort": 443,
                "OriginProtocolPolicy": "http-only",
                "OriginSslProtocols": {
                    "Quantity": 4,
                    "Items": ["SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"]
                }
            }
        }]
    },
    "DefaultCacheBehavior": {
        "TargetOriginId": "RJMn5FUTvrqoh-cloudfrontxyz.com",
        "ForwardedValues": {
            "QueryString": true,
            "Cookies": {
                "Forward": "all"
            },
            "Headers": {
                "Quantity": 1,
                "Items": ["Host"]
            }
        },
        "TrustedSigners": {
            "Enabled": false,
            "Quantity": 0
        },
        "ViewerProtocolPolicy": "allow-all",
        "AllowedMethods": {
            "Quantity": 7,
            "Items": ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"],
            "CachedMethods": {
                "Quantity": 2,
                "Items": ["HEAD", "GET"]
            }
        },
        "SmoothStreaming": false,
        "MinTTL": 0,
        "DefaultTTL": 3600,
        "MaxTTL": 31536000,
        "Compress": false
    },
    "CacheBehaviors": {
        "Quantity": 0
    },
    "CustomErrorResponses": {
        "Quantity": 0
    },
    "Comment": "",
    "Logging": {
        "Enabled": false,
        "Bucket": "",
        "Prefix": "",
        "IncludeCookies": true
    },
    "Enabled": true,
    "PriceClass": "PriceClass_100",
    "ViewerCertificate": {
        "CloudFrontDefaultCertificate": true
    },
    "Restrictions": {
        "GeoRestriction": {
            "RestrictionType": "none",
            "Quantity": 0
        }
    },
    "WebACLId": "",
    "CallerReference": "xyz-1555690298"
}
}

这实际上在几周前就奏效了,但可能发生了一些变化。 或者,可能对默认证书允许的分发数量有限制


谢谢你的帮助

我认为这是因为CloudFront最近发布的公告:

由于您正在添加CNAME: “别名”:{ “数量”:2, “项目”:[“www.xxyz.com”、“xyz.com”] }