I came across this question, that was not clear to me, would appreciate if some one can clarify on it. I apologize I do not recall the options/answers I saw. I am writing the gist below:
Question: In the AS-IS architecture, an external SAAS application connects to an EC2 instance in AWS. EC2 instance does an update on DynamoDB. This is being re-architected to use serverless. The new architecture has AWS API Gateway, integration with Lambda which updates the Dynamo D/B. When the SAAS application tried to communicate with the API Gateway, it returned a HTTP 504 (or 503, I don’t recall what I saw in the test). On looking into the logs, it was observed that DynamoDB was functioning fine. What/where could the problem be for the HTTP 504 (or 503 error)? Note: The connection b/w SAAS application and EC2 was fine. i.e. the SAAS was still able to communicate with the EC2 (i.e. no changes in the VPC/security related changes).
I understand that Lambda function error is mapped to an API Gateway method response, that is typically defined by an integration response. For what types of Lambda errors do we map them to HTTP 504 and HTTP 503 in API Gateway?
Am I right in assuming that the likely cause is because of the Lambda function time out? If yes, how is a function time out mapped to in API Gateway?
1/ Be very careful that you are not in breach of your NDA with AWS in discussing exam questions particularly if you state or imply that they are from the exam.
503 indicates that the Service is not available.
504 indicates endpoint timeout
I need to do some research. At 1st look I would be looking at the EC2/Lambda connection to DDB. Could it be as simple as a Role error preventing Lambda connecting to DDB ?
I will come back shortly after doing some looking.
Moderator & Coach
being clear of it is 503 or 504 is important as it will indicate different things.
Lambda timeout is a possibility. That could be due to the function time limit being to short or one of the other configurable connection timeouts. That could also relate to an issue connecting to DDB preventing the Lambda function completing.
Given that it is an exam question, I would guess that they are going for a common and well documented and often seen issue related to Lambda.
Without seeing the original question I am guessing that it was due to the Lambda function timing out.