Open andreineculau opened 7 years ago
For future references, this is how the resource looks like
Method = {
Type: 'AWS::ApiGateway::Method',
Properties: {
ApiKeyRequired: undefined,
AuthorizationType: 'NONE',
AuthorizerId: undefined,
HttpMethod: 'ANY',
Integration: {
CacheKeyParameters: [
'method.request.path.proxy'
],
CacheNamespace: undefined,
Credentials: undefined,
IntegrationHttpMethod: 'ANY',
IntegrationResponses: [{
StatusCode: '200'
}],
PassthroughBehavior: undefined,
RequestParameters: {
'integration.request.path.proxy': 'method.request.path.proxy'
},
RequestTemplates: undefined,
Type: 'HTTP_PROXY',
Uri: {'Fn::Sub': 'https://example.com/{proxy}'}
},
MethodResponses: undefined,
RequestModels: undefined,
RequestParameters: {
'method.request.path.proxy': true
},
ResourceId: {Ref: 'Resource'},
RestApiId: {Ref: 'Api'}
}
};
When creating a
AWS::ApiGateway::Method
resource in cloudformation to act as a simple HTTP reverse proxy, it is still necessary to add setProperties.Integration.IntegrationResponses
to the illogical[{"StatusCode": 200}]
.On top of that, the source server can reply with any HTTP status code, not just 200 (but thank goodness for this illogical part, I mean!)