我AWS::Serverless::HttpApi
定义了以下内容:
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins:
- http://localhost:3000
- https://localhost:3000
- https://my.site
Domain:
CertificateArn: !Ref MahCert
DomainName: api.my.site
EndpointConfiguration: REGIONAL
Route53:
# Very similar to one of the record sets in the R53 record set groups
DistributionDomainName: !GetAtt CloudFrontCDN.DomainName
HostedZoneId: !Ref MyHostedZone
IpV6: true
StageName: Prod
DefinitionBody:
openapi: "3.0.1"
info:
title: api.my.site
paths:
/steam/hours:
get:
responses:
"200":
description: "200 response"
headers:
Access-Control-Allow-Origin:
schema:
type: "string"
content: { }
x-amazon-apigateway-integration:
type: "http"
httpMethod: "GET"
uri: "https://example.com"
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Origin: "'*'"
passthroughBehavior: "when_no_match"
AccessLogSettings:
DestinationArn: !GetAtt CloudWatchLogGroup.Arn
Format: '{ "$context.requestId": { "error": { "message": "$context.error.message", "messageString": "$context.error.messageString", "responseType": "$context.error.responseType" }, "integrationError": { "message": "$context.integrationErrorMessage", "error": "$context.integration.error", "status": "$context.integration.status" }}}'
这个 OpenAPI 定义应该定义一个带有 HTTP 集成的路由,该路由将请求代理到https://example.com
. 我实际上是从我手动构建的 REST API 中导出了这个 OpenAPI 规范。CloudFormation 没有关于缺少属性的任何问题。
当我尝试访问该路由时,我得到一个 404。原因是该路由实际上没有任何集成:
为什么 CloudFormation 不在这里应用 http 集成?