k1LoW/awspec

API Gateway tests fail if more than 25 APIs in Gateway even though APIs exist

ckthiessen opened this issue · 2 comments

The query to determine if a rest api exists is using the #get_rest_apis method from the apigateway client, which has a default to only return 25 rest apis. If my API Gateway instance has more than 25 rest apis, some of the tests fail even though the APIs that the tests fail on exist in my API Gateway. This can be fixed by increasing the number of returned APIs to the maximum of 500 using the limit parameter and making use of the position parameter to paginate if more than 500 APIs exist.

Example test that fails even though it exists in API Gateway:

describe apigateway(WEBHOOKS_API) do
  it { should exist }
end

Relevant Documentation: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/APIGateway/Client.html#get_rest_apis-instance_method

@k1LoW , the PR #506 is already merged, I think you can close this one.

k1LoW commented

👍