Al usar AWS re:Post, aceptas las AWS re:Post Términos de uso

HTTP API Gateway returning 503 with private integration

1

Hello,

I have an HTTP API Gateway set up with a VPC Link and a private integration and all I get back when hitting my route is a 503.

Here's the setup:

ECS Fargate Cluster with private subnets

ECS Task running and reporting healthy

ALB in private subnets using Target Group pointing to the ECS Task - all is reported as healthy

VPC Link in private subnets of the same VPC as the other stuff

API Gateway with proxy route with private integration pointing to the ALB mentioned above

Security groups seem to be ok (VPC Link groups allow HTTP/S traffic only from my IP, ALB groups allow all traffic, ECS service groups allow all traffic)

The thing is, I have this exact same setup with the same task in another cluster and VPC and it is working fine there. I use Terraform to build all this out so it is literally identical. I have tried recreating everything and it hasn't helped.

Here's the message I am logging to CloudFront:

{
    "httpMethod": "GET",
    "integrationErrorMessage": "-",
    "protocol": "HTTP/1.1",
    "requestId": "EqS4wjhWCYcEMJg=",
    "requestTime": "09/May/2023:15:21:40 +0000",
    "resourcePath": "-",
    "responseLength": "33",
    "routeKey": "ANY /{proxy+}",
    "sourceIp": my_ip,
    "status": "503",
    "errMsg": "Service Unavailable",
    "errType": "INTEGRATION_NETWORK_FAILURE",
    "intError": "-",
    "intIntStatus": "200",
    "intLat": "9003",
    "intReqID": "-",
    "intStatus": "-"
}

This seems to indicate the the integration can't talk to the ALB but I have no idea why. Also the response always takes just around 9 seconds

EDIT: I just spun up an EC2 instance in the same VPC (albeit in the public subnet) and I can hit the private ALB with it

  • Perhaps your load balancer was created as external instead of internal and thus it can be accessed over the public internet but not over VPC link? Please share the terraform code if you would like further assistance.

  • I'm having the exactly same problem with the same tech stack (also build with Terraform). @donkee any luck figuring it out?

preguntada hace 2 años1,5 mil visualizaciones
1 Respuesta
0

Did you check the response time of your APIs? API gateway returns 503 when api takes more than 30s to respond.

respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas