ntegração do @API Gateway HTTP Proxy com offline sem servidor (NÃO Lambda Proxy)
Estou tentando usar o offline sem servidor para desenvolver / simular meu API Gateway localmente. Meu gateway de API faz uso liberal do Integrações de proxy HTTP. O recurso de produção fica assim:
Criei uma configuração offline sem servidor com base em alguns documentos e discussões que afirmam que é possível definir uma integração de Proxy HTTP usando a configuração de Formação em Nuvem:
httpProxyWithApiGateway.md - Definindo um proxy HTTP no API Gateway usando a estrutura sem servido Definir um proxy HTTP no API Gateway (documentos oficiais sem servidor: API Gateway)Adaptei os dois exemplos de configuração acima para os meus propósitos, veja abaix
Tem alguma dica, para o que eu posso estar fazendo de errado aqu
plugins:
- serverless-offline
service: company-apig
provider:
name: aws
stage: dev
runtime: python2.7
resources:
Resources:
# Parent APIG RestApi
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: company-apig
Description: 'The main entry point of the APIG'
# Resource /endpoint
EndpointResource:
Type: AWS::ApiGateway::Resource
Properties:
ParentId:
Fn::GetAtt:
- ApiGatewayRestApi
- RootResourceId
PathPart: 'endpoint'
RestApiId:
Ref: ApiGatewayRestApi
# Resource /endpoint/{proxy+}
EndpointProxyPath:
Type: AWS::ApiGateway::Resource
Properties:
ParentId:
Ref: EndpointResource
PathPart: '{proxy+}'
RestApiId:
Ref: ApiGatewayRestApi
# Method ANY /endpoint/{proxy+}
EndpointProxyAnyMethod:
Type: AWS::ApiGateway::Method
Properties:
AuthorizationType: NONE
HttpMethod: ANY
Integration:
IntegrationHttpMethod: ANY
Type: HTTP_PROXY
Uri: http://endpoint.company.cool/{proxy}
PassthroughBehavior: WHEN_NO_MATCH
MethodResponses:
- StatusCode: 200
ResourceId:
Ref: EndpointProxyPath
RestApiId:
Ref: ApiGatewayRestApi
Para a configuração acima, recebo esta saída. Aparentemente, a configuração não registra nenhuma rot
{
"statusCode":404,
"error":"Serverless-offline: route not found.",
"currentRoute":"get - /endpoint/ping",
"existingRoutes":[]
}
Related: Também estou tentando resolver o mesmo problema usando o aws-sam, no seguinte post -ntegração do @API Gateway HTTP Proxy com o aws-sam (NÃO Lambda Proxy)