We're planning to use API Gateway as REST API HTTP proxy only initially - as we have existing REST service and we wish to split it into smaller parts under covers without changing client interface (possibly later replacing some of those parts with lambda functions).
Before we do that, I wish to see if we will have any support running such scenario locally, hence I've configured API gateway in AWS management console and exported OpenAPI definition.
So my template.yaml looks like
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demo SAM API
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: test
DefinitionBody:
'Fn::Transform':
Name: AWS::Include
Parameters:
Location: swagger.yaml
and swagger.yaml looks following:
openapi: "3.0.1"
info:
title: "Test.API"
description: "Test.API"
version: "2020-09-14T07:49:45Z"
servers:
- url: "https://dummydomain.com"
paths:
/api/v3/Client:
get:
x-amazon-apigateway-integration:
type: "http_proxy"
uri: "https://dummydommain.com/api/v3/client"
passthroughBehavior: "when_no_match"
httpMethod: "GET"
timeoutInMillis: 29000
components: {}
And running sam local start-api --debug
this gives error:
Error: Template does not have any APIs connected to Lambda functions
I've added dummy lambda function just to pass through the error, but still no luck - it had message in debug output:
Lambda function integration not found in Swagger document at path='/api/v3/client' method='get'
and responded to `http://localhost:3000/api/v3/client' with:
{"message":"Missing Authentication Token"}
Does this mean, that SAM is very very coupled to lambda's and it won't run API gateway as proxy locally or I'm doing something stupid?
...does not have any APIs connected to Lambda functions
Where's your lambda function? – petey