apic icon indicating copy to clipboard operation
apic copied to clipboard

AWS API Gateway Integration

Open cajund opened this issue 3 years ago • 4 comments

Hi Folks,

I'd like to generate a swagger export that includes something similar to:

x-amazon-apigateway-integration:
    type: aws_proxy
    httpMethod: POST
    payloadFormatVersion: "1.0"
    uri: 
      Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${BackendFunction.Arn}/invocations
    responses:
      default:
        statusCode: 200

Is there a way to add these non-standard tags to a request?

Thanks.

cajund avatar Mar 28 '23 15:03 cajund

Hi @cajund, I came across this exact same requirement last week while working on a project. I am working on adding the feature for defining additional properties and should be able to release it in a day or two.

bjdash avatar Mar 31 '23 14:03 bjdash

Added the option to define additional properties for endpoints. You can now open th endpoint and scroll down to the bottom to define additional properties for the endpoint. This now available on the webapp and the Chrome extension. I will notify here once the Edge extension and Native apps are published for Mac, Windows and Linux.

bjdash avatar Apr 11 '23 16:04 bjdash

Thanks! I'll see if I can test it in the extension, in the interim.

cajund avatar Apr 11 '23 17:04 cajund

@bjdash ,

So finally got a change to test this. Two questions:

First, the YAML output looks like this (with the quotes and the pipe):

      'x-amazon-apigateway-integration:': |
        type: aws_proxy
            httpMethod: POST
            payloadFormatVersion: "1.0"
            uri: 
              Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${BackendFunction.Arn}/invocations
            responses:
              default:
                statusCode: 200

I'll have to test this from Terraform into API Gateway, but I suspect that this may be an issue on the import. Will follow up with this soon. I am starting a new project and want to include APIC into the workflow.

Second, this block is the same for all (or a vast majority of) endpoints. Can I use a "trait" to insert this into all of them in one place?

Thanks!

cajund avatar Jun 10 '23 16:06 cajund