Bird
0
0

You configured API Gateway with Lambda integration but get a 502 Bad Gateway error. What is a common cause?

medium📝 Debug Q6 of 15
AWS - API Gateway
You configured API Gateway with Lambda integration but get a 502 Bad Gateway error. What is a common cause?
ALambda function is missing permissions for API Gateway
BLambda function returns a malformed response
CAPI Gateway endpoint URL is incorrect
DLambda function is in a different AWS region
Step-by-Step Solution
Solution:
  1. Step 1: Understand 502 error meaning

    502 indicates API Gateway received an invalid response from Lambda.
  2. Step 2: Identify common cause

    Malformed Lambda response (missing statusCode/body) causes 502 errors.
  3. Final Answer:

    Lambda function returns a malformed response -> Option B
  4. Quick Check:

    Malformed Lambda response = 502 error [OK]
Quick Trick: Malformed Lambda response causes 502 error [OK]
Common Mistakes:
MISTAKES
  • Assuming permission errors cause 502
  • Confusing 502 with 403 or 404
  • Ignoring response format requirements

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes