Forum Discussion

Stoplight's avatar
Stoplight
Community Manager
10 months ago

AWS API Gateway "X" Integration

Originally posted by user cajund to the Stoplight Community on 06/16/2023 at 09.59 ET.

Hi Folks,

Getting started with Stoplight and I have a question. My workflow is that I would like to use a GUI editor to create an Open API doc, that is then used by Terraform to manage an AWS API Gateway config. In order to link the backend (like a Lambda) you need to use an extra "x-amazon-apigateway-integration" construct. I see Stoplight can create these (a big win for the app).

The one thing that is missing is that all of my endpoints need the same config, and I was wondering if there is a way that you can include these types of configs as an "include" much like a model or response can be included. I see there is a way to copy and paste, but wanted to ask to see if there is a feature that I may be missing.

Thanks.

  • Stoplight's avatar
    Stoplight
    Community Manager

    Troy (Staff) [06/22/2023 - 13:13 ET]

    To be clear: No, we don't currently have a mechanism to reuse, reference / $ref, or include x-extensions in multiple places. It's something we're looking into and as mentioned, submitting your feedback goes a long way to helping us deliver useful features 🙂

    In fact, we've been thinking about a deeper AWS API Gateway integration. Out of curiosity , if you had the ability to deploy changes to your gateway directly from Stoplight, would that be useful to you?

    • Stoplight's avatar
      Stoplight
      Community Manager

      cajund (OP) [06/22/2023 - 15:33 ET]

      Actually, not really. I want all of the elements of my infrastructure to be managed in the same place, in the same repo. We have compliance reasons for this, but there are many other good reasons to use consistent procedures and pipelines. My intentions with Stoplight are to create the YAML file using something more user friendly that a 10K+ line long swagger file. Tools like yours are helpful to maintain consistency and compliance, which is virtually impossible to do with a giant text file.

      So, the swagger file that comes out of this tool goes into Terraform, and Terraform deploys the changes to the API gateway. I can track these changes in a repo as well as the historical logs for the pipeline run. I can also use the same swagger file to build local SAM-based environments for local development.

      Making changes directly to the aws resource would be convenient (especially since the AWS Console experience is quite cumbersome), but at some point, those changes need to pass through automation to a production environment. Developers wouldn't be able to touch that directly. In fact, in many cases, they just have access to the code and not the AWS Console.

      At this time, the copy/paste of the extension is practically a non-issue. Aside from this comment, it's working well.

      • Stoplight's avatar
        Stoplight
        Community Manager

        Troy (Staff) [06/22/2023 - 16:19 ET]

        Understood and makes sense, thanks! Hopefully we'll have some QOL improvements for managing & reusing x-extensions in Q3.