【发布时间】:2020-11-10 07:19:24
【问题描述】:
我在 AWS Cloudformation 中收到以下错误:
验证结果:警告:[],错误:[指定的内容类型无效:method.response.header.Content-Type](服务:AmazonApiGateway;状态代码:400;错误代码:BadRequestException;
rootProxy:
Type: 'AWS::ApiGateway::Method'
Properties:
ResourceId: !Ref rootResource
RestApiId: !Ref apigatewayRestApi
AuthorizationType: NONE
HttpMethod: ANY
RequestParameters:
method.request.header.Content-Type: false
method.request.path.proxy: false
Integration:
PassthroughBehavior: WHEN_NO_MATCH
RequestParameters:
integration.request.path.proxy: method.request.path.proxy
integration.request.header.Content-Type: method.request.header.Content-Type
IntegrationResponses:
-
StatusCode: 200
ResponseTemplates:
method.response.header.Content-Type: "integration.response.header.Content-Type"
Type: AWS
Credentials: "arn:aws:iam::xxx:user/ali@xxx.com"
IntegrationHttpMethod: ANY
Uri: !Sub
- arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${SSRlambdaArn}/invocations
- SSRlambdaArn: !GetAtt SSR.Arn
MethodResponses:
-
StatusCode: 200
ResponseModels:
application/json: Empty
text/plain: Empty
ResponseParameters:
method.response.header.Content-Type: true
关于这个错误的任何想法?
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-cloudformation aws-api-gateway content-type