Hi
Error 504 Indicates that the load balancer closed a connection because a request did not complete within the idle timeout period. You can increase the idle timeout following guideline on this document[1]https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html
Troubleshooting steps for API Gateway Network error communicating with endpoint
Try a curl request to your backend integration endpoint using the same parameters that you expect API Gateway to pass. Confirm that the request completes and takes less than 29 seconds, which is the API Gateway Integration timeout.
Investigate Logs:
try calling the API via the Test facility in the API Gateway console and inspect the output to get more information.
Confirm that API Gateway is calling the correct endpoint and is passing the header and body values that you expect. Also, observe any error messages from calling the integration endpoint.
Sometimes the error can be caused if the backend NLB (if used) does not have Cross-Zone Load Balancing enabled and you do not have healthy resources in all AZs selected for the NLB. So, ensure that the “cross_zone.enabled” is set to “true” on the NLB. You can find this information on the ELBV2 toollinker tool → NLB → Load Balancer properties → cross_zone.enabled
Relevant questions
POST request on .NET Elastic Beanstalk instance takes longer than GET on similar operation
asked 4 months agoAccessing AWS Cloud Map from a Lambda in a VPC
asked 5 months agoHow do I configure an Amazon MQ instance that's in a VPC to invoke a Lambda function?
Accepted Answerasked 2 years agoDo Elastic Beanstalk Web Server Environment Need A Public Elastic IP
asked 3 months agoHow do you connect to a VPC Endpoint when your in a different AZ?
asked 8 months agoHow to configure ELB to allow outbound API calls from third-party SDKs
asked 2 months agoRunning AWS elasticbeanstalk single instance mode in a private VPC
asked 3 months agoAWS Elastic Beanstalk Running in Private VPC without internet access
asked 5 months agoHow to configure elastic beanstalk environment with a load balancer to support blue/green deployments?
asked 6 months agoCreate API GW Websocket API that is only accessible from within a VPC.
asked 3 months ago