0
votes

It's been a couple of weeks that I've been fighting with AWS API Gateway.

I've a working version of our APIs with a client certificate and a custom lambda authorizer in my API gateway console.

I am trying to export to a swagger file to import within the same AWS account as a different API, but the imported API just doesn't work.

All the endpoints are working well in the "Resources" panel with the functionality "test" but when I try to deploy a stage, it doesn't work. Both the swagger import and export work OK, and deploying the stage runs without problems but calling the API always returns {"message": null}

I've tried many times with swagger or swagger + API extensions template, with both JSON or YAML but it still fails when actually calling the APIs.

Someone knows if I need to do some extra steps in order to export and import a template?

1
Did you add the resources in your swagger file? I am trying to setup api gateway using Swagger but i have to manually setup the resources. @DarioFayza Nawaz

1 Answers

0
votes

I found the solution.

If you want to use a custom authorizer in the API Gateway, you need to define manually the "execution role ARN" ( you need to create a new one or using an existing ).

Actually, if you leave that field blank, using the auto generation function then Swagger will not be able to create automatically a new role next time when you'll try to import the template.

Obviously, no docs say that.