- Newest
- Most votes
- Most comments
Hello.
As far as I can see from the image, it looks like the creation of the resource has already been completed.
In the next step, just connect Lambda with each resource.
You can link Lambda by opening each resource and creating a method.
https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-rest-new-console.html#getting-started-rest-new-console-create-integration
Hi @Riku_Kobayashi,
Example:
When a user sends a request to the API Gateway with the path GET service1/api/users
The expected behavior is that the service should receive the request as GET api/users.
However, in reality, the actual path received is GET service1/api/users , error 404 Not Found.
How can I set up the AWS API Gateway to effectively identify and route requests to this specific path within Service1
I suspect it's related to URL rewrite or mapping template.
Relevant content
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Thank you for your reply. Do you have Lambda proxy integration enabled? I tried the same settings in my environment, but no 404 error occurred.
Hi Yes, I did but it didn't work. I found the problem is Lambda Proxy forwarded requests within an incorrect resource path. My lambda function expected the path
api/users
but Lambda Proxy forwardedservice1/api/users
. That mean, they forwardedservice1/{proxy+}
instead of{proxy+}
only.So the question is how can I custom the Resource Path to forward for Lambda Function? Or Do we have other ways to solve it?
I don't think it's wrong for the path to be "service1/api/users" because the API under "service1" is being executed. For example, how about trying to redirect on the Lambda side as shown below?