amazon-web-servicesaws-cli

AWS CLI getting 504 Gateway Timeout on apigateay put-rest-api


We have a large API that we deploy using OpenAPI specification since it's much faster than deploying individual components. We do this through the aws apigateway put-rest-api command using AWS CLIv2.

This then fails with a 504 Gateway Timeout error after exactly 105 seconds. But the request actually completes in the background (on the AWS side) and the API is deployed properly.

So AWS has a 105-second timeout on the API that is consumed by the CLI (PutRestApi), but the backend process keeps running after that timeout. So the CLI gets the 504 and thinks it needs to retry the request, and then that second request fails because there's already an import running (the first one, which is still going).

AWS Support has been useless on this. Since this is a timeout on the AWS API side, and not the client, I can't think of any workaround for this. Thoughts?


Solution

  • AWS Support confirmed that this was an internal bug and pushed a fix. All good now.