I’m wondering why the configuration of VPC Link integrations is so different from every other type of integration you can do with serverless. For example, the API gateway screen is:
So in theory you should be able to follow the documentation here:
service: service-name
provider: aws
functions: ...
resources:
Resources:
ProxyResource:
Type: AWS::ApiGateway::Resource
Properties:
ParentId:
Fn::GetAtt:
- ApiGatewayRestApi # our default Rest API logical ID
- RootResourceId
PathPart: '{proxy+}'
RestApiId:
Ref: ApiGatewayRestApi
ProxyMethod:
Type: AWS::ApiGateway::Method
Properties:
ResourceId:
Ref: ProxyResource
RestApiId:
Ref: ApiGatewayRestApi
HttpMethod: GET # the method of your proxy. Is it GET or POST or ... ?
MethodResponses:
- StatusCode: 200
Integration:
IntegrationHttpMethod: POST
Type: HTTP_PROXY
Uri: http://serverless.com/{proxy} # the URL you want to set a proxy to
IntegrationResponses:
- StatusCode: 200
RequestParameters:
integration.request.path.proxy: method.request.path.proxy
And substitute HTTP_PROXY for VPC_LINK with the added configuration indicating the VPC Link ID. It looks from the documentation however like the only way to use VPC Link is the following:
- http:
path: v1/repository
method: get
integration: http-proxy
connectionType: vpc-link
connectionId: '{your-vpc-link-id}'
cors: true
request:
uri: http://www.github.com/v1/repository
method: get
I’m wondering why there’s such a difference in the configuration between these for a baseline feature of API gateway. Also, is there a way to accomplish the greedy match proxy with the vpc link code?