sumanth shetty
sumanth shetty

Reputation: 2181

can we have multiple http method in single resource in API gateway in AWS?

I am trying my hands with API Gateways in AWS.

enter image description here

Both these methods have same API end point. By default it is calling lambda function set for GET method.

I feel i missed a trick here somewhere.

Should i create a different Resource for PUT method or we have it in same resource with different api end point ?

Upvotes: 1

Views: 1944

Answers (1)

Chris Williams
Chris Williams

Reputation: 35188

Alternatively to this you could use the ANY method but you will become responsible in your Lambda for interpreting how you handle any method you do not want to support.

You can set up the ANY method on a non-proxy resource as well. Combining the ANY method with a proxy resource, you get a single API method setup for all of the supported HTTP methods against any resources of an API. Furthermore, the backend can evolve without breaking the existing API setup.

More information is available here.

Upvotes: 1

Related Questions