猿问

在InvalidViewerCertificate中使用默认Viewer证书创建AWS分配

我正在尝试通过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

    },


这实际上在几周前就可以了,但是可能有所改变。或者,也许默认证书所允许的分发数量受到限制?


慕的地8271018
浏览 235回答 1
1回答

慕沐林林

我认为这是由于CloudFront最近发布的消息:https://forums.aws.amazon.com/ann.jspa?annID=6725由于您要添加CNAME:“别名”:{“数量”:2,“项目”:[“ www.xxyz.com”,“ xyz.com”]}
随时随地看视频慕课网APP
我要回答