我试过这个
{
"DomainName": "myapi.execute-api.us-east-1.amazonaws.com/dev,
"Id": "APIEndPoint",
"CustomOriginConfig": {
"OriginProtocolPolicy": "https-only",
"OriginSSLProtocols":["TLSv1", "TLSv1.1", "TLSv1.2"]
}
但我收到以下错误
The parameter origin name must be a domain name.
(Service: AmazonCloudFront;
Status Code: 400;
Error Code: InvalidArgument; Request ID:
答案 0 :(得分:4)
我找到了我们只需要添加OriginPath属性的答案。这是
{
"DomainName": {
"Ref": "APIGatewayEndpoint"
},
"Id": "APIEndPoint",
"CustomOriginConfig": {
"OriginProtocolPolicy": "https-only",
"OriginSSLProtocols": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
},
"OriginPath": {
"Fn::Join": [
"",
[
"/",
{
"Ref": "APIStage"
}
]
]
}
}